There are a series of very common graphics used in FT-ICR-MS analysis. This vignette will walk you through several of them.
library(FTICRProcessing) library(ggplot2) library(knitr)
inputFile <- '../private/data/FTICRoutput.csv'
inputFile <- 'data/ProcessedOutput.csv'
Just to give you an idea of the file format:
fileFormat <- read.csv(inputFile)[,c('m.z', 'X.out1.', 'X.out10.', 'X.out11.', 'X.out12.', 'C', 'H', 'O', 'N', 'X13C', 'S', 'P')] kable(head(fileFormat[fileFormat[, 'X.out1.'] > 0,]))
Create a Van Krevlen plot using both the log of the intensity and the precense of S or N for coloration.
for(setNum in 1){ data.df <- readFTICR(inputFile, massHeader='m.z', sampleRegStr='X.out', samplesToRead=1:9+setNum*9, elementKey = list(C='C', H='H', O='O', N='N', S='S', P='P')) print(ggplot(data.df) + geom_point(aes(x=OtoC, y=HtoC, color=log(intensity)), alpha=0.5) + facet_wrap(~sample)) print(ggplot(data.df) + geom_point(aes(x=OtoC, y=HtoC, color=(S>0 | N > 0)), alpha=0.5) + facet_wrap(~sample)) }
for(setNum in 1){ data.df <- readFTICR(inputFile, massHeader='m.z', elementKey = list(C='C', H='H', O='O', N='N', S='S', P='P'), sampleRegStr='X.out', samplesToRead=1:9+setNum*9) print(ggplot(data.df) + geom_histogram(aes(x=O, y=..density..)) + xlim(1, max(data.df$O, na.rm=TRUE)) + facet_wrap(~sample)) print(ggplot(data.df) + geom_histogram(aes(x=O)) + xlim(1, max(data.df$O, na.rm=TRUE)) + facet_wrap(~sample)) }
CO2mass <- 44.01 CH4mass <- 16.04 for(setNum in 1){ msData <- readFTICR(inputFile, massHeader='m.z', sampleRegStr='X.out', samplesToRead=1:9+setNum*9) print(ggplot(msData) + geom_point(aes(x=m.z, y=m.z/CO2mass))) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.