Learn R Programming

flagme (version 1.28.0)

imputePeaks: Imputatin of locations of peaks that were undetected

Description

Using the information within the peaks that are matched across several runs, we can impute the location of the peaks that are undetected in a subset of runs

Usage

imputePeaks(pD, obj, type = 1, obj2 = NULL, filterMin = 3, verbose = TRUE)

Arguments

pD
a peaksDataset object
obj
the alignment object, either multipleAlignment or progressiveAlignment, that is used to infer the unmatched peak locations
type
type of imputation to do, 1 for simple linear interpolation (default), 2 only works if obj2 is a clusterAlignment object
obj2
a clusterAlignment object
filterMin
minimum number of peaks within a merged peak to impute
verbose
logical, whether to print out information

Value

list with 3 elements apex, start and end, each masked matrices giving the scan numbers of the imputed peaks.

Details

If you are aligning several samples and for a (small) subset of the samples in question, a peak is undetected, there is information within the alignment that can be useful in determining where the undetected peak is, based on the surrounding matched peaks. Instead of moving forward with missing values into the data matrices, this procedures goes back to the raw data and imputes the location of the apex (as well as the start and end), so that we do not need to bother with post-hoc imputation or removing data because of missing components.

We realize that imputation is prone to error and prone to attributing intensity from neighbouring peaks to the unmatched peak. We argue that this is still better than having to deal with these in statistical models after that fact. This may be an area of future improvement.

References

Mark D Robinson (2008). Methods for the analysis of gas chromatography - mass spectrometry data PhD dissertation University of Melbourne.

See Also

multipleAlignment, progressiveAlignment, peaksDataset

Examples

Run this code
require(gcspikelite)

# paths and files
gcmsPath<-paste(find.package("gcspikelite"),"data",sep="/")
cdfFiles<-dir(gcmsPath,"CDF",full=TRUE)
eluFiles<-dir(gcmsPath,"ELU",full=TRUE)

# read data, peak detection results
pd<-peaksDataset(cdfFiles[1:3],mz=seq(50,550),rtrange=c(7.5,8.5))
pd<-addAMDISPeaks(pd,eluFiles[1:3])

# alignments
ca<-clusterAlignment(pd, gap = .5,D=.05,df=30)
pa<-progressiveAlignment(pd, ca, gap = .6, D=.1,df=30)

v<-imputePeaks(pd,pa,filterMin=1)

Run the code above in your browser using DataLab