vignettes/globalstd.Rmd
globalstd.Rmdpmd package use Paired Mass Distance (PMD) relationship to analysis the GC/LC-MS based non-targeted data. PMD means the distance between two masses or mass to charge ratios. In mass spectrometry, PMD would keep the same value between two masses and two mass to charge ratios(m/z). There are two kinds of PMD involved in this package: PMD from the same compound and PMD from different compounds. In GC/LC-MS or XCMS based non-targeted data analysis, peaks could be separated by chronograph and same compound means ions from similar retention times or ions co-eluted by certain column.
For MS1 full scan data, we could build retention time(RT) bins to assign peaks into different RT groups by retention time hierarchical clustering analysis. For each RT group, the peaks should come from same compounds or co-elutes. If certain PMD appeared in multiple RT groups, it would be related to the relationship about adducts, neutral loss, isotopologues or common fragments ions.
The peaks from different retention time groups would like to be different compounds separated by chronograph. The PMD would reflect the relationship about homologous series or chemical reactions.
GlobalStd algorithm use the PMD within same RT group to find independent peaks among certain data set. Then, structure/reaction directed analysis use PMD from different RT groups to screen important compounds or reactions.
The input data should be a list object with at least two elements from a peaks list:
mz, high resolution mass spectrometry is requiredrt
However, I suggested to add intensity and group information to the list for validation of PMD analysis.
In this package, a data set from in vivo solid phase micro-extraction(SPME) was attached. This data set contain 9 samples from 3 fish with triplicates samples for each fish. Here is the data structure:
library(pmd) data("spmeinvivo") str(spmeinvivo) #> List of 4 #> $ data : num [1:1459, 1:9] 1095 10439 10154 2797 90211 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : chr [1:1459] "100.1/170" "100.5/86" "101/85" "103.1/348" ... #> .. ..$ : chr [1:9] "1405_Fish1_F1" "1405_Fish1_F2" "1405_Fish1_F3" "1405_Fish2_F1" ... #> $ group:'data.frame': 9 obs. of 2 variables: #> ..$ sample_name : chr [1:9] "1405_Fish1_F1" "1405_Fish1_F2" "1405_Fish1_F3" "1405_Fish2_F1" ... #> ..$ sample_group: chr [1:9] "fish1" "fish1" "fish1" "fish2" ... #> $ mz : num [1:1459] 100 101 101 103 104 ... #> $ rt : num [1:1459] 170.2 86.3 84.9 348.1 48.8 ...
You could build this list object from the xcms objects via enviGCMS package. When you have a xcmsSet object or XCMSnExp object named xset, you could use enviGCMS::getmzrt(xset) or enviGCMS::getmzrt2(xset) to get such list. Of course you could build such list by yourself.
GlobalStd algorithm try to find independent peaks among certain peaks list. The first step is retention time hierarchical clustering analysis. The second step is to find the relationship among adducts, neutral loss, isotopologues and common fragments ions. The third step is to screen the independent peaks.
Here is a workflow for this algorithm:
knitr::include_graphics('https://yufree.github.io/presentation/figure/GlobalStd.png')

pmd <- getpaired(spmeinvivo, rtcutoff = 10, ng = 10) #> 75 retention time cluster found. #> 380 paired masses found #> 9 unique within RT clusters high frequency PMD(s) used for further investigation. #> 719 isotopologue(s) related paired mass found. #> 492 multi-charger(s) related paired mass found. plotrtg(pmd)

This plot would show the distribution of RT groups. The rtcutoff in function getpaired could be used to set the cutoff of the distances in retention time hierarchical clustering analysis.
Take care of the retention time cluster with lots of peaks. In this case, such cluster could be co-eluted compounds on certain column. It would be wise to trim the retention time window for high quality peaks.
The ng in function getpaired could be used to set cutoff of global PMD’s retention time group numbers. If ng is 10, at least 10 of the retention time groups should contain the shown PMD relationship. You could use plotpaired to show the distribution.
plotpaired(pmd)

You could also show the distribution of PMD relationship by index:
# show the unique PMD found by getpaired function for(i in 1:length(unique(pmd$paired$diff2))){ diff <- unique(pmd$paired$diff2)[i] index <- pmd$paired$diff2 == diff plotpaired(pmd,index) }









This is an easy way to find potential adducts of the data by high frequency PMD from the same compound. For example, 21.98 Da could be the mass distances between \([M+H]^+\) and \([M+Na]^+\). In this case, user could find the potential adducts or neutral loss even when they have no preferred adducts list. If one adduct exist in certain analytical system, the high frequency PMD will reveal such relationship. The high frequency PMD list could also be used to check the fragmental pattern of in-source reactions as long as such patterns are popular among all collected ions.
You could use getstd function to get the independent peaks. Independent peaks mean the peaks list removing the redundant peaks such as adducts, neutral loss, isotopologues and comment fragments ions found by PMD analysis in STEP2. Ideally, those peaks could be molecular ions while they might still contain redundant peaks.
std <- getstd(pmd) #> 8 retention group(s) have single peaks. 14 23 32 33 54 55 56 75 #> 11 group(s) with multiple peaks while no isotope/paired relationship 4 5 7 8 11 41 42 49 68 72 73 #> 9 group(s) with multiple peaks with isotope without paired relationship 2 9 22 26 52 62 64 66 70 #> 4 group(s) with paired relationship without isotope 1 10 15 18 #> 43 group(s) with paired relationship and isotope 3 6 12 13 16 17 19 20 21 24 25 27 28 29 30 31 34 35 36 37 38 39 40 43 44 45 46 47 48 50 51 53 57 58 59 60 61 63 65 67 69 71 74 #> 297 std mass found.
Here you could plot the peaks by plotstd function to show the distribution of independent peaks:
plotstd(std)

You could also plot the peaks distribution by assign a retention time group via plotstdrt:
par(mfrow = c(2,3)) plotstdrt(std,rtcluster = 23,main = 'Retention time group 23') plotstdrt(std,rtcluster = 9,main = 'Retention time group 9') plotstdrt(std,rtcluster = 18,main = 'Retention time group 18') plotstdrt(std,rtcluster = 67,main = 'Retention time group 67') plotstdrt(std,rtcluster = 49,main = 'Retention time group 49') plotstdrt(std,rtcluster = 6,main = 'Retention time group 6')

Original GlobalStd algorithm only use mass to charge ratio and retention time of peaks to select independent peaks. However, if intensity data across samples are available, correlation coefficient of paired ions could be used to further filter the random noise in high frequency PMDs. You could set up cutoff of Pearson Correlation Coefficient between peaks to refine the peaks selected by GlobalStd within same retention time groups. In this case, the numbers of selected independent peaks will be further reduced. When you use this parameter, make sure the intensity data are from real samples instead of blank samples, which will affect the calculation of correlation coefficient.
std2 <- getstd(pmd,corcutoff = 0.9) #> 8 retention group(s) have single peaks. 14 23 32 33 54 55 56 75 #> 23 group(s) with multiple peaks while no isotope/paired relationship 2 4 5 7 8 10 11 15 18 26 35 39 41 42 49 50 59 62 68 69 70 72 73 #> 14 group(s) with multiple peaks with isotope without paired relationship 9 12 22 24 27 28 34 51 52 57 60 64 66 71 #> 3 group(s) with paired relationship without isotope 1 53 74 #> 27 group(s) with paired relationship and isotope 3 6 13 16 17 19 20 21 25 29 30 31 36 37 38 40 43 44 45 46 47 48 58 61 63 65 67 #> 120 std mass found.
You need to check the GlobalStd algorithm’s results by principal components analysis(PCA). If we removed too much peaks containing information, the score plot of reduced data set would show great changes.
library(enviGCMS) par(mfrow = c(2,2),mar = c(4,4,2,1)+0.1) plotpca(std$data,lv = as.numeric(as.factor(std$group)),main = "all peaks") plotpca(std$data[std$stdmassindex,],lv = as.numeric(as.factor(std$group)),main = paste(sum(std$stdmassindex),"independent peaks")) plotpca(std2$data[std2$stdmassindex,],lv = as.numeric(as.factor(std$group)),main = paste(sum(std2$stdmassindex),"reduced independent peaks"))

You might find original GlobalStd algorithm show a similar PCA score plot with original data while GlobalStd algorithm considering intensity data seems change the profile. The major reason is that correlation coefficient option in the algorithm will remove the paired ions without strong correlation. It will be aggressive to remove low intensity peaks, which are vulnerable by baseline noise. However, such options would be helpful if you only concern high quanlity peaks for following analysis. Otherwise, original GlobalStd will keep the most information for explorer purpose.
GlobalStd algorithm in pmd package could be treated as a method to extract pseudo spectra. You could use getcluster to get peaks groups information for all GlobalStd peaks. This function would consider the merge of GlobalStd peaks when certain peak is involved in multiple clusters. Then you could choose export peaks with the highest intensities or base peaks in each GlobalStd merged peaks groups. Meanwhile, you could also include the correlation coefficient cutoff to further improve the data quality.
stdcluster <- getcluster(std) # extract pseudospectra for std peak 71 idx <- unique(stdcluster$cluster$largei[stdcluster$cluster$i==71]) plot(stdcluster$cluster$mz[stdcluster$cluster$largei==idx],stdcluster$cluster$ins[stdcluster$cluster$largei==idx],type = 'h',xlab = 'm/z',ylab = 'intensity',main = 'pseudo spectra for GlobalStd peak 71')

# export peaks with the highest intensities in each GlobalStd peaks groups. data <- stdcluster$data[stdcluster$stdmassindex2,] # considering the correlation coefficient cutoff stdcluster2 <- getcluster(std, corcutoff = 0.9) # considering the correlation coefficient cutoff for both psedospectra extraction and GlobalStd algorithm stdcluster3 <- getcluster(std2, corcutoff = 0.9)
We supplied getcorcluster to find peaks groups by correlation analysis only. The base peaks of correlation cluster were selected to stand for the compounds.
corcluster <- getcorcluster(spmeinvivo) #> 75 retention time cluster found. # extract pseudospectra 1@46 peak <- corcluster$cluster[corcluster$cluster$largei == '1@46',] plot(peak$ins~peak$mz,type = 'h',xlab = 'm/z',ylab = 'intensity',main = 'pseudo spectra for correlation cluster')

Then we could compare the compare reduced result using PCA similarity factor. A good peak selection algorithm could show a high PCA similarity factor compared with original data set while retain the minimized number of peaks.
par(mfrow = c(3,3),mar = c(4,4,2,1)+0.1) plotpca(std$data[std$stdmassindex,],lv = as.numeric(as.factor(std$group)),main = paste(sum(std$stdmassindex),"independent peaks")) plotpca(std$data[stdcluster$stdmassindex2,],lv = as.numeric(as.factor(std$group)),main = paste(sum(stdcluster$stdmassindex2),"base peaks")) plotpca(std$data[stdcluster2$stdmassindex2,],lv = as.numeric(as.factor(std$group)),main = paste(sum(stdcluster2$stdmassindex2),"independent base peaks")) plotpca(std$data[corcluster$stdmassindex,],lv = as.numeric(as.factor(std$group)),main = paste(sum(corcluster$stdmassindex),"peaks without correlationship")) plotpca(std$data[corcluster$stdmassindex2,],lv = as.numeric(as.factor(std$group)),main = paste(sum(corcluster$stdmassindex2),"base peaks without correlationship")) plotpca(std$data,lv = as.numeric(as.factor(std$group)),main = paste(nrow(std$data),"all peaks")) plotpca(std$data[stdcluster3$stdmassindex2,],lv = as.numeric(as.factor(std$group)),main = paste(sum(stdcluster3$stdmassindex2),"reduced independent base peaks")) pcasf(std$data, std$data[std$stdmassindex,]) #> pcasf #> 0.9993495 pcasf(std$data, std$data[stdcluster$stdmassindex2,]) #> pcasf #> 0.9993581 pcasf(std$data, std$data[stdcluster2$stdmassindex2,]) #> pcasf #> 0.9993463 pcasf(std$data, std$data[corcluster$stdmassindex,]) #> pcasf #> 0.9471586 pcasf(std$data, std$data[corcluster$stdmassindex2,]) #> pcasf #> 0.9497193 pcasf(std$data, std$data[stdcluster3$stdmassindex2,]) #> pcasf #> 0.7135268

In this case, five peaks selection algorithms are fine to stand for the original peaks with PCA similarity score larger than 0.9. However, the independent base peaks retain the most information with relative low numbers of peaks.
getsda function could be used to perform Structure/reaction directed analysis. The cutoff of frequency is automate found by PMD network analysis with the largest mean distance of all nodes.
sda <- getsda(std) #> PMD frequency cutoff is 6 by PMD network analysis with largest network average distance 5.99 . #> 57 groups were found as high frequency PMD group. #> 0 was found as high frequency PMD. #> 1.98 was found as high frequency PMD. #> 2.01 was found as high frequency PMD. #> 2.02 was found as high frequency PMD. #> 6.97 was found as high frequency PMD. #> 11.96 was found as high frequency PMD. #> 12 was found as high frequency PMD. #> 12.04 was found as high frequency PMD. #> 13.98 was found as high frequency PMD. #> 14.02 was found as high frequency PMD. #> 14.05 was found as high frequency PMD. #> 15.99 was found as high frequency PMD. #> 16.03 was found as high frequency PMD. #> 19.04 was found as high frequency PMD. #> 28.03 was found as high frequency PMD. #> 30.05 was found as high frequency PMD. #> 31.99 was found as high frequency PMD. #> 37.02 was found as high frequency PMD. #> 42.05 was found as high frequency PMD. #> 48.04 was found as high frequency PMD. #> 48.98 was found as high frequency PMD. #> 49.02 was found as high frequency PMD. #> 54.05 was found as high frequency PMD. #> 56.06 was found as high frequency PMD. #> 56.1 was found as high frequency PMD. #> 58.04 was found as high frequency PMD. #> 58.08 was found as high frequency PMD. #> 58.11 was found as high frequency PMD. #> 63.96 was found as high frequency PMD. #> 66.05 was found as high frequency PMD. #> 68.06 was found as high frequency PMD. #> 70.04 was found as high frequency PMD. #> 70.08 was found as high frequency PMD. #> 74.02 was found as high frequency PMD. #> 80.03 was found as high frequency PMD. #> 82.08 was found as high frequency PMD. #> 88.05 was found as high frequency PMD. #> 91.1 was found as high frequency PMD. #> 93.12 was found as high frequency PMD. #> 96.09 was found as high frequency PMD. #> 101.05 was found as high frequency PMD. #> 108.13 was found as high frequency PMD. #> 110.11 was found as high frequency PMD. #> 112.16 was found as high frequency PMD. #> 116.08 was found as high frequency PMD. #> 122.15 was found as high frequency PMD. #> 124.16 was found as high frequency PMD. #> 126.14 was found as high frequency PMD. #> 148.04 was found as high frequency PMD. #> 150.2 was found as high frequency PMD. #> 173.18 was found as high frequency PMD. #> 191.08 was found as high frequency PMD. #> 191.15 was found as high frequency PMD. #> 192.19 was found as high frequency PMD. #> 194.2 was found as high frequency PMD. #> 267.25 was found as high frequency PMD. #> 325.3 was found as high frequency PMD.
Such largest mean distance of all nodes is calculated for top 1 to 100 (if possible) high frequency PMDs. Here is a demo for the network generation process.
library(igraph) #> #> Attaching package: 'igraph' #> The following objects are masked from 'package:stats': #> #> decompose, spectrum #> The following object is masked from 'package:base': #> #> union cdf <- sda$sda # get the PMDs and frequency pmds <- as.numeric(names(table(cdf$diff2)[order(table(cdf$diff2))])) freq <- as.numeric(table(cdf$diff2)[order(table(cdf$diff2))]) # filter the frequency larger than 10 for demo pmds <- pmds[freq>10] cdf <- sda$sda[sda$sda$diff2 %in% pmds,] g <- igraph::graph_from_data_frame(cdf,directed = F) l <- igraph::layout_with_fr(g) for(i in 1:length(pmds)){ g2 <- igraph::delete_edges(g,which(E(g)$diff2%in%pmds[1:i])) plot(g2,edge.width=1,vertex.label="",vertex.size=1,layout=l,main=paste('Top',length(pmds)-i,'high frequency PMDs')) }



















Here we could find more and more compounds will be connected with more high frequency PMDs. Meanwhile, the mean distance of all network nodes will increase. However, some PMDs are generated by random combination of ions. In this case, if we included those PMDs for the network, the mean distance of all network nodes will decrease. Here, the largest mean distance means no more information will be found for certain data set and such value is used as the cutoff for high frequency PMDs selection.
You could use plotstdsda to show the distribution of the selected paired peaks.
plotstdsda(sda)

You could also use index to show the distribution of certain PMDs.
par(mfrow = c(1,3),mar = c(4,4,2,1)+0.1) plotstdsda(sda,sda$sda$diff2 == 2.02) plotstdsda(sda,sda$sda$diff2 == 28.03) plotstdsda(sda,sda$sda$diff2 == 58.04)

Structure/reaction directed analysis could be directly performed on all the peaks, which is slow to process:
sdaall <- getsda(spmeinvivo) #> PMD frequency cutoff is 104 by PMD network analysis with largest network average distance 14.06 . #> 6 groups were found as high frequency PMD group. #> 0 was found as high frequency PMD. #> 2.02 was found as high frequency PMD. #> 28.03 was found as high frequency PMD. #> 31.01 was found as high frequency PMD. #> 58.04 was found as high frequency PMD. #> 116.08 was found as high frequency PMD. par(mfrow = c(1,3),mar = c(4,4,2,1)+0.1) plotstdsda(sdaall,sdaall$sda$diff2 == 2.02) plotstdsda(sdaall,sdaall$sda$diff2 == 28.03) plotstdsda(sdaall,sdaall$sda$diff2 == 58.04)

Structure/Reaction directed analysis could also use correlation to restrict the paired ions. However, similar to GlobalStd algorithm, such cutoff will remove low intensity data. Researcher should have a clear idea to use this cutoff.
sda2 <- getsda(std, corcutoff = 0.9) #> PMD frequency cutoff is 6 by PMD network analysis with largest network average distance 5.99 . #> 45 groups were found as high frequency PMD group. #> 0 was found as high frequency PMD. #> 1.98 was found as high frequency PMD. #> 2.01 was found as high frequency PMD. #> 2.02 was found as high frequency PMD. #> 11.96 was found as high frequency PMD. #> 12 was found as high frequency PMD. #> 12.04 was found as high frequency PMD. #> 13.98 was found as high frequency PMD. #> 14.02 was found as high frequency PMD. #> 14.05 was found as high frequency PMD. #> 15.99 was found as high frequency PMD. #> 16.03 was found as high frequency PMD. #> 19.04 was found as high frequency PMD. #> 28.03 was found as high frequency PMD. #> 30.05 was found as high frequency PMD. #> 31.99 was found as high frequency PMD. #> 42.05 was found as high frequency PMD. #> 48.98 was found as high frequency PMD. #> 49.02 was found as high frequency PMD. #> 54.05 was found as high frequency PMD. #> 56.06 was found as high frequency PMD. #> 58.04 was found as high frequency PMD. #> 58.08 was found as high frequency PMD. #> 63.96 was found as high frequency PMD. #> 66.05 was found as high frequency PMD. #> 68.06 was found as high frequency PMD. #> 70.08 was found as high frequency PMD. #> 74.02 was found as high frequency PMD. #> 80.03 was found as high frequency PMD. #> 82.08 was found as high frequency PMD. #> 88.05 was found as high frequency PMD. #> 93.12 was found as high frequency PMD. #> 96.09 was found as high frequency PMD. #> 108.13 was found as high frequency PMD. #> 110.11 was found as high frequency PMD. #> 112.16 was found as high frequency PMD. #> 116.08 was found as high frequency PMD. #> 122.15 was found as high frequency PMD. #> 124.16 was found as high frequency PMD. #> 126.14 was found as high frequency PMD. #> 191.15 was found as high frequency PMD. #> 192.19 was found as high frequency PMD. #> 194.2 was found as high frequency PMD. #> 267.25 was found as high frequency PMD. #> 325.3 was found as high frequency PMD. plotstdsda(sda2)

When you only have data of peaks without retention time or compounds list, structure/reaction directed analysis could also be done by getrda function.
sda <- getrda(spmeinvivo$mz[std$stdmassindex]) #> 38116 pmd found. #> 11 pmd used.
Retention time cluster cutoff should fit the peak picking algorithm. For HPLC, 10 is suggested and 5 could be used for UPLC.
Global PMD’s retention time group numbers should be around 20 percent of the retention time cluster numbers. For example, if you find 100 retention time clusters, I suggested you use 20 as the cutoff of empirical global PMD’s retention time group numbers.
Another important hint is that pre-filter your peak list by black samples or other quality control samples. Otherwise the running time would be long and lots of pmd relationship would be just from noise.
globalstd function is a wrap function to process GlobalStd algorithm and structure/reaction directed analysis in one line. All the plot function could be directly used on the list objects from globalstd function.
result <- globalstd(spmeinvivo,ng=10) #> 75 retention time cluster found. #> 380 paired masses found #> 9 unique within RT clusters high frequency PMD(s) used for further investigation. #> 719 isotopologue(s) related paired mass found. #> 492 multi-charger(s) related paired mass found. #> 8 retention group(s) have single peaks. 14 23 32 33 54 55 56 75 #> 11 group(s) with multiple peaks while no isotope/paired relationship 4 5 7 8 11 41 42 49 68 72 73 #> 9 group(s) with multiple peaks with isotope without paired relationship 2 9 22 26 52 62 64 66 70 #> 4 group(s) with paired relationship without isotope 1 10 15 18 #> 43 group(s) with paired relationship and isotope 3 6 12 13 16 17 19 20 21 24 25 27 28 29 30 31 34 35 36 37 38 39 40 43 44 45 46 47 48 50 51 53 57 58 59 60 61 63 65 67 69 71 74 #> 297 std mass found. #> PMD frequency cutoff is 6 by PMD network analysis with largest network average distance 5.99 . #> 57 groups were found as high frequency PMD group. #> 0 was found as high frequency PMD. #> 1.98 was found as high frequency PMD. #> 2.01 was found as high frequency PMD. #> 2.02 was found as high frequency PMD. #> 6.97 was found as high frequency PMD. #> 11.96 was found as high frequency PMD. #> 12 was found as high frequency PMD. #> 12.04 was found as high frequency PMD. #> 13.98 was found as high frequency PMD. #> 14.02 was found as high frequency PMD. #> 14.05 was found as high frequency PMD. #> 15.99 was found as high frequency PMD. #> 16.03 was found as high frequency PMD. #> 19.04 was found as high frequency PMD. #> 28.03 was found as high frequency PMD. #> 30.05 was found as high frequency PMD. #> 31.99 was found as high frequency PMD. #> 37.02 was found as high frequency PMD. #> 42.05 was found as high frequency PMD. #> 48.04 was found as high frequency PMD. #> 48.98 was found as high frequency PMD. #> 49.02 was found as high frequency PMD. #> 54.05 was found as high frequency PMD. #> 56.06 was found as high frequency PMD. #> 56.1 was found as high frequency PMD. #> 58.04 was found as high frequency PMD. #> 58.08 was found as high frequency PMD. #> 58.11 was found as high frequency PMD. #> 63.96 was found as high frequency PMD. #> 66.05 was found as high frequency PMD. #> 68.06 was found as high frequency PMD. #> 70.04 was found as high frequency PMD. #> 70.08 was found as high frequency PMD. #> 74.02 was found as high frequency PMD. #> 80.03 was found as high frequency PMD. #> 82.08 was found as high frequency PMD. #> 88.05 was found as high frequency PMD. #> 91.1 was found as high frequency PMD. #> 93.12 was found as high frequency PMD. #> 96.09 was found as high frequency PMD. #> 101.05 was found as high frequency PMD. #> 108.13 was found as high frequency PMD. #> 110.11 was found as high frequency PMD. #> 112.16 was found as high frequency PMD. #> 116.08 was found as high frequency PMD. #> 122.15 was found as high frequency PMD. #> 124.16 was found as high frequency PMD. #> 126.14 was found as high frequency PMD. #> 148.04 was found as high frequency PMD. #> 150.2 was found as high frequency PMD. #> 173.18 was found as high frequency PMD. #> 191.08 was found as high frequency PMD. #> 191.15 was found as high frequency PMD. #> 192.19 was found as high frequency PMD. #> 194.2 was found as high frequency PMD. #> 267.25 was found as high frequency PMD. #> 325.3 was found as high frequency PMD.
Independent peaks are supposing generated from different compounds. We could use those peaks for MS/MS analysis instead of DIA or DDA. Here we need multiple injections for one sample since it might be impossible to get all ions’ fragmental ions in one injection with good sensitivity. You could use gettarget to generate the index for the injections and output the peaks for each run.
# you need retention time for independent peaks index <- gettarget(std$rt[std$stdmassindex]) #> You need 10 injections! # output the ions for each injection table(index) #> index #> 1 2 3 4 5 6 7 8 9 10 #> 20 23 22 22 22 40 33 59 20 36 # show the ions for the first injection std$mz[index==1] #> [1] 104.0090 121.0851 136.4826 167.0709 172.9774 180.1751 193.1415 197.1285 #> [9] 201.2040 208.0978 209.9806 215.1268 227.1847 228.1969 255.9443 257.9694 #> [17] 259.1148 259.1810 261.1542 262.1453 264.2049 270.3185 271.3217 288.9232 #> [25] 297.2408 306.2514 311.2377 317.2846 319.9302 324.2900 327.0091 329.8840 #> [33] 338.3415 338.6338 365.8035 367.2694 367.9923 368.3169 369.3534 371.3173 #> [41] 375.2147 384.3350 390.2553 417.3364 424.8970 431.2614 442.8446 447.2935 #> [49] 448.8862 454.4255 462.3940 471.3317 494.8112 494.8112 537.5353 538.3435 #> [57] 539.5420 540.1628 541.3942 542.3266 546.3560 560.3877 565.5679 606.2235 #> [65] 614.1816 630.7621 646.4585 655.3369 663.4529 666.8256 669.8727 677.8593 #> [73] 691.6443 694.6505 738.5066 739.6479 745.3469 745.8474 751.6125 753.5196 #> [81] 760.8210 773.5622 781.8130 833.8251 840.5683 861.8356 873.4237 881.8224 #> [89] 884.8301 894.3269 900.8085 911.8014 930.1575 934.8077 std$rt[index==1] #> [1] 48.8480 348.3470 144.8960 538.2950 163.3250 416.3190 462.1140 170.6010 #> [9] 521.5790 430.4650 147.8780 302.2750 416.3200 614.4140 76.7060 146.3970 #> [17] 144.0380 890.9790 422.7480 588.9100 592.9830 447.3925 880.8005 213.5480 #> [25] 568.7670 599.6270 596.4120 608.1980 145.2280 556.5545 509.5330 144.3380 #> [33] 614.9465 639.1000 639.2065 382.6770 762.5750 570.0560 688.3880 659.6710 #> [41] 218.8600 656.0105 383.3190 603.4845 213.7130 446.3230 643.3840 404.5340 #> [49] 215.8650 628.5540 582.3755 540.8660 817.9060 803.7190 705.5300 537.2240 #> [57] 705.4235 762.3620 439.6770 492.4360 529.0810 533.3660 735.1450 762.7890 #> [65] 818.8705 145.1850 605.8410 475.7210 800.2900 216.7620 213.5285 214.8145 #> [73] 594.0560 639.1000 481.2930 639.1005 215.2830 214.5090 624.2705 522.2240 #> [81] 215.6320 492.4390 215.0690 214.0170 517.5660 213.3840 471.3075 214.4090 #> [89] 213.5140 213.4215 213.7720 214.0170 213.5310 213.8030
An interactive document has been included in this package to perform PMD analysis. You need to prepare a csv file with m/z and retention time of peaks. Such csv file could be generated by run enviGCMS::getmzrtcsv() on the list object from enviGCMS::getmzrt(xset) or enviGCMS::getmzrt2(xset) function. You could also generate the csv file by enviGCMS::getmzrt(xset,name = 'test') or enviGCMS::getmzrt2(xset, name = 'test'). You will find the csv file in the working dictionary named test.csv.
Then you could run runPMD() to start the Graphical user interface(GUI) for GlobalStd algorithm and structure/reaction directed analysis.