cdf.to.ftr {apLCMS}R Documentation

Convert a number of cdf files in the same directory to a feature table

Description

This is a wrapper function, which calls four other functions to convert a number of cdf files to a feature table. All cdf files to be processed must be in a single folder.

Usage

cdf.to.ftr<-function(folder, n.nodes=4, min.exp=2, min.pres=0.5, min.run=12, mz.tol=1e-5, shape.model="bi-Gaussian",  baseline.correct=NA, peak.estim.method="moment", min.bw=NA, max.bw=NA, sd.cut=c(1,60), sigma.ratio.lim=c(0.33, 3), subs=NULL, align.mz.tol=NA, align.chr.tol=NA, pre.process=FALSE, recover.mz.range=NA, recover.chr.range=NA, use.observed.range=TRUE,recover.min.count=3)

Arguments

folder The folder where all CDF files to be processed are located. For example ÒC:/CDF/this_experimentÓ
n.nodes The number of CPU cores to be used through doSNOW.
min.exp If a feature is to be included in the final feature table, it must be present in at least this number of spectra.
min.pres This is a parameter of thr run filter, to be passed to the function proc.cdf(). Please see the help for proc.cdf() for details.
min.run This is a parameter of thr run filter, to be passed to the function proc.cdf(). Please see the help for proc.cdf() for details.
subs If not all the CDF files in the folder are to be processed, the user can define a subset using this parameter. For example, subs=15:30, or subs=c(2,4,6,8)
mz.tol The user can provide the m/z tolerance level for peak identification. This value is expressed as the percentage of the m/z value. This value, multiplied by the m/z value, becomes the cutoff level. Please see the help for proc.cdf() for details.
shape.model The mathematical model for the shape of a peak. There are two choices - Òbi-GaussianÓ and ÒGaussianÓ. When the peaks are asymmetric, the bi-Gaussian is better. The default is Òbi-GaussianÓ.
baseline.correct This is a parameter in peak detection. After grouping the observations, the highest observation in each group is found. If the highest is lower than this value, the entire group will be deleted. The default value is NA, which allows the program to search for the cutoff level. Please see the help for proc.cdf() for details.
peak.estim.method the bi-Gaussian peak parameter estimation method, to be passed to subroutine prof.to.features. Two possible values: moment and EM.
min.bw The minimum bandwidth in the smoother in prof.to.features(). Please see the help file for prof.to.features() for details.
max.bw The maximum bandwidth in the smoother in prof.to.features(). Please see the help file for prof.to.features() for details.
sd.cut A parameter for the prof.to.features() function. A vector of two. Features with standard deviation outside the range defined by the two numbers are eliminated.
sigma.ratio.lim A parameter for the prof.to.features() function. A vector of two. It enforces the belief of the range of the ratio between the left-standard deviation and the righ-standard deviation of the bi-Gaussian fuction used to fit the data.
align.chr.tol The user can provide the elution time tolerance level to override the programÕs selection. This value is in the same unit as the elution time, normaly seconds. Please see the help for match.time() for details.
align.mz.tol The user can provide the m/z tolerance level for peak alignment to override the programÕs selection. This value is expressed as the percentage of the m/z value. This value, multiplied by the m/z value, becomes the cutoff level.Please see the help for feature.align() for details.
pre.process Logical. If true, the program will not perform time correction and alignment. It will only generate peak tables for each spectra and save the files. It allows manually dividing the task to multiple machines.
recover.mz.range A parameter of the recover.weaker() function. The m/z around the feature m/z to search for observations. The default value is NA, in which case 1.5 times the m/z tolerance in the aligned object will be used.
recover.chr.range A parameter of the recover.weaker() function. The retention time around the feature retention time to search for observations. The default value is NA, in which case 0.5 times the retention time tolerance in the aligned object will be used.
use.observed.range A parameter of the recover.weaker() function. If the value is TRUE, the actual range of the observed locations of the feature in all the spectra will be used.
recover.min.count The minimum time point count for a series of point in the EIC for it to be considered a true feature.

Details

The wrapper function calls five other functions to perform the feature table generation. Every spectrum (cdf file) first goes through proc.cdf() and prof.to.feature() to generate a spectrum-level peak table. The eluction time correction is done by match.time(). Then the peaks are aligned across spectra by feature.align(). For features deteced in a portion of the spectra, weaker signals in other spectra are recovered by recover.weaker(). From version 4, the parameter mz.tol can no longer be NA. This is to allow the program better process data other than FTLCMS. It is recommended that the user use the machine's claimed accuracy. For FTMS, 1e-5 is recommended.

Value

A list is returned.
features A list object, each component of which being the peak table from a single spectrum.
features2 A list object, each component of which being the peak table from a single spectrum, after elution time correction.
aligned.ftrs Feature table BEFORE weak signal recovery.
final.ftrs Feature table after weak signal recovery. This is the end product of the function.
pk.times Table of feature elution time BEFORE weak signal recovery.
final.times Table of feature elution time after weak signal recovery.
mz.tol The input mz.tol value by the user.
align.mz.tol The m/z tolerance level in the alignment across spectra, either input from the user or automatically selected when the user input is NA.
align.chr.tol The retention time tolerance level in the alignment across spectra, either input from the user or automatically selected when the user input is NA.

Author(s)

Tianwei Yu <tyu8@sph.emory.edu>

See Also

proc.cdf, prof.to.feature, adjust.time, feature.align, recover.weaker


[Package apLCMS version 5.6.0 Index]