msc.peaks.read.mzXML & msc.peaks.write.mzXML {caMassClass} | R Documentation |
Functions to read and write mzXML files containing peaks stored in the format used by peak finding functions.
msc.peaks.write.mzXML(scans, filename, mzXML=NULL, ...) msc.peaks.read.mzXML(filename, wipe=TRUE)
scans |
Peak information to be stored in mzXML file. A data-frame in the
similar to format as returned by msc.peaks.find , containing
four components:
|
filename |
character string with name of the file. |
mzXML |
class storing partially parsed mzXML data |
wipe |
Should all scans that were returned be also deleted (wiped) from
mzXML record? Set to TRUE by default to minimize memory use. |
... |
additional parameters to be passed to write.mzXML
function (precision) |
Functions read.mzXML
and write.mzXML
use very
general data type to communicate with mzXML
files. Functions
msc.rawMS.read.mzXML
and msc.rawMS.write.mzXML
allow passing information using data format specialized for storing
peak data.
Function msc.peaks.read.mzXML
returns data in the same format as
msc.peaks.write.mzXML
input parameter scans
. In addition,
object of type mzXML
is attached as "mzXML
" attribute.
See read.mzXML
for details.
Functions msc.peaks.write.mzXML
do not return anything.
Jarek Tuszynski (SAIC) jaroslaw.w.tuszynski@saic.com
read.mzXML
, write.mzXML
are more general
mzXML file reader/writer.
msc.rawMS.read.mzXML
& msc.rawMS.write.mzXML
functions also read/write mzXML file, but use different data format.
msc.peaks.read.csv
& msc.peaks.write.mzXML
function can read/write peak data using CSV files.
# load "Data_IMAC.Rdata" file containing raw MS spectra 'X' directory = system.file("Test", package = "caMassClass") X = msc.rawMS.read.csv(directory, "IMAC_.*csv", mzXML.record=TRUE) # Find Peaks and save them Peaks = msc.peaks.find(X) # create peak data msc.peaks.write.mzXML(Peaks, "peaks.mzXML", mzXML=attr(X,"mzXML"), precision='64') Output = msc.peaks.read.mzXML("peaks.mzXML") stopifnot(Output$Substance.Mass == Peaks$Substance.Mass, Output$Intensity == Peaks$Intensity, Output$Spectrum. == Peaks$Spectrum., Output$Peak. == Peaks$Peak.) mzXML = attr(Output,"mzXML") strsplit(mzXML$parentFile, '\n') # show mzXML$parentFile record # Suggestion: inspect 'peaks.mzXML' using any text editor file.remove("peaks.mzXML")