msc.biomarkers.read.csv & msc.biomarkers.write.csv {caMassClass} | R Documentation |
Functions to read and write CSV (comma separated values) text files containing biomarkers (aligned peaks) in the format used by Ciphergen's biomarker file, with spectra (samples) as rows, and biomarkers as columns (features).
X = msc.biomarkers.read.csv(fname, mzXML.record=FALSE) msc.biomarkers.write.csv(X, fname)
fname |
either a character string naming a file or a connection. |
X |
biomarker data in form of a 2D matrix (nFeatures x nSamples) or 3D array (nFeatures x nSamples x nCopies. Notice that this data is in format which is a transpose of data in CSV file. |
mzXML.record |
should mzXML record be created to store mata-data (input file names)? |
Function msc.biomarkers.read.csv
returns peak information data frame.
See argument X
above. If mzXML.record
was set to true than mzXML
record with input file names will be attached to X
as "mzXML
"
attribute.
Function msc.biomarkers.write.csv
does
not return anything.
Jarek Tuszynski (SAIC) jaroslaw.w.tuszynski@saic.com
msc.biomarkers.fill
, msc.rawMS.read.csv
example("msc.peaks.align", verbose=FALSE) # create biomarkers data X = Y$Bmrks # biomarkers data is stored in variable 'Y$Bmrks' msc.biomarkers.write.csv(X, "biomarkers.csv") Y = msc.biomarkers.read.csv("biomarkers.csv", mzXML.record=TRUE) stopifnot( all(X==Y, na.rm=TRUE) ) mzXML = attr(Y,"mzXML") strsplit(mzXML$parentFile, '\n') # show mzXML$parentFile record file.remove("biomarkers.csv")