A2 <-read.csv('A2.csv',header=FALSE)
A3 <-read.csv('A3.csv',header=FALSE)
A2$V3<-'Standard Digest'
A3$V3<-'Experimental Digest'
A2 <-A2[,1:3]
A3 <-A3[,1:3]
ms_data <- rbind(A2,A3)
names(ms_data)<-c('mz','Intensity','Sample')
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.5.1 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.1
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
ggplot(ms_data, aes(x= mz,y=Intensity))+
geom_point(aes(colour = Sample))+
scale_color_manual(values=c("#f7dc6f","#5499c7"))+
xlab("m/z Ratio")+ ylab("Millivolts")+
theme(legend.position = "bottom")
#Create Column Plot with points
library(tidyverse)
ggplot(ms_data, aes(x= mz,y=Intensity))+
geom_col(aes(colour = Sample,fill= Sample))+
scale_color_manual(values=c("#f7dc6f","#5499c7"))+
scale_fill_manual(values=c("#f7dc6f","#5499c7"))+
xlab("m/z Ratio")+ ylab("Millivolts")+
theme(legend.position = "bottom")
#Find peaks with Identical m/z
matchSpectra <- merge(A2,A3, by= "V1")
write.csv(matchSpectra,"matchSpectra.csv")