Description Usage Arguments Note Author(s) See Also Examples
Copy general information from the originating MS file and write this,
along with the provided spectra data, to a new file. The expected
workflow is the following: data is first loaded from an MS file,
e.g. using peaks
and header
methods,
processed in R and then saved again to an MS file providing the
(eventually) manipulated spectra and header data with arguments
header
and data
.
1 2 | copyWriteMSData(object, file, original_file, header, backend =
"pwiz", outformat = "mzml", rtime_seconds = TRUE, software_processing)
|
object |
|
file |
|
original_file |
|
header |
|
backend |
|
outformat |
|
rtime_seconds |
|
software_processing |
|
copyWriteMSData
supports at present copying data from
mzXML
and mzML
and exporting to mzML
. Copying and
exporting to mzXML
can fail for some input files.
The intention of this function is to copy data from an existing file
and save it along with eventually modified data to a new file. To
write new MS data files use the writeMSData
function
instead.
Johannes Rainer
writeMSData
for a function to save MS data to a new mzML
or mzXML file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Open a MS file and read the spectrum and header information
library(msdata)
fl <- system.file("threonine", "threonine_i2_e35_pH_tree.mzXML",
package = "msdata")
ms_fl <- openMSfile(fl, backend = "pwiz")
## Get the spectra
pks <- spectra(ms_fl)
## Get the header
hdr <- header(ms_fl)
## Modify the spectrum data adding 100 to each intensity.
pks <- lapply(pks, function(z) {
z[, 2] <- z[, 2] + 100
z
})
## Copy metadata and additional information from the originating file
## and save it, along with the modified data, to a new mzML file.
out_file <- tempfile()
copyWriteMSData(pks, file = out_file, original_file = fl,
header = hdr)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.