run.baselines {FTICRMS}R Documentation

Calculate and Store Baselines for Spectroscopic Data

Description

Takes the spectra from files in raw.dir, calculates the baselines from them, and writes the results in the directory base.dir.

Usage

run.baselines(root.dir = ".", raw.dir, base.dir, overwrite = FALSE,
              use.par.file = FALSE, par.file = "parameters.RData",
              sm.par = 1e-11, sm.ord = 2, max.iter = 20, tol = 5e-8,
              sm.div = NA, sm.norm.by = c("baseline", "overestimate", "constant"),
              neg.div = NA, neg.norm.by = c("baseline", "overestimate", "constant"),
              rel.conv.crit = TRUE, zero.rm = TRUE, halve.search = FALSE)

Arguments

root.dir directory for parameters file and raw data
raw.dir directory for raw data files; default is paste(root.dir, "/Raw_Data", sep = "")
base.dir directory for baseline files; default is paste(root.dir, "/Baselines", sep = "")
overwrite logical; whether to replace existing files with new ones
use.par.file logical; if TRUE, then parameters are read from par.file in directory root.dir
par.file string containing name of parameters file
sm.par smoothing parameter for baseline calculation
sm.ord order of derivative to penalize in baseline analysis
max.iter convergence criterion in baseline calculation
tol convergence criterion
sm.div smoothness divisor in baseline calculation
sm.norm.by method for smoothness penalty in baseline analysis
neg.div negativity divisor in baseline calculation
neg.norm.by method for negativity penalty in baseline analysis
rel.conv.crit logical; whether convergence criterion should be relative to size of current baseline estimate
zero.rm logical; whether to replace zeros with average of surrounding values
halve.search logical; whether to use a halving-line search if step leads to smaller value of function

Details

Goes through the entire directory raw.dir file-by-file and computes each baseline using baseline, then writes the spectrum and the baseline to a file in directory base.dir. The name of the new file is the same as the name of the old file with “.txt” replaced by “.RData”, and the new file is ready to be used by run.peaks.

The files in raw.dir must be in a specific format (future versions of the package will allow for more flexibility). The files should be two-column text files with mass in the first column and spectrum intensity in the second column. There should be no header row (just start the file with the first data point). The columns can be either comma-separated or whitespace-separated and the program will automatically detect which each file is. The decimal separator should be ".", as using "," will cause errrors in reading the files.

See baseline for details of all the parameters after par.file.

Value

No value returned; the files are simply created.

Note

If use.par.file == TRUE and other parameters are entered into the function call, then the parameters entered in the function call overwrite those read in from the file. Note that this is opposite from the behavior for FTICRMS versions 0.7 and earlier.

The values of sm.norm.by and neg.norm.by can be abbreviated and both have default value "baseline".

Author(s)

Don Barkauskas (barkda@wald.ucdavis.edu)

References

Barkauskas, D.A. (2009) “Statistical Analysis of Matrix-Assisted Laser Desorption/Ionization Fourier Transform Ion Cyclotron Resonance Mass Spectrometry Data with Applications to Cancer Biomarker Detection”. Ph.D. dissertation, University of California at Davis.

Barkauskas, D.A. et al. (2009) “Detecting glycan cancer biomarkers in serum samples using MALDI FT-ICR mass spectrometry data”. Bioinformatics, 25:2, 251–257.

Xi, Y. and Rocke, D.M. (2008) “Baseline Correction for NMR Spectroscopic Metabolomics Data Analysis”. BMC Bioinformatics, 9:324.

See Also

baseline, run.peaks


[Package FTICRMS version 0.8 Index]