MALDIquantForeign/0000755000176200001440000000000014165370672013476 5ustar liggesusersMALDIquantForeign/NAMESPACE0000644000176200001440000000205714161050224014701 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(import) export(importAnalyze) export(importBrukerFlex) export(importCdf) export(importCiphergenXml) export(importCsv) export(importImzMl) export(importMsd) export(importMzMl) export(importMzXml) export(importTab) export(importTxt) export(supportedFileFormats) exportMethods(export) exportMethods(exportCsv) exportMethods(exportImzMl) exportMethods(exportMsd) exportMethods(exportMzMl) exportMethods(exportTab) import(MALDIquant) import(methods) import(readMzXmlData) importFrom(XML,xmlEventParse) importFrom(XML,xmlParse) importFrom(XML,xmlValue) importFrom(XML,xpathApply) importFrom(XML,xpathSApply) importFrom(base64enc,base64encode) importFrom(digest,digest) importFrom(readBrukerFlexData,readBrukerFlexFile) importFrom(stats,na.omit) importFrom(stats,runif) importFrom(utils,download.file) importFrom(utils,modifyList) importFrom(utils,packageVersion) importFrom(utils,read.table) importFrom(utils,tail) importFrom(utils,type.convert) importFrom(utils,untar) importFrom(utils,unzip) importFrom(utils,write.table) MALDIquantForeign/man/0000755000176200001440000000000014161045676014250 5ustar liggesusersMALDIquantForeign/man/importMzXml-functions.Rd0000644000176200001440000000241014161050102021020 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importMzXml} \alias{importMzXml} \title{Import mzXML files} \usage{ importMzXml(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[readMzXmlData]{readMzXmlFile}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in mzXML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importMzXml(exampleDirectory) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/}, \cr Definition of \code{mzXML} format: \url{http://tools.proteomecenter.org/wiki/index.php?title=Formats:mzXML} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readMzXmlData]{readMzXmlFile}} } \author{ Sebastian Gibb } MALDIquantForeign/man/export-methods.Rd0000644000176200001440000000434614161045676017530 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{export,AbstractMassObject-method} \alias{export,AbstractMassObject-method} \alias{export} \alias{export,list-method} \title{Export files} \usage{ \S4method{export}{AbstractMassObject}(x, file, type="auto", force=FALSE, \ldots) \S4method{export}{list}(x, path, type, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{type}{\code{character}, file format. If \code{type} is set to \dQuote{auto} the file extension is used.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{\ldots}{arguments to be passed to specific export functions.} } \description{ This function provides a general interface to export \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}) into different file formats. } \details{ Specific export functions: \tabular{ll}{ tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr } } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a single spectrum export(s[[1]], file="spectrum.csv") ## identical to exportCsv(s[[1]], file="spectrum.csv") ## export a list of spectra export(s, path="spectra", type="csv") ## identical to exportCsv(s, path="spectra") } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importCiphergenXml-functions.Rd0000644000176200001440000000222414161045676022365 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importCiphergenXml} \alias{importCiphergenXml} \title{Import Ciphergen XML files} \usage{ importCiphergenXml(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in Ciphergen XML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importCiphergenXml(exampleDirectory) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportMzMl-methods.Rd0000644000176200001440000000325514161050045020310 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportMzMl,MassSpectrum-method} \alias{exportMzMl,MassSpectrum-method} \alias{exportMzMl} \alias{exportMzMl,list-method} \title{Export to mzML files} \usage{ \S4method{exportMzMl}{MassSpectrum}(x, file, force=FALSE, \ldots) \S4method{exportMzMl}{list}(x, path, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} would be exported. If \code{path} is a single filename all spectra will be exported to a single mzML file.} \item{\ldots}{arguments to be passed to internal functions.} } \description{ This function exports \code{\link[MALDIquant]{MassSpectrum-class}} objects into mzML files. } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a single spectrum exportMzMl(s[[1]], file="spectrum.mzML") ## export a list of spectra exportMzMl(s, path="spectra.mzML") } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/}, \cr HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: \url{https://www.psidev.info/mzML} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importCdf-functions.Rd0000644000176200001440000000242614161045676020500 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importCdf} \alias{importCdf} \title{Import CDF files} \usage{ importCdf(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in NetCDF file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects.\cr Please note that the \emph{RNetCDF} is needed. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import if (requireNamespace("RNetCDF", quietly=TRUE)) { s <- importCdf(exampleDirectory) } else { message("You have to install the RNetCDF package to use importCdf.") } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportImzMl-methods.Rd0000644000176200001440000000474114161050224020461 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportImzMl,MassSpectrum-method} \alias{exportImzMl,MassSpectrum-method} \alias{exportImzMl} \alias{exportImzMl,list-method} \title{Export to imzML files} \usage{ \S4method{exportImzMl}{MassSpectrum}(x, file, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), \ldots) \S4method{exportImzMl}{list}(x, path, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{processed}{\code{logical}, If \code{TRUE} (default) the spectra will be saved in processed mode (means mass and intensity is stored for each spectra separately in contrast to continuous mode where the mass is stored only for one spectrum).} \item{coordinates}{\code{matrix}, 2 column matrix that contains the x- and y-coordinates for the spectra.} \item{pixelSize}{\code{numeric}, a vector of length 2 that contains the x and y pixel size in micrometers (default: \code{c(100, 100)}).} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} would be exported. If \code{path} is a single filename all spectra will be exported to a single imzML file.} \item{\ldots}{arguments to be passed to internal functions.} } \description{ This function exports \code{\link[MALDIquant]{MassSpectrum-class}} objects into imzML files. } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a list of spectra exportImzMl(s, path="processed.imzML", coordinates=cbind(x=1:2, y=c(1, 1))) } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} Schramm T, Hester A, Klinkert I, Both J-P, Heeren RMA, Brunelle A, Laprevote O, Desbenoit N, Robbe M-F, Stoeckli M, Spengler B, Roempp A (2012)\cr imzML - A common data format for the flexible exchange and processing of mass spectrometry imaging data.\cr Journal of Proteomics 75 (16):5106-5110. \cr \doi{10.1016/j.jprot.2012.07.026} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importMzMl-functions.Rd0000644000176200001440000000225414161050045020644 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importMzMl} \alias{importMzMl} \title{Import mzML files} \usage{ importMzMl(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in mzML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importMzMl(exampleDirectory) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/}, \cr Definition of \code{mzML} format: \url{https://www.psidev.info/mzML} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/MALDIquantForeign-parallel.Rd0000644000176200001440000000400414161045676021540 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MALDIquantForeign-parallel.R \name{MALDIquantForeign-parallel} \alias{MALDIquantForeign-parallel} \title{Parallel Support in Package \pkg{MALDIquantForeign}} \description{ \code{\link[MALDIquantForeign]{MALDIquantForeign-package}} offers multi-core support using \code{\link[parallel]{mclapply}} and \code{\link[parallel]{mcmapply}}. This approach is limited to unix-based platforms. } \details{ Please note that not all import functions benfit from parallelisation. The current implementation is limited to run the parallelisation over different files. That's why only imports of multiple files could be run on multiple cores. E.g. a single mzML file containing 4 spectra would always be read on a single core. In contrast 4 mzML files each containing just one spectra could be read in using 4 cores. The improvement in the runtime depends on the amount of data to read, the proportion of parsing/decoding of the data, the amount of memory and the speed of the hard disk. Please note: It is possible that using parallelisation results in a worse runtime! } \examples{ ## load packages library("MALDIquant") library("MALDIquantForeign") exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## run single-core import print(system.time( s1 <- importMzMl(exampleDirectory, centroided=TRUE, verbose=FALSE) )) if(.Platform$OS.type == "unix") { ## run multi-core import ## (because the example spectra are very small (just 5 data points) the ## multi-core solution is slower on most systems) print(system.time( s2 <- importMzMl(exampleDirectory, centroided=TRUE, mc.cores=2, verbose=FALSE) )) stopifnot(all.equal(s1, s2)) } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MALDIquant-parallel}}, \code{\link[parallel]{mclapply}}, \code{\link[parallel]{mcmapply}} } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{misc} MALDIquantForeign/man/MALDIquantForeign-package.Rd0000644000176200001440000000123014161045676021335 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package.R \docType{package} \name{MALDIquantForeign-package} \alias{MALDIquantForeign-package} \title{Import/Export routines for \sQuote{MALDIquant}} \description{ This package reads and writes different file formats of mass spectrometry data into/from \sQuote{MALDIquant} objects. } \details{ \tabular{ll}{ Package: \tab MALDIquantForeign \cr License: \tab GPL (>= 3)\cr URL: \tab https://strimmerlab.github.io/software/maldiquant/\cr } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{package} MALDIquantForeign/man/importTab-functions.Rd0000644000176200001440000000261214161045676020507 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importTxt} \alias{importTxt} \alias{importTab} \alias{importCsv} \title{Import text files} \usage{ importTxt(path, ...) importTab(path, ...) importCsv(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[utils]{read.table}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports different text file formats into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \details{ \code{importTab}, \code{importTxt} and \code{importCsv} use \code{\link[utils]{read.table}} with different defaults. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import txt files s <- importTxt(exampleDirectory) ## import csv files s <- importCsv(exampleDirectory) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[utils]{read.table}} } \author{ Sebastian Gibb } MALDIquantForeign/man/supportedFileFormats-functions.Rd0000644000176200001440000000335714161045676022736 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fileFormats.R \name{supportedFileFormats} \alias{supportedFileFormats} \title{Supported file formats} \usage{ supportedFileFormats() } \value{ a \code{list} with two named elements (\code{import} and \code{export}) containing a \code{character} vector of supported file types. } \description{ This function prints all file formats supported by \code{\link{MALDIquantForeign-package}}. } \details{ \subsection{Import}{ \tabular{ll}{ txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr } } \subsection{Export}{ \tabular{ll}{ tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr } } } \examples{ library("MALDIquantForeign") supportedFileFormats() } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquantForeign]{export}}, \code{\link[MALDIquantForeign]{import}} } \author{ Sebastian Gibb } MALDIquantForeign/man/base64-encode.Rd0000644000176200001440000000200614161045676017054 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/base64encode-functions.R \name{.base64encode} \alias{.base64encode} \title{Converts double to base64 character.} \usage{ .base64encode( x, size, endian = .Platform$endian, compressionType = c("none", "gzip") ) } \arguments{ \item{x}{\code{double}, vector} \item{size}{\code{integer}, number of bytes per element in the byte stream (see \code{size} in \code{\link[base]{writeBin}}).} \item{endian}{\code{character}, the endian-ness (see \code{endian} in \code{\link[base]{writeBin}}).} \item{compressionType}{\code{character}, type of compression to use for compression of \code{x} (see \code{type} in \code{\link[base]{memCompress}}.} } \value{ Vector of type \code{character}. } \description{ This function converts a \code{double} vector to a base64 encoded \code{character} vector. } \seealso{ \code{\link[base64enc]{base64encode}} from \pkg{base64enc} package } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{internal} MALDIquantForeign/man/exportTab-methods.Rd0000644000176200001440000000421714161045676020154 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportTab,AbstractMassObject-method} \alias{exportTab,AbstractMassObject-method} \alias{exportTab} \alias{exportTab,list-method} \alias{exportCsv} \alias{exportCsv,AbstractMassObject-method} \alias{exportCsv,list-method} \title{Export to text files} \usage{ \S4method{exportTab}{AbstractMassObject}(x, file, force=FALSE, \ldots) \S4method{exportTab}{list}(x, path, force=FALSE, \ldots) \S4method{exportCsv}{AbstractMassObject}(x, file, force=FALSE, \ldots) \S4method{exportCsv}{list}(x, path, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{\ldots}{arguments to be passed to \code{\link[utils]{write.table}}.} } \description{ This function exports \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}) into different text file formats. } \details{ \code{exportTab} and \code{exportCsv} use \code{\link[utils]{write.table}} with different defaults (\code{sep="\t"} in \code{exportTab} and \code{sep=","} in \code{exportCsv}). } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a single spectrum exportTab(s[[1]], file="spectrum.tab") ## export a list of spectra and use ; as separator exportCsv(s, path="spectra", sep=";", force=TRUE) } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[utils]{write.table}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportMsd-methods.Rd0000644000176200001440000000412214161047246020157 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportMsd,MassSpectrum-method} \alias{exportMsd,MassSpectrum-method} \alias{exportMsd} \alias{exportMsd,list-method} \title{Export to MSD files} \usage{ \S4method{exportMsd}{MassSpectrum}(x, file, force=FALSE, peaks, \ldots) \S4method{exportMsd}{list}(x, path, force=FALSE, peaks, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{peaks}{a \code{\link[MALDIquant]{MassPeaks-class}} object or a \code{list} of \code{\link[MALDIquant]{MassPeaks-class}} objects.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{\ldots}{arguments to be passed to \code{\link[utils]{write.table}}.} } \description{ This function exports \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}) into mMass MSD files. } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) p <- list(createMassPeaks(mass=4:5, intensity=4:5, snr=1:2), createMassPeaks(mass=4:5, intensity=4:5, snr=1:2)) ## export a single spectrum exportMsd(s[[1]], file="spectrum.msd") ## export a single spectrum with corresponding peaks exportMsd(s[[1]], file="spectrum.msd", peaks=p[[1]]) ## export a list of spectra with corresponding peaks exportMsd(s, path="spectra", peaks=p, force=TRUE) } } \references{ \url{https://strimmerlab.github.io/software/maldiquant/}, \cr mMass homepage: \url{http://mmass.org/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importMsd-functions.Rd0000644000176200001440000000221714161047246020520 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importMsd} \alias{importMsd} \title{Import MSD files} \usage{ importMsd(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in mMass MSD file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importMsd(exampleDirectory) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/}, \cr mMass homepage: \url{http://mmass.org/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importAnalyze-functions.Rd0000644000176200001440000000203414161050045021364 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importAnalyze} \alias{importAnalyze} \title{Import Analyze 7.5 files} \usage{ importAnalyze(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in Analyze 7.5 file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} \cr \url{http://www.grahamwideman.com/gw/brain/analyze/formatdoc.htm}, \url{http://eeg.sourceforge.net/ANALYZE75.pdf} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/import-functions.Rd0000644000176200001440000001100414161045676020053 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{import} \alias{import} \title{Import files} \usage{ import( path, type = "auto", pattern, excludePattern = NULL, removeEmptySpectra = TRUE, centroided = FALSE, massRange = c(0, Inf), minIntensity = 0, mc.cores = 1L, verbose = interactive(), ... ) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{type}{\code{character}, file format. If \code{type} is set to \dQuote{auto} MALDIquant tries to detect the correct file type automatically. It often depends on the file extension (if \code{path} is a directory the most represented file extension is used; \code{pattern} argument is ignored).} \item{pattern}{\code{character}, a regular expression to find files in a directory (see details).} \item{excludePattern}{\code{character}, a regular expression to exclude files in a directory (see details).} \item{removeEmptySpectra}{\code{logical}, should empty spectra excluded?} \item{centroided}{\code{logical}, if \code{centroided=FALSE} (default) the data are treated as not centroided and a list of \code{\link[MALDIquant]{MassSpectrum-class}} objects is returned. Use \code{centroided=TRUE} to assume centroided data and get a list of \code{\link[MALDIquant]{MassPeaks-class}} objects.} \item{massRange}{\code{double}, limits of mass import (left/minimal mass, right/maximal mass).} \item{minIntensity}{\code{double}, minimal intensity to import.} \item{mc.cores}{number of cores to use (default 1; only unix-based platforms are supported, see \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} for details).} \item{verbose}{\code{logical}, verbose output?} \item{\ldots}{arguments to be passed to specific import functions.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function provides a general interface to import different file formats into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \details{ Specific import functions: \tabular{ll}{ txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr } \code{path}: In addition to the above mentioned file types the following (compressed) archives are supported, too: zip, tar, tar.gz, tar.bz2, tar.xz. The archives are uncompressed in a temporary directory. Afterwards the \code{\link[MALDIquantForeign]{import}} function is called (with \code{type="auto"}). \code{pattern}: Sometimes unusual file extensions are used (e.g. \code{"*.xml"} for mzXML files). In this case a specific \code{pattern} could be defined to import files with an unusual file extension (e.g. \code{pattern="^.*\\.xml$"} to read all \code{*.xml} files in a directory; see \code{\link[base]{regexp}} for details). \code{excludePattern}: Sometimes some files should be excluded. E.g. to ignore additional aquired Bruker LIFT spectra (MALDI-TOF/TOF; which are not support, yet) you could use \code{excludePattern="([[:digit:]\\.]+)LIFT[\\\\/]1SRef"}. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import mzXML files s <- import(exampleDirectory, type="mzXML") ## import tab delimited file with different file extension (default: *.tab) s <- import(exampleDirectory, type="tab", pattern="^.*\\\\.txt") ## import single mzML file s <- import(file.path(exampleDirectory, "tiny1.mzML1.1.mzML")) ## import gzipped csv file s <- import(file.path(exampleDirectory, "compressed", "csv1.csv.gz")) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importImzMl-functions.Rd0000644000176200001440000000306514161050045021016 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importImzMl} \alias{importImzMl} \title{Import imzML files} \usage{ importImzMl(path, coordinates = NULL, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{coordinates}{\code{matrix}, 2 column matrix that contains the x- and y-coordinates for spectra that should be imported. Other spectra would be ignored.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in imzML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML")) ## import only spectra for pixel 1,1 and 2,1 s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML"), coordinates = cbind(1:2, c(1, 1))) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/}, \cr Definition of \code{imzML} format: \url{https://ms-imaging.org/imzml/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importBrukerFlex-functions.Rd0000644000176200001440000000233614161045676022055 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importBrukerFlex} \alias{importBrukerFlex} \title{Import Bruker Daltonics *flex files} \usage{ importBrukerFlex(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[readBrukerFlexData]{readBrukerFlexFile}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in Bruker Daltonics *flex-series file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") s <- importBrukerFlex(exampleDirectory) } \references{ \url{https://strimmerlab.github.io/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readBrukerFlexData]{readBrukerFlexFile}} } \author{ Sebastian Gibb } MALDIquantForeign/DESCRIPTION0000644000176200001440000000252614165370672015211 0ustar liggesusersPackage: MALDIquantForeign Version: 0.13 Date: 2021-12-23 Title: Import/Export Routines for 'MALDIquant' Authors@R: c(person("Sebastian", "Gibb", role=c("aut", "cre"), email="mail@sebastiangibb.de", comment=c(ORCID="0000-0001-7406-4443")), person("Pietro", "Franceschi", role=c("ctb"), email="pietro.franceschi@fmach.it")) Depends: R (>= 3.2.2), methods, MALDIquant (>= 1.16.4) Imports: base64enc, digest, readBrukerFlexData (>= 1.7), readMzXmlData (>= 2.7), XML Suggests: knitr, testthat (>= 0.8), RNetCDF (>= 1.6.1) Description: Functions for reading (tab, csv, Bruker fid, Ciphergen XML, mzXML, mzML, imzML, Analyze 7.5, CDF, mMass MSD) and writing (tab, csv, mMass MSD, mzML, imzML) different file formats of mass spectrometry data into/from 'MALDIquant' objects. License: GPL (>= 3) URL: https://strimmerlab.github.io/software/maldiquant/ https://github.com/sgibb/MALDIquantForeign/ BugReports: https://github.com/sgibb/MALDIquantForeign/issues/ LazyLoad: yes VignetteBuilder: knitr RoxygenNote: 7.1.2 NeedsCompilation: no Packaged: 2022-01-05 19:09:05 UTC; sebastian Author: Sebastian Gibb [aut, cre] (), Pietro Franceschi [ctb] Maintainer: Sebastian Gibb Repository: CRAN Date/Publication: 2022-01-05 19:30:02 UTC MALDIquantForeign/build/0000755000176200001440000000000014165366321014571 5ustar liggesusersMALDIquantForeign/build/vignette.rds0000644000176200001440000000043114165366321017126 0ustar liggesusersRKK@U5wu:np+4|ȺlHKKZc‰2T/JMALDIquantForeign/build/partial.rdb0000644000176200001440000001236214165366316016726 0ustar liggesusers]VȒ6Ę!  $6n&$$C$$ə\j&=X(1]Rn˒d+p[U]U]]#@"H&z{ /_=[߽4yM5jHI>M >(KH&˟-iQS[[kwMd=&0T/6}+ž 矞*gִG=VeEʛK[JTkVũ{WR%ī%]?ll|*Yn?-F+4K*#vΪTsyg_rbMQ兒pq᡼Ds[+6~ITrIênXo ʺl6K0t6w4TܲgZkkе{)!w=SJ%:@K ,Rt(ɣS4ID瑞,XBI*HP(_>F(_fݣ* ܃?t*~C,1Ye -vd s?_ :8Tl+8җm]vTXOS#E:|-H"|{!NIl99[ ,pP]. M]\KLv!U1p}'v.(vGz6C,1Қm#bDav$F \,d)7Uo"}ovLI˯nZ'%< rҗ+?\ $ғyr-{ }'3ߛ>}֍]^_YːiRyy7q-#c ;Ev놬hE77!Uw\_3"* jp}"TY{1t.3†7P!4X 5J?HB>B+בޝ4t58U%spwΡFO#8@9H)@5SK$ӨD`*H$XB@!{łXBk%BD7 ڕiRɂv+Ko!",ħH?TE|Yg k6 49B momE˕G!,Ft/ ph趧 hQ#Em$n& ):oQG~DD}d]p6րӈ/~ёX3{l8t]+!O+HD4s6~_"E:TX ЂbJ@4s;/XT~C,s9 $lA#JҥCE2u㛄vb`7x#QG!gmNh?In"N#jOO_Do6Wԁ}t[K;ӏA`tK!"*iEJt䔪+%)hq/!}؝Ctl N%Ai_z+war>ҡ:Qn#>@AtL%8\|Fi35"K1#EUE:H6X}cˍT$o(.b9ՃYAa t"s[!G3يdJxB]CG:Ԩ)6.iwdDjG,I$\GY^F|t8t(L4=xptcˉ80"ť ;5up ~B>u :h 5h4NftsF:2D"_YO4cT۷,@06:{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Ў*mz{^¨=6VuA꽭-ꪧWVkNZGUXZ+UikN08}'L2/XR6EִINţg&! =+ۅr_GPRw6>,?^ws5șe8#wQ9sƜyd=^~*\Yf\VBI~P{"ɹ;}evb[̱F?C9R[~۴u1t@[gƛ.5JNa9|;۷ol{RlmLiJ$aOfdw<9-e}ߴn,mgXͯl-|lg&-\{6eZ[zZoˬv4>KYcu?%_bK琞>S.U_T?x#~64Y841j~xt"dPdh9W+ ^YN nt!xGhhwSȭ-a+} iQ[b? dUqW"k{L]lIAq7#gYYG42հ͋I?- gz blMALDIquantForeign/tests/0000755000176200001440000000000013211235236014623 5ustar liggesusersMALDIquantForeign/tests/testthat/0000755000176200001440000000000014165370672016500 5ustar liggesusersMALDIquantForeign/tests/testthat/test_createMassObject-functions.R0000644000176200001440000000340113211235236025067 0ustar liggesuserscontext("createMassObject") test_that(".createMassObject", { expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list()))) expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(), centroided=FALSE))) expect_warning(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(dataProcessing=list(centroided=0)), centroided=TRUE), paste0("According to the metadata information the imported data are ", "not centroided.")) expect_warning(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(centroided="1")), paste0("According to the metadata information the imported data are ", "centroided.")) expect_true(suppressWarnings(isMassPeaks( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(), centroided=TRUE)))) expect_true(suppressWarnings(isMassPeaks( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(dataProcessing=list(centroided="1")), centroided=TRUE)))) expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( mass=c(1, 5, 7), intensity=1:3, metaData=list()))) expect_equal(mass(MALDIquantForeign:::.createMassObject( mass=1:10, intensity=1:10, massRange=c(4, 8))), 4:8) expect_equal(intensity(MALDIquantForeign:::.createMassObject( mass=1:10, intensity=1:10, minIntensity=5)), 5:10) expect_equal(snr(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, snr=5:1, centroided=TRUE)), 5:1) expect_equal(snr(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, centroided=TRUE)), rep(NA_real_, 5)) }) MALDIquantForeign/tests/testthat/test_exportImzMl-methods.R0000644000176200001440000002133614154152632023612 0ustar liggesuserscontext("exportImzMl") tmp <- tempdir() imzML <- c( "", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", paste0(" "), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "") test_that(".exportImzMl", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) expect_error(MALDIquantForeign:::.exportImzMl(m, file=file.path(tmp, "m.imzML")), "The spectra contain no imaging information.") MALDIquantForeign:::.exportImzMl(m, file=file.path(tmp, "m.imzML"), coordinates=cbind(1, 1), uuid="12345678-90ab-4cde-af12-34567890abcd") expect_equal(readLines(file.path(tmp, "m.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"m\"", x=imzML)) }) test_that("exportImzMl,MassSpectrum", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) expect_error(MALDIquantForeign::exportImzMl(m, file=file.path(tmp, "ms.imzML")), "The spectra contain no imaging information.") MALDIquantForeign::exportImzMl(m, file=file.path(tmp, "ms.imzML"), coordinates=cbind(1, 1), uuid="12345678-90ab-4cde-af12-34567890abcd") expect_equal(readLines(file.path(tmp, "ms.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"ms\"", x=imzML)) }) test_that("exportImzMl,list", { expect_error(MALDIquantForeign:::.exportImzMl(list(1:3, 4:6), file="tmp.imzML"), "MassSpectrum.*supported") m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid", imaging=list(pos=c(1, 1), pixelSize=c(100, 100), size=c(1, 1), dim=c(100, 100)))) spectra <- list(m, m) MALDIquantForeign::exportImzMl(spectra, path=tmp, force=TRUE, uuid="12345678-90ab-4cde-af12-34567890abcd") expect_equal(readLines(file.path(tmp, "TESTS_1.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_1\"", x=imzML)) expect_equal(readLines(file.path(tmp, "TESTS_2.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_2\"", x=imzML)) }) MALDIquantForeign/tests/testthat/test_sanitize-functions.R0000644000176200001440000000030713211235236023501 0ustar liggesuserscontext("sanitize") test_that("sanitize-functions", { s <- c("ac", "a&o", "abc") r <- c("a<b", "b>c", "a&o", "abc") expect_identical(MALDIquantForeign:::.sanitize(s), r) }) MALDIquantForeign/tests/testthat/test_fileFormats.R0000644000176200001440000000075613211235236022130 0ustar liggesuserscontext("fileFormats") test_that("supportedFileFormats", { r <- list(import = c("txt", "tab", "csv", "fid", "ciphergen", "mzxml", "mzml", "imzml", "analyze", "cdf", "msd"), export = c("tab", "csv", "msd", "mzml", "imzml")) expect_identical(supportedFileFormats(), r) }) MALDIquantForeign/tests/testthat/test_msg-functions.R0000644000176200001440000000037213211235236022443 0ustar liggesuserscontext("msg") test_that("msg-functions", { expect_message(MALDIquantForeign:::.msg(TRUE, "foobar"), "foobar") expect_message(MALDIquantForeign:::.msg(TRUE, "foo", "bar"), "foobar") expect_silent(MALDIquantForeign:::.msg(FALSE, "foobar")) }) MALDIquantForeign/tests/testthat/test_testChecksum-functions.R0000644000176200001440000000145113211235236024316 0ustar liggesuserscontext("testChecksum") test_that("testChecksum-functions", { f <- normalizePath(system.file( file.path("exampledata", "ascii.txt"), package="MALDIquantForeign")) md5 <- "9274dd34d675950326a222a952309a17" sha1 <- "85572c8d56504d8bba2afb32d7d7df35fb127ab8" expect_true(MALDIquantForeign:::.testChecksum(f, md5, algo="md5")) expect_true(MALDIquantForeign:::.testChecksum(f, sha1, algo="sha1")) expect_false(suppressWarnings( MALDIquantForeign:::.testChecksum(f, "12345", algo="sha1"))) expect_warning(MALDIquantForeign:::.testChecksum(f, "12345", algo="sha1"), "Stored and calculated sha1 sums do not match") expect_warning(MALDIquantForeign:::.testChecksum(f, "12345", algo="md5"), "Stored and calculated md5 sums do not match") }) MALDIquantForeign/tests/testthat/test_compression-functions.R0000644000176200001440000000616713211235236024226 0ustar liggesuserscontext("compression") z <- c("bz2", "bzip2", "gz", "lzma", "xz") e <- c("zip", z, paste("tar", z, sep="."), "tar", "txt", "mzML") f <- paste(letters[1:13], e, sep=".") test_that(".isCompressed", { expect_identical(MALDIquantForeign:::.isCompressed(f), c(rep(TRUE, 11), rep(FALSE, 3))) }) test_that(".isTar", { expect_identical(MALDIquantForeign:::.isTar(f), c(rep(FALSE, 6), rep(TRUE, 6), rep(FALSE, 2))) }) test_that(".isZip", { expect_identical(MALDIquantForeign:::.isZip(f), c(TRUE, rep(FALSE, 13))) }) test_that(".isPackedOrCompressed", { expect_identical(MALDIquantForeign:::.isPackedOrCompressed(f), c(rep(TRUE, 12), rep(FALSE, 2))) }) test_that(".uncompress supports single file compression by gunzip", { u <- MALDIquantForeign:::.uncompress( system.file(file.path("exampledata", "compressed", "csv1.csv.gz"), package="MALDIquantForeign")) f <- system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign") expect_identical(readLines(u), readLines(f)) expect_identical(MALDIquantForeign:::.uncompress("foobar.txt"), "foobar.txt") expect_error(MALDIquantForeign:::.uncompress("foobar.gz"), ".*foobar.gz.* doesn't exist!") }) test_that(".uncompress supports tar compression by untar", { u <- list.files(MALDIquantForeign:::.uncompress( system.file( file.path("exampledata", "compressed", "csv.tar.gz"), package="MALDIquantForeign")), recursive=TRUE, pattern="^.*\\.csv$", full.names=TRUE)[1] f <- system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign") expect_identical(readLines(u), readLines(f)) }) test_that(".uncompress supports zip compression by unzip", { u <- list.files(MALDIquantForeign:::.uncompress( system.file( file.path("exampledata", "compressed", "csv.zip"), package="MALDIquantForeign")), recursive=TRUE, pattern="^.*\\.csv$", full.names=TRUE)[1] f <- system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign") expect_identical(readLines(u), readLines(f)) expect_error(suppressWarnings(MALDIquantForeign:::.uncompress("foobar.zip")), "unzip failed!") }) test_that(".cleanupUncompressedTmpFiles works", { n <- list.files(file.path(tempdir(), "MALDIquantForeign_uncompress"), recursive=TRUE) expect_true(length(n) > 0) MALDIquantForeign:::.cleanupUncompressedTmpFiles() expect_false(file.exists(file.path(tempdir(), "MALDIquantForeign_uncompress"))) }) test_that("typical auto import", { f <- normalizePath(system.file( file.path("exampledata", "compressed", "csv1.csv.gz"), package="MALDIquantForeign")) s <- createMassSpectrum(mass=1:5, intensity=6:10) i <- import(f)[[1]] metaData(i) <- list() expect_identical(i, s) expect_false(file.exists(file.path(tempdir(), "MALDIquantForeign_uncompress"))) }) MALDIquantForeign/tests/testthat/test_download-functions.R0000644000176200001440000000331013341767210023465 0ustar liggesuserscontext("download") url <- c("http://www.tld.com/", "https://www.tld.com/archive.zip", "ftp://ftp.tld.com", "/data/archive.zip", "/root", "/dev/data.csv") test_that(".isUrl", { expect_identical(MALDIquantForeign:::.isUrl(url), c(rep(TRUE, 3), rep(FALSE, 3))) }) test_that(".download", { skip_on_cran() urls <- c("https://raw.githubusercontent.com/sgibb/MALDIquantForeign/master/inst/exampledata/ascii.txt", "https://raw.githubusercontent.com/sgibb/MALDIquantForeign/master/inst/exampledata/csv1.csv") tmpdir <- tempdir() ascii <- data.frame(V1=1:5, V2=6:10) csv <- data.frame(mass=1:5, intensity=6:10) expect_identical(read.table( MALDIquantForeign:::.download(urls[1], file.path(tmpdir, "a.txt"))), ascii) expect_identical(read.table(MALDIquantForeign:::.download(urls[1])), ascii) expect_true(all(grepl(paste("^a\\.txt$", "^MALDIquantForeign_download/ascii_.*\\.txt$", "^MALDIquantForeign_download/csv1_.*\\.csv$", sep="|"), list.files(tmpdir, recursive=TRUE)))) files <- MALDIquantForeign:::.download(urls) expect_identical(list(read.table(files[1]), read.csv(files[2], comment.char="#")), list(ascii, csv)) expect_message(MALDIquantForeign:::.download(urls[1], file.path(tmpdir, "a.txt"), verbose=TRUE), paste0("Downloading ", urls[1], " to ", file.path(tmpdir, "a.txt"), "\\.")) }) MALDIquantForeign/tests/testthat/test_exportTab-methods.R0000644000176200001440000000235413211235236023262 0ustar liggesuserscontext("exportTab") m <- createMassSpectrum(mass=1:5, intensity=6:10) r <- data.frame(V1=1:5, V2=6:10) test_that(".exportTab", { temp <- tempfile() MALDIquantForeign:::.exportTab(m, file=temp) ## didn't work on win-builder.r-project.org ## (but on local linux and windows install (both R 2.15.2) #expect_equivalent(tools::md5sum(temp), tools::md5sum(file.path("data", # "ascii.txt"))) expect_equal(read.table(temp), r) }) test_that("exportTab,MassSpectrum", { temp <- tempfile() MALDIquantForeign::exportTab(m, file=temp) expect_equal(read.table(temp), r) }) test_that(".exportCsv", { temp <- tempfile() MALDIquantForeign:::.exportCsv(m, file=temp) ## didn't work on win-builder.r-project.org ## (but on local linux and windows install (both R 2.15.2) #expect_equivalent(tools::md5sum(temp), tools::md5sum(file.path("data", # "csv1.csv"))) colnames(r) <- c("mass", "intensity") expect_equal(read.csv(temp), r) }) test_that("exportCsv,MassSpectrum", { temp <- tempfile() MALDIquantForeign::exportCsv(m, file=temp) colnames(r) <- c("mass", "intensity") expect_equal(read.csv(temp), r) }) MALDIquantForeign/tests/testthat/test_importBrukerFlex-functions.R0000644000176200001440000000135313211235236025161 0ustar liggesuserscontext("importBrukerFlex") test_that("importBrukerFlex", { expect_error(MALDIquantForeign:::.importBrukerFlex("tmp.tmp")) path <- system.file( file.path("exampledata", "brukerflex", "0_A1", "1", "1SLin", "fid"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importBrukerFlex(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importBrukerFlex(path, verbose=FALSE)) expect_equal(s, import(path, type="fid", verbose=FALSE)) expect_equal(trunc(mass(s[[1]])), 226:230) expect_equal(intensity(s[[1]]), 1:5) expect_equal(basename(metaData(s[[1]])$file), "fid") expect_equal(metaData(s[[1]])$laserShots, 100) expect_equal(metaData(s[[1]])$comments, paste0("TESTSAMPLE", 1:4)) }) MALDIquantForeign/tests/testthat/test_uuid-functions.R0000644000176200001440000000167413211235236022631 0ustar liggesuserscontext("uuid") test_that(".uuid", { expect_identical(MALDIquantForeign:::.uuid(init="foobar"), "3858f622-30ac-4c91-9f30-0c664312c63f") }) test_that(".isUuidV4", { ## invalid letters (not hexadecimal) expect_false(MALDIquantForeign:::.isUuidV4("z858f622-30ac-4c91-9f30-0c664312c63f")) ## not version 4 expect_false(MALDIquantForeign:::.isUuidV4("3858f622-30ac-3c91-9f30-0c664312c63f")) ## y (pos 17 is not 8, 9, A, or B expect_false(MALDIquantForeign:::.isUuidV4("3858f622-30ac-4c91-cf30-0c664312c63f")) expect_true(MALDIquantForeign:::.isUuidV4("3858f622-30ac-4c91-9f30-0c664312c63f")) expect_true(MALDIquantForeign:::.isUuidV4("3858f62230ac4c919f300c664312c63f")) expect_true(MALDIquantForeign:::.isUuidV4(MALDIquantForeign:::.uuid())) expect_equal(MALDIquantForeign:::.isUuidV4(c("foobar", "3858f62230ac4c919f300c664312c63f")), c(FALSE, TRUE)) }) MALDIquantForeign/tests/testthat/test_importCiphergenXml-functions.R0000644000176200001440000000135713211235236025501 0ustar liggesuserscontext("importCiphergenXml") test_that("importCiphergenXml", { expect_error(MALDIquantForeign:::.importCiphergenXml("tmp.tmp")) path <- system.file(file.path("exampledata", "ciphergen", "tiny.xml"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importCiphergenXml(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importCiphergenXml(path, verbose=FALSE)) expect_equal(s, import(path, type="ciph", verbose=FALSE)) expect_equal(trunc(mass(s[[1]])), rep(26, 5)) expect_false(all(mass(s[[1]])[1] == mass(s[[1]]))) expect_equal(intensity(s[[1]]), 1:5) expect_equal(basename(metaData(s[[1]])$file), "tiny.xml") expect_equal(metaData(s[[1]])$name, "tiny example") }) MALDIquantForeign/tests/testthat/test_importMzXml-functions.R0000644000176200001440000000400513211235236024154 0ustar liggesuserscontext("importMzXml") test_that("importMzXml", { expect_error(MALDIquantForeign:::.importMzXml("tmp.tmp")) path <- system.file(file.path("exampledata", "tiny1.mzXML3.0.mzXML"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importMzXml(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzXml(path, verbose=FALSE)) expect_equal(s, import(path, type="mzXML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1.mzXML3.0.mzXML") }) test_that("importMzXml compressed", { expect_error(MALDIquantForeign:::.importMzXml("tmp.tmp")) path <- system.file(file.path("exampledata", "tiny1-compressed.mzXML3.0.mzXML"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importMzXml(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzXml(path, verbose=FALSE)) expect_equal(s, import(path, type="mzXML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1-compressed.mzXML3.0.mzXML") }) test_that("importMzXml centroided", { expect_error(MALDIquantForeign:::.importMzXml("tmp.tmp")) path <- system.file(file.path("exampledata", "tiny1-centroided.mzXML3.0.mzXML"), package="MALDIquantForeign") p <- MALDIquantForeign:::.importMzXml(path, centroided=TRUE, verbose=FALSE) expect_equal(p, import(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, importMzXml(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, import(path, type="mzXML", centroided=TRUE, verbose=FALSE)) expect_true(isMassPeaks(p[[1]])) expect_equal(mass(p[[1]]), 1:5) expect_equal(intensity(p[[1]]), 6:10) expect_equal(basename(metaData(p[[1]])$file), "tiny1-centroided.mzXML3.0.mzXML") }) MALDIquantForeign/tests/testthat/test_importMsd-functions.R0000644000176200001440000000114613211235236023633 0ustar liggesuserscontext("importMsd") test_that("importMsd", { expect_error(MALDIquantForeign:::.importMsd("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1.msd"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importMsd(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMsd(path, verbose=FALSE)) expect_equal(s, import(path, type="msd", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1.msd") }) MALDIquantForeign/tests/testthat/test_ibd-functions.R0000644000176200001440000000313713211235236022415 0ustar liggesuserscontext("ibd") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) processed <- matrix(c(cumsum(c(16L, rep.int(40L, 3L))), rep.int(5L, 4L), rep.int(40L, 4L)), nrow=4L) continuous<- matrix(c(16L, 56L, 16L, 96L, rep.int(5L, 4L), rep.int(40L, 4L)), nrow=4L) dimnames(processed) <- dimnames(continuous) <- list(rep(c("mass", "intensity"), 2), c("offset", "length", "encodedLength")) #test_that(".writeIbd", { #uuid <- "3858f622-30ac-4c91-9f30-0c664312c63f" #file <- tempfile() #MALDIquantForeign:::.writeIbd(filename=file, uuid=uuid) #}) test_that(".ibdOffsets", { expect_equal(MALDIquantForeign:::.ibdOffsets(s, processed=TRUE), processed) expect_equal(MALDIquantForeign:::.ibdOffsets(s, processed=FALSE), continuous) }) test_that(".addIbdOffsets", { rp <- list(createMassSpectrum(mass=1:5, intensity=1:5, metaData=list(imaging=list(offsets=processed[1:2,]))), createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(imaging=list(offsets=processed[3:4,])))) rc <- list(createMassSpectrum(mass=1:5, intensity=1:5, metaData=list(imaging=list(offsets=continuous[1:2,]))), createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(imaging=list(offsets=continuous[3:4,])))) expect_equal(MALDIquantForeign:::.addIbdOffsets(s, processed=TRUE), rp) expect_equal(MALDIquantForeign:::.addIbdOffsets(s, processed=FALSE), rc) }) MALDIquantForeign/tests/testthat/test_importCdf-functions.R0000644000176200001440000000416713211235236023612 0ustar liggesuserscontext("importCdf") ## create NetCDF test file # #library("RNetCDF") #nc <- create.nc("tiny.cdf") # #dim.def.nc(nc, "scan_number", 2) #dim.def.nc(nc, "point_number", 10, unlim=TRUE) # #var.def.nc(nc, "scan_index", "NC_INT", "scan_number") #var.def.nc(nc, "point_count", "NC_INT", "scan_number") #var.def.nc(nc, "scan_acquisition_time", "NC_DOUBLE", "scan_number") # #var.def.nc(nc, "mass_values", "NC_DOUBLE", "point_number") #var.def.nc(nc, "intensity_values", "NC_INT", "point_number") # #var.put.nc(nc, "scan_index", c(0,5)) #var.put.nc(nc, "point_count", c(5, 5)) #var.put.nc(nc, "scan_acquisition_time", c(1, 2)) # #var.put.nc(nc, "mass_values", 1:5, start=1, count=5) #var.put.nc(nc, "mass_values", 6:10, start=6, count=5) #var.put.nc(nc, "intensity_values", 11:15, start=1, count=5) #var.put.nc(nc, "intensity_values", 16:20, start=6, count=5) # #close.nc(nc) # test_that("importCdf", { path <- normalizePath(system.file(file.path("exampledata", "tiny.cdf"), package="MALDIquantForeign")) if (suppressWarnings(require("RNetCDF", quietly=TRUE))) { ## suppress warnings to avoid creation of Rplots.pdf expect_error(suppressWarnings(MALDIquantForeign:::.importCdf("tmp.tmp"))) r <- list(createMassSpectrum(mass=1:5, intensity=11:15, metaData=list(file=path, number=1, retentionTime=1, scanIndex=0)), createMassSpectrum(mass=6:10, intensity=16:20, metaData=list(file=path, number=2, retentionTime=2, scanIndex=5))) s <- MALDIquantForeign:::.importCdf(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importCdf(path, verbose=FALSE)) expect_equal(s, import(path, type="cdf", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 11:15) expect_equal(basename(metaData(s[[1]])$file), "tiny.cdf") expect_equal(s, r) } else { expect_error(suppressWarnings(MALDIquantForeign:::.importCdf(path)), "install.packages") } }) MALDIquantForeign/tests/testthat/test_exportMzMl-methods.R0000644000176200001440000001125213330400313023420 0ustar liggesuserscontext("exportMzMl") m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) tmp <- tempdir() mzML <- c( "", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", paste0(" "), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw=", " ", " ", " ", " ", " ", " eJxjYAABCQcwxSADpRWgtBKUVnEAAB9MAds=", " ", " ", " ", " ", " ", "") test_that(".exportMzMl", { MALDIquantForeign:::.exportMzMl(m, file=file.path(tmp, "m.mzML")) expect_equal(readLines(file.path(tmp, "m.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"m\"", x=mzML)) }) test_that("exportMzMl,MassSpectrum", { MALDIquantForeign:::exportMzMl(m, file=file.path(tmp, "ms.mzML")) expect_equal(readLines(file.path(tmp, "ms.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"ms\"", x=mzML)) }) test_that("exportMzMl,list", { spectra <- list(m, m) MALDIquantForeign::exportMzMl(spectra, path=tmp, force=TRUE) expect_equal(readLines(file.path(tmp, "TESTS_1.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_1\"", x=mzML)) expect_equal(readLines(file.path(tmp, "TESTS_2.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_2\"", x=mzML)) }) MALDIquantForeign/tests/testthat/test_mzMl-functions.R0000644000176200001440000000113414154152461022576 0ustar liggesuserscontext("mzMl") test_that(".writeImzMlScanList", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(imaging=list(pos=c(x=1e8, y=1e8)))) f <- file.path(tempdir(), "imzlscanlist") r <- c( " ", " ", " ", " ", " ", " " ) MALDIquantForeign:::.writeImzMlScanList(m, file=f) expect_equal(readLines(f), r) }) MALDIquantForeign/tests/testthat/test_importMzMl-functions.R0000644000176200001440000000543713211235236023776 0ustar liggesuserscontext("importMzMl") test_that("importMzMl", { expect_error(MALDIquantForeign:::.importMzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1.mzML1.1.mzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importMzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="mzML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1.mzML1.1.mzML") expect_true(isMassSpectrum(s[[2]])) expect_equal(mass(s[[2]]), 1:5) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny1.mzML1.1.mzML") }) test_that("importMzMl compressed", { expect_error(MALDIquantForeign:::.importMzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1-compressed.mzML1.1.mzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importMzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="mzML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1-compressed.mzML1.1.mzML") expect_true(isMassSpectrum(s[[2]])) expect_equal(mass(s[[2]]), 1:5) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny1-compressed.mzML1.1.mzML") }) test_that("importMzMl centroided", { expect_error(MALDIquantForeign:::.importMzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1-centroided.mzML1.1.mzML"), package="MALDIquantForeign")) p <- MALDIquantForeign:::.importMzMl(path, centroided=TRUE, verbose=FALSE) expect_equal(p, import(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, importMzMl(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, import(path, type="mzML", centroided=TRUE, verbose=FALSE)) expect_true(isMassPeaks(p[[1]])) expect_equal(mass(p[[1]]), 1:5) expect_equal(intensity(p[[1]]), 6:10) expect_equal(basename(metaData(p[[1]])$file), "tiny1-centroided.mzML1.1.mzML") expect_true(isMassPeaks(p[[2]])) expect_equal(mass(p[[2]]), 1:5) expect_equal(intensity(p[[2]]), 10:6) expect_equal(basename(metaData(p[[2]])$file), "tiny1-centroided.mzML1.1.mzML") ## overwrite default arguments path <- normalizePath(system.file( file.path("exampledata", "tiny1.mzML1.1.mzML"), package="MALDIquantForeign")) expect_true(all(sapply(MALDIquantForeign:::.importMzMl(path, centroided=TRUE), isMassPeaks))) }) MALDIquantForeign/tests/testthat/test_list.files-functions.R0000644000176200001440000000167113211235236023734 0ustar liggesuserscontext("list.files") test_that("list.files-functions", { path <- normalizePath(system.file("exampledata", package="MALDIquantForeign")) expect_identical(MALDIquantForeign:::.list.files(path, pattern="tiny1-c"), normalizePath(file.path(path, c("tiny1-centroided.mzML1.1.mzML", "tiny1-centroided.mzXML3.0.mzXML", "tiny1-compressed.mzML1.1.mzML", "tiny1-compressed.mzXML3.0.mzXML")))) expect_identical(MALDIquantForeign:::.list.files(path, pattern="tiny1-c", excludePattern="\\.mzXML$"), normalizePath(file.path(path, c("tiny1-centroided.mzML1.1.mzML", "tiny1-compressed.mzML1.1.mzML")))) }) MALDIquantForeign/tests/testthat/test_importImzMl-functions.R0000644000176200001440000000444313631461250024146 0ustar liggesuserscontext("importImzMl") test_that("importImzMl continuous", { expect_error(MALDIquantForeign:::.importImzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny_continuous.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importImzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="imzML", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny_continuous.imzML") expect_equal(mass(s[[2]]), 1:5) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny_continuous.imzML") }) test_that("importImzMl processed", { path <- normalizePath(system.file( file.path("exampledata", "tiny_processed.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importImzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="imzML", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny_processed.imzML") expect_equal(mass(s[[2]]), 6:10) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny_processed.imzML") }) test_that("importImzMl coordinates", { path <- normalizePath(system.file( file.path("exampledata", "tiny_continuous.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path, verbose=FALSE) expect_equal(s, importImzMl(path, coordinates=cbind(1:2, c(1, 1)), verbose=FALSE)) expect_equal(s[1], importImzMl(path, coordinates=cbind(1, 1), verbose=FALSE)) expect_equal(s[[2]], importImzMl(path, coordinates=cbind(2, 1), verbose=FALSE)[[1]]) expect_error(importImzMl(path, coordinates=3, verbose=FALSE), "The .*coordinates.* argument has to be a matrix with two columns") expect_warning(importImzMl(path, coordinates=cbind(1:3, 2:0), verbose=FALSE), "The following rows contain invalid coordinates: 1, 3") }) MALDIquantForeign/tests/testthat/test_exportMsd-methods.R0000644000176200001440000000506513211235236023301 0ustar liggesuserscontext("exportMsd") m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(owner="OWNER", institution="INSTITUTION", instrument="INSTRUMENT")) p <- createMassPeaks(mass=4:5, intensity=9:10, snr=1:2) tmp <- tempdir() msd <- c( "", "", " ", " tmp.msd", " ", " ", " ", " ", " ", " ", " ", " ", " eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw=", " eJxjYAABCQcwxSADpRWgtBKUVnEAAB9MAds=", " ", " ", " ", " ", " ", "") if (.Platform$endian == "big") { msd[13:14] <- c( " eJyz/8AABg4MUJoDSgtAaREIDQBExAJc", " eJxzkGAAAwcZKK0ApZWgtAqEBgArDgHb") } test_that(".exportMsd", { MALDIquantForeign:::.exportMsd(m, file=file.path(tmp, "m.msd"), peaks=p) expect_equal(readLines(file.path(tmp, "m.msd"))[-c(4:5)], msd[-c(4:5)]) }) test_that("exportMsd,MassSpectrum", { MALDIquantForeign::exportMsd(m, file=file.path(tmp, "msp.msd"), peaks=p) expect_equal(readLines(file.path(tmp, "msp.msd"))[-c(4:5)], msd[-c(4:5)]) MALDIquantForeign::exportMsd(m, file=file.path(tmp, "ms.msd")) expect_equal(readLines(file.path(tmp, "ms.msd"))[-c(4:5)], msd[-c(4:5, 16:19)]) }) test_that("exportMsd,list", { spectra <- list(m, m) peaks <- list(p, p) MALDIquantForeign::exportMsd(spectra, path=tmp, force=TRUE, peaks=peaks) expect_equal(readLines(file.path(tmp, "1.msd"))[-c(4:5)], msd[-c(4:5)]) expect_equal(readLines(file.path(tmp, "2.msd"))[-c(4:5)], msd[-c(4:5)]) MALDIquantForeign::exportMsd(spectra, path=tmp, force=TRUE) expect_equal(readLines(file.path(tmp, "1.msd"))[-c(4:5)], msd[-c(4:5, 16:19)]) expect_equal(readLines(file.path(tmp, "2.msd"))[-c(4:5)], msd[-c(4:5, 16:19)]) }) test_that(".createMsdTitle", { f <- file(file.path(tempdir(), "test.msd")) expect_true(MALDIquantForeign:::.createMsdTitle(f) == "test") close(f) }) MALDIquantForeign/tests/testthat/test_filename-functions.R0000644000176200001440000000536313211235236023442 0ustar liggesuserscontext("filename") test_that(".cleanFilename", { expect_identical(MALDIquantForeign:::.cleanFilename( "/home/a:/\"foo&bar\"/g.\\23!/ foo-bar?.txt"), "_home_a_foo_bar_g_23_foo_bar_txt") }) test_that("file extension is returned", { expect_identical(MALDIquantForeign:::.fileExtension("~/foo.txt"), "txt") expect_identical(MALDIquantForeign:::.fileExtension( c("/etc/a.conf", "b.pdf")), c("conf", "pdf")) }) test_that("file name is returned", { expect_identical(MALDIquantForeign:::.fileExtension("~/foo"), "foo") }) test_that("path without extension is returned", { expect_identical(MALDIquantForeign:::.withoutFileExtension( c("~/foo", "/home/user/xyz.tar.gz", "/tmp/bar.txt")), c("~", "/home/user/xyz", "/tmp/bar")) }) test_that("file extension is changed", { expect_identical(MALDIquantForeign:::.changeFileExtension( c("/home/user/xyz.tar.gz", "/tmp/bar.txt"), c("txt", "csv")), c("/home/user/xyz.txt", "/tmp/bar.csv")) }) test_that(".cutFilenames", { expect_identical(MALDIquantForeign:::.cutFilenames( c("/home/user/foo.bar", "/home/user/xyz.tar.gz")), c("foo.bar", "xyz.tar.gz")) expect_identical(MALDIquantForeign:::.cutFilenames( c("/home/user/foo.bar", "/home/user/foo.bar")), c("foo.bar", "foo.bar")) }) test_that(".composeFilenames", { s <- createMassSpectrum(mass=1:5, intensity=1:5, metaData=list(file="/foo/bar.txt")) expect_identical(MALDIquantForeign:::.composeFilename(s), "/foo/bar.csv") expect_identical(MALDIquantForeign:::.composeFilename(s, fileExtension="xml"), "/foo/bar.xml") metaData(s) <- list(fullName="foo") expect_identical(MALDIquantForeign:::.composeFilename(s), "foo.csv") metaData(s) <- list(fullName=c("foo", "bar")) expect_identical(MALDIquantForeign:::.composeFilename(s), "foo_bar.csv") }) test_that(".uniqueBaseFilenames", { expect_identical(MALDIquantForeign:::.uniqueBaseFilenames( c("/home/user/foo.bar", "/home/user/foo.bar"), fileExtension="txt"), c("foo_1.txt", "foo_2.txt")) expect_identical(MALDIquantForeign:::.uniqueBaseFilenames( c("", "")), c("1.csv", "2.csv")) }) test_that(".make.unique", { expect_equal(MALDIquantForeign:::.make.unique(LETTERS[1:5]), LETTERS[1:5]) expect_equal(MALDIquantForeign:::.make.unique(rep(LETTERS[1:5], each=2)), paste(rep(LETTERS[1:5], each=2), 1:2, sep="_")) expect_equal(MALDIquantForeign:::.make.unique(rep(LETTERS[1:2], each=10)), sprintf("%s_%02d", rep(LETTERS[1:2], each=10), 1:10)) }) MALDIquantForeign/tests/testthat/test_importTab-functions.R0000644000176200001440000000573313631521010023616 0ustar liggesuserscontext("importTab") test_that("importTab", { ## suppress warnings to avoid creation of Rplots.pdf expect_error(suppressWarnings(MALDIquantForeign:::.importTab("tmp.tmp"))) path <- normalizePath(system.file(file.path("exampledata", "ascii.txt"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importTab(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importTxt(path, verbose=FALSE)) expect_equal(s, import(path, type="txt", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "ascii.txt") ## issue 29, double skip expect_equal( as.matrix(MALDIquantForeign:::.importTab(path, skip=2L, verbose=FALSE)[[1L]]), matrix(c(3:5, 8:10), ncol=2L, dimnames=list(c(), c("mass", "intensity"))) ) }) test_that("importCsv", { ## suppress warnings to avoid creation of Rplots.pdf expect_error(suppressWarnings(MALDIquantForeign:::.importCsv("tmp.tmp"))) path <- normalizePath(system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importCsv(path, sep=",", header=TRUE, verbose=FALSE) expect_equal(s, import(path, sep=",", header=TRUE, verbose=FALSE)) expect_equal(s, importCsv(path, sep=",", header=TRUE, verbose=FALSE)) expect_equal(s, import(path, type="csv", sep=",", header=TRUE, verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv1.csv") ## auto header s <- MALDIquantForeign:::.importCsv(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importCsv(path, verbose=FALSE)) expect_equal(s, import(path, type="csv", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv1.csv") s <- MALDIquantForeign:::.importCsv(system.file( file.path("exampledata", "csv2.csv"), package="MALDIquantForeign"), sep=";", header=FALSE) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv2.csv") ## auto header s <- MALDIquantForeign:::.importCsv(file.path(dirname(path), "csv2.csv"), sep=";") expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv2.csv") }) x <- c("10, 30", "\"foo\", \"bar\"", "foo; bar", "foo\tbar", "1\t 2") sep <- c(",", ",", ";", "\t", "\t") test_that("autoHeader", { result <- c(FALSE, TRUE, TRUE, TRUE, FALSE) for (i in seq(along=x)) { expect_identical(MALDIquantForeign:::.autoHeader(x[i], sep=sep[i]), result[i]) } }) test_that("autoSep", { for (i in seq(along=x)) { expect_identical(MALDIquantForeign:::.autoSep(x[i]), sep[i]) } }) MALDIquantForeign/tests/testthat.R0000644000176200001440000000006413211235236016606 0ustar liggesuserslibrary("testthat") test_check("MALDIquantForeign") MALDIquantForeign/vignettes/0000755000176200001440000000000014165366321015502 5ustar liggesusersMALDIquantForeign/vignettes/MALDIquantForeign-intro.Rnw0000644000176200001440000001370413211235236022530 0ustar liggesusers%\VignetteEngine{knitr} %\VignetteIndexEntry{MALDIquantForeign: Import/Export routines for MALDIquant} %\VignetteKeywords{Bioinformatics, Proteomics, Mass Spectrometry} %\VignettePackage{MALDIquantForeign} \documentclass[12pt]{article} \usepackage{natbib} \usepackage{hyperref} \usepackage{tikz} \usepackage{bibentry} % inline bibentries \nobibliography* % no special bibliography for bibentry \newcommand{\R}{\texttt{R}} \newcommand{\CRAN}{\texttt{CRAN}} \newcommand{\Rfunction}[1]{{\texttt{#1}}} \newcommand{\Robject}[1]{{\texttt{#1}}} \newcommand{\Rpackage}[1]{{\texttt{#1}}} \newcommand{\Mq}{\Rpackage{MALDIquant}} \newcommand{\MqF}{\Rpackage{MALDIquantForeign}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \title{\MqF{}: Import/Export routines for \Mq{}} \author{ Sebastian Gibb% \thanks{\email{mail@sebastiangibb.de}} } \date{\today} \begin{document} <>= library("knitr") opts_chunk$set(tidy.opts=list(width.cutoff=45), tidy=FALSE, fig.align="center", fig.height=4.25, comment=NA, prompt=TRUE) @ <>= suppressPackageStartupMessages(library("MALDIquant")) suppressPackageStartupMessages(library("MALDIquantForeign")) @ \maketitle \begin{abstract} \MqF{} provides routines for importing/exporting different file formats into/from \Mq{}.\\ This vignette describes the usage of the \MqF{} package. \end{abstract} \clearpage \tableofcontents \section*{Foreword} \MqF{} is free and open source software for the \R{} \citep{RPROJECT} environment and under active development. If you use it, please support the project by citing it in publications: \begin{quote} \bibentry{MALDIquant} \end{quote} If you have any questions, bugs, or suggestions do not hesitate to contact me (\email{mail@sebastiangibb.de}). \\ Please visit \url{http://strimmerlab.org/software/maldiquant/}. \section{Introduction} \Mq{} should be device and platform independent. That's why it has not any import/export functions. \\ \MqF{} fills this gap and provides import/export routines for various file formats: <>= supportedFileFormats() @ \section{Setup} After starting \R{} we could install \Mq{} and \MqF{} directly from \CRAN{} using \Rfunction{install.packages}: <>= install.packages(c("MALDIquant", "MALDIquantForeign")) @ Before we can use \Mq{} and \MqF{} we have to load the packages. <>= library("MALDIquant") library("MALDIquantForeign") @ \section{Import} \MqF{} provides an \Rfunction{import} function that tries to auto-detect the correct file type. Because this would never be perfect \MqF{} offers also many \Rfunction{import*} functions like \Rfunction{importBrukerFlex}, \Rfunction{importMzMl}, etc. Please see the manual page of \Rfunction{import} for a complete list (\Rfunction{?import}).\\ First we try to import some example data in Bruker Daltonics *flex-series file format using the \Rfunction{import} function. <>= ## get the example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") spectra <- import(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ Next we use the \Rfunction{importBrukerFlex} function (the result is the same as above). <>= spectra <- importBrukerFlex(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ \MqF{} supports compressed files, too (\emph{zip}, \emph{tar.\{bz2, gz,xz\}}). <>= spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.tar.gz"), verbose=FALSE) spectra[[1]] spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.zip"), verbose=FALSE) spectra[[1]] @ Remote files are supported as well. Data are taken from \citet{Tan2006}. <>= spectra <- import(paste0("http://www.meb.ki.se/", "~yudpaw/papers/spikein_xml.zip"), centroided=FALSE, verbose=TRUE) @ If you want to read peak lists (centroided data) instead of spectra data you have to set \Rfunction{centroided=TRUE}. <>= peaks <- import(file.path(exampleDirectory, "ascii.txt"), centroided=TRUE, verbose=FALSE) peaks @ \section{Export} The export routines in \MqF{} are very similar to the import routines. Please see manual page of \Rfunction{export} for a complete list of supported export routines (\Rfunction{?export}). First we create a simple list of \Robject{MassSpectrum} objects using \Rfunction{createMassSpectrum}. <>= spectra <- list( createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) @ Now we want to export the first spectrum into a CSV file. <>= export(spectra[[1]], file="spectrum1.csv") import("spectrum1.csv") @ Exporting every file by hand is cumbersome. We want to export the whole list of spectra. Instead of \Robject{file} we use \Robject{path} now to specify a directory. Please note that we have to add the file type/format information now (we can use the \Robject{type} argument or the corresponding \Rfunction{export*} function). If the path doesn't exists we will get an error. To force \Rfunction{export} to create/overwrite the given path, we set the argument \Robject{force=TRUE}. <>= export(spectra, type="csv", path="spectra", force=TRUE) list.files("spectra") @ \section{Analyse Mass Spectrometry Data} Please have a look at the corresponding vignette shipped with \Mq{} and the \Mq{} website: \url{http://strimmerlab.org/software/maldiquant/}. <>= vignette(topic="MALDIquant", package="MALDIquant") @ \section{Session Information} <>= toLatex(sessionInfo(), locale=FALSE) @ \bibliographystyle{apalike} \bibliography{bibliography} \end{document} MALDIquantForeign/vignettes/bibliography.bib0000644000176200001440000000250213211235236020621 0ustar liggesusers@MANUAL{RPROJECT, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2014}, url = {http://www.R-project.org/}, } @ARTICLE{MALDIquant, title = {{MALDI}quant: a versatile {R} package for the analysis of mass spectrometry data}, author = {Sebastian Gibb and Korbinian Strimmer}, volume = {28}, number = {17}, pages = {2270-2271}, year = {2012}, doi = {10.1093/bioinformatics/bts447}, url = {http://bioinformatics.oxfordjournals.org/content/28/17/2270.abstract}, eprint = {http://bioinformatics.oxfordjournals.org/content/28/17/2270.full.pdf+html}, journal = {Bioinformatics}, publisher = {Oxford Univ Press}, } @ARTICLE{Tan2006, title={Finding regions of significance in {SELDI} measurements for identifying protein biomarkers}, author={Tan, Chuen Seng and Ploner, Alexander and Quandt, Andreas and Lehti{\"o}, Janne and Pawitan, Yudi}, volume={22}, number={12}, pages={1515--1523}, year={2006}, doi = {10.1093/bioinformatics/btl106}, url = {http://bioinformatics.oxfordjournals.org/content/22/12/1515.abstract}, eprint = {http://bioinformatics.oxfordjournals.org/content/22/12/1515.full.pdf+html}, journal={Bioinformatics}, publisher={Oxford Univ Press} } MALDIquantForeign/NEWS0000644000176200001440000002676314161046447014207 0ustar liggesusersRELEASE HISTORY OF THE "MALDIquantForeign" PACKAGE ================================================== CHANGES in MALDIquantForeign VERSION 0.13 [2021-12-23] ------------------------------------------------------ DOCUMENTATION * `exportMzMl` and `exportImzMl` also support the export of `MALDIquant::MassPeaks` objects. (Before just `MassSpectrum` was mentioned.) MODIFICATIONS * Change URLs from http to https where possible. INTERNAL CHANGES * Test for `MassSpectrum` and `MassPeaks` list in `.write{Imz,Mz}MlDocument`. * Remove `is.null(getGeneric(...))` tests before setting generics for S4 methods to avoid errors in package loading (especially with `pkgload::load_all()`). * `.writeImzMlDocument` uses `MALDIquant::coordinates` explicitly to avoid method dispatch conflict in combination with the `sp` package. Reported by Denis Abu Sammour (#33). CHANGES in MALDIquantForeign VERSION 0.12.2 [2020-09-18]: --------------------------------------------------------- * Fix `.autoSep` and `.autoHeader` to look just in the first line of an ascii document for separator/header information. Before the whole file was search but just the first line reported anyway. This results in an unnecessary long reading time. Affected functions (if arguments "sep" and "header" where not given by the user: .csv, .tab, .txt import: `import`, `importCsv`, `importTab`, `importTxt`. CHANGES in MALDIquantForeign VERSION 0.12.1 [2020-03-09]: --------------------------------------------------------- * Fix reading of txt, csv, tab files if "skip" argument is used ("skip" was applied twice). Affected functions: .csv, .tab, .txt import: `import`, `importCsv`, `importTab`, `importTxt`. Bug reported by Samuel Granjeaud (#29). CHANGES in MALDIquantForeign VERSION 0.12 [2019-01-30]: ------------------------------------------------------- * Fix reading of mzML with "non-standard data" arrays. Bug reported by Paul Turner. CHANGES in MALDIquantForeign VERSION 0.11.6 [2018-08-30]: --------------------------------------------------------- * Ignore comments in `.autoSep` and `.autoHeader`. Affected functions: .tab and .csv import, `import`, `importCsv`, `importTab`, `importTxt`. Bug reported by Fernando Pineda. CHANGES in MALDIquantForeign VERSION 0.11.5 [2018-08-14]: --------------------------------------------------------- * Fix psidev URLs. CHANGES in MALDIquantForeign VERSION 0.11.4 [2018-08-01]: --------------------------------------------------------- BUGFIX * Don't access `totalIonCurrent` for `MassPeaks` objects in `exportMzMl` and `exportImzMl`. CHANGES in MALDIquantForeign VERSION 0.11.3 [2018-05-27]: --------------------------------------------------------- BUGFIX * Don't use scientific format for numeric values in (i)mzML export. Patch by F. Orlando Galashan (see #25). CHANGES in MALDIquantForeign VERSION 0.11.2 [2018-03-18]: --------------------------------------------------------- BUGFIX * Fix missing unitName in intensity array in mzMl export. Reported by Jan Kobarg patch proposed by F. Orlando Galashan (see #22/#24). CHANGES IN MALDIquantForeign VERSION 0.11.1 [2017-12-04]: --------------------------------------------------------- BUGFIX * Fix handling of "processed" argument in `.writeImzMlDocument`; see #21. * Fix `export` method if there was no filename given. CHANGES IN MALDIquantForeign VERSION 0.11 [2017-09-01]: ------------------------------------------------------- BUGFIX * Fix integer overflow in `.ibdOffsets`; see issue #20. * Fix `exportImzMl` for missing coordinates, pixelSize and dimension; closes * #20. INTERNAL CHANGES * Put MALDIquant into single quotes in the DESCRIPTION file. * Rezip inst/compressed/csv.tar.gz using `gzip -n` to avoid lintian's package-contains-timestamped-gzip warning; see https://wiki.debian.org/ReproducibleBuilds for details. CHANGES IN MALDIquantForeign VERSION 0.10 [2015-10-31]: ------------------------------------------------------- IMPROVEMENTS * Add parallel support on unix-based platforms using the parallel package. All `import*` functions support the "mc.cores" argument (default is 1, means no parallel import). Please read also `?"MALDIquantForeign-parallel"`. * Add importer for .msd (mMass) files: `importMsd`. * Add basic export support for imzML files: `exportImzMl`. * `.importImzMl`: add "coordinates" argument to access specific spectra by their x, y coordinates within an imzML file; closes #14; affected functions: `import`, `importImzMl`. Thanks to Heath Patterson for this idea. MODIFICATIONS * Remove dependency "downloader". Since R 3.2.2 https is supported on all platforms by `base::download.file`. * Use "verbose = interactive()" in `import`. * Replace old imzML example files in inst/exampledata. * `exportMzMl`: improve documentation of the "path" argument. * `.importImzMl`: if the imzML file doesn't contain any UUID a warning is thrown instead of an error; affected functions: `import`, `importImzMl`. * `.importImzMl`: if the imzML file doesn't contain any checksum for its corresponding idb file a warning is thrown (before it was an error); affected functions: `import`, `importImzMl`. INTERNAL CHANGES * Import non-base functions/methods via NAMESPACE. * Use MALDIquant's new `coordinates` method. * Replace `require` by `requireNamespace` as suggested by "Writing R Extensions". * Rezip gzip'ed files using `gzip -n` to avoid lintian's package-contains-timestamped-gzip warning; see https://wiki.debian.org/ReproducibleBuilds for details. CHANGES IN MALDIquantForeign VERSION 0.9 [2014-08-11]: ------------------------------------------------------ IMPROVEMENTS * `.readAnalyzeIntensity`: allow to specify a mass range of interest to reduce memory usage while importing Analyze files; affected functions: `import`, `importAnalyze` * `importAnalyze`: use `as.double` after reading the image dimensions to avoid integer overflows in vector allocations (the Analyze 7.5 format specification limits the dimensions to integer). Thanks to Ken Frankel for reporting this problem. * `importImzMl`: add MD5 checksum support for imzML files. Thanks to Ken Frankel for reporting this problem. CHANGES IN MALDIquantForeign VERSION 0.8 [2014-06-16]: ------------------------------------------------------ MODIFICATIONS * `import`: set argument `centroided=FALSE` as default (was `NA` before). The automatically determination of profile/centroided data was too error prone. Now we read everything as profile data (use `centroided=TRUE` to read centroided data); affected functions: all `import` functions (e.g. `importBrukerFlex`, `importMzMl` ...). IMPROVEMENTS * `importAnalyze`: circumvent the limit of 32747 intensity values that is specified in the official Analyze 7.5 format. Thanks to Ken Frankel for reporting this problem. INTERNAL CHANGES * Fix VignetteIndexEntry. * Rename vignette output file from MALDIquantForeign.pdf to MALDIquantForeign-intro.pdf. * Check availability of the "RNetCDF" package in the `importCdf` man page to avoid build failures on CRAN. * Don't evaluate the remote import example in the vignette to avoid build failures on CRAN. CHANGES IN MALDIquantForeign VERSION 0.7 [2014-04-11]: ------------------------------------------------------ IMPROVEMENTS * Add vignette. INTERNAL CHANGES * Move tests into tests/testthat to adapt to testthat 0.8 and new CRAN policy; close #10. * Fix path of exampledata (needed because the test scripts moved to tests). CHANGES IN MALDIquantForeign VERSION 0.6 [2014-01-28]: ------------------------------------------------------ NEW FEATURES * Add basic import support for CDF files [contributed by Pietro Franceschi]; new function: `importCdf`. * `import`: add arguments "massRange" and "minIntensity" to limit import range; affected functions: all `import*` functions. * `import`: add argument "centroided" to allow import of centroided spectra as MassPeaks objects; affected functions: all `import*` functions. IMPROVEMENTS * Add "skip" argument to `.importCsv`, `.importTab`, `.autoSep` and `.autoHeader` to allow skipping first lines; affected functions: `import`, `importTxt`, `importTab`, `importCsv` BUG FIXES * `importAnalyze`: add support for ABSiex Analyze 7.5 files. Thanks to Pietro Franceschi for reporting this bug/odd behaviour. * `.importTab`: use `.autoSep` and `.autoHeader` (before they were used only by `.importCsv`); affected functions: `import`, `importTxt`, `importTab` * `.parseMzML`: fix assignment operation. Before all metaData of spectra were overwritten by the metaData of the last spectrum (affected only mzML files with more than one spectrum). affected functions: `importMzML` * `export`: fix one file export; additional affected functions: `exportMzMl`. INTERNAL CHANGES * Regenerate man pages with new 'roxygen2' (3.0.0). CHANGES IN MALDIquantForeign VERSION 0.5.1 [2013-09-18]: -------------------------------------------------------- BUG FIXES * Replace MALDIquant:::isMassSpectrum by MALDIquant::isMassSpectrum. * Replace deprecated function isMassObjectList. CHANGES IN MALDIquantForeign VERSION 0.5 [2013-09-08]: ------------------------------------------------------ IMPROVEMENTS * `import*`: add "excludePattern" argument to avoid import of specific files; closes #8. BUGFIXES * Fix "totalIonCurrent" test case. * Add import("methods") to NAMESPACE (fixes #9). INTERNAL CHANGES * Update dependencies; now MALDIquantForeign depends on R 3.0.0. * Replace all paste(..., sep="") by paste0. CHANGES IN MALDIquantForeign VERSION 0.4 [2013-04-28]: ------------------------------------------------------ NEW FEATURES * Add basic import support for imzML files and Analyze 7.5 files. IMPROVEMENTS * `import`: add "removeEmptySpectra" argument; closes #7. MODIFICATIONS * `import`: change default argument "verbose" to TRUE. BUGFIXES * `.download`: respects "verbose" argument now (fixes #6). INTERNAL CHANGES * Remove LICENSE file. CHANGES IN MALDIquantForeign VERSION 0.3 [2013-03-01]: ------------------------------------------------------ NEW FEATURES * Add basic support for mzML export. * Add basic import support for Ciphergen XML files. * `import`: add http(s):// and ftp:// support. * `import`: add uncompression support to allow import of zip/tar.{gz,bz2,xz}-archives. BUGFIXES * Add missing "usage" section in `export` methods manual pages. * `.files`: returns only unique file names; affected functions: all import functions. INTERNAL CHANGES * `.make.unique`: generates c("a1", "a2") instead of c("a", "a1") and c("a001", ..., "a099", "a100") instead of c("a", ..., "a98", "a99"); affected method: `export,list`. * DESCRIPTION: move base64enc, digest, readBrukerFlexData, readMzXmlData and XML to "Imports". * DESCRIPTION: remove MALDIquant from the "Imports" field. CHANGES IN MALDIquantForeign VERSION 0.2 [2013-01-14]: ------------------------------------------------------ IMPROVEMENTS * `exportMsd`: complete rewrite, write xml files manually instead of using the XML package (increasing speed). BUGFIXES * `export`: fix empty filenames. * `export,list`: stop if directory doesn't exist. * `exportMsd`: fix peaks argument. * `exportMsd` tests: respect endianness. * `import`: respect verbose argument in `import(type="auto")`. CHANGES IN MALDIquantForeign VERSION 0.1 [2012-12-10]: ------------------------------------------------------ * First public release. * Supported file formats: * Import: tab, txt, csv, Bruker Daltonics *flex files, mzXML, mzML * Export: tab, csv, msd MALDIquantForeign/R/0000755000176200001440000000000014161050042013655 5ustar liggesusersMALDIquantForeign/R/compression-functions.R0000644000176200001440000000635114161050042020354 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .isCompressed <- function(x) { z <- c("bz2", "bzip2", "gz", "lzma", "xz") .fileExtension(x) %in% c("zip", z, paste("tar", z, sep=".")) } .isTar <- function(x)grepl(pattern="^tar", x=.fileExtension(x)) .isZip <- function(x)grepl(pattern="^zip$", x=.fileExtension(x)) .isPackedOrCompressed <- function(x) { .isCompressed(x) | .isTar(x) } # unpack/uncompress files and return temporary filenames .uncompress <- function(x, verbose=TRUE) { f <- lapply(x, function(path) { if (!.isPackedOrCompressed(path)) { return(x) } else { if (.isTar(path)) { return(.unpacking(x, fun=untar, verbose=verbose)) } else if (.isZip(path)) { return(.unpacking(x, fun=unzip, verbose=verbose)) } else { return(.gunzip(x, verbose=verbose)) } } }) unlist(f) } # unpack and return tmp filename .unpacking <- function(filename, destdir, fun, verbose=FALSE, ...) { if (missing(destdir)) { pattern <- paste0(.withoutFileExtension(basename(filename)), "_") destdir <- file.path(tempdir(), "MALDIquantForeign_uncompress", tempfile(pattern=pattern, tmpdir="")) } funName <- deparse(substitute(fun)) fun <- as.function(fun) .msg(verbose, funName, " ", filename, " to ", destdir, ".") unpacked <- fun(filename, exdir=destdir, ...) if (!length(unpacked)) { stop(funName, " failed!") } destdir } # gunzip and return tmp filename .gunzip <- function(filename, destfile, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " doesn't exist!") } if (missing(destfile)) { tmpdir <- file.path(tempdir(), "MALDIquantForeign_uncompress") if (!file.exists(tmpdir)) { dir.create(tmpdir, showWarnings=FALSE, recursive=TRUE) } pattern <- paste0(.withoutFileExtension(basename(filename)), "_") fileext <- paste0(".", .fileExtension(.withoutCompressionExtension(filename))) destfile <- tempfile(pattern=pattern, tmpdir=tmpdir, fileext=fileext) } .msg(verbose, "gunzip ", filename, " to ", destfile, ".") fi <- gzfile(filename, open="rb") on.exit(close(fi)) fo <- file(destfile, open="wb") on.exit(close(fo), add=TRUE) repeat { b <- readBin(fi, what=raw(), n=1e6) ## n==1e6 => nearly 50Mb if (length(b)) { writeBin(b, con=fo) } else { break } } destfile } .cleanupUncompressedTmpFiles <- function() { unlink(file.path(tempdir(), "MALDIquantForeign_uncompress"), recursive=TRUE) } MALDIquantForeign/R/AllGenerics.R0000644000176200001440000000323114161050042016167 0ustar liggesusers## Copyright 2012-2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setGeneric(".composeFilename", function(x, ...) standardGeneric(".composeFilename")) setGeneric(".exportTab", function(x, ...) standardGeneric(".exportTab")) setGeneric(".exportCsv", function(x, ...) standardGeneric(".exportCsv")) setGeneric(".exportImzMl", function(x, ...) standardGeneric(".exportImzMl")) setGeneric(".exportMsd", function(x, ...) standardGeneric(".exportMsd")) setGeneric(".exportMzMl", function(x, ...) standardGeneric(".exportMzMl")) setGeneric("export", function(x, ...) standardGeneric("export")) setGeneric("exportTab", function(x, ...) standardGeneric("exportTab")) setGeneric("exportCsv", function(x, ...) standardGeneric("exportCsv")) setGeneric("exportImzMl", function(x, ...) standardGeneric("exportImzMl")) setGeneric("exportMsd", function(x, ...) standardGeneric("exportMsd")) setGeneric("exportMzMl", function(x, ...) standardGeneric("exportMzMl")) MALDIquantForeign/R/importCiphergenXml-functions.R0000644000176200001440000000260714161050042021633 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importCiphergenXml <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ## read file s <- .parseCiphergenXml(file=file) list(.createMassObject(mass=s$spectrum$mass, intensity=s$spectrum$intensity, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/base64encode-functions.R0000644000176200001440000000372214161050042020254 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Converts double to base64 character. #' #' This function converts a \code{double} vector to a base64 encoded #' \code{character} vector. #' #' @param x \code{double}, vector #' @param size \code{integer}, number of bytes per element in the byte stream #' (see \code{size} in \code{\link[base]{writeBin}}). #' @param endian \code{character}, the endian-ness #' (see \code{endian} in \code{\link[base]{writeBin}}). #' @param compressionType \code{character}, type of compression to use for #' compression of \code{x} (see \code{type} in #' \code{\link[base]{memCompress}}. #' @return Vector of type \code{character}. #' @rdname base64-encode #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @seealso \code{\link[base64enc]{base64encode}} from \pkg{base64enc} package #' @keywords internal #' .base64encode <- function(x, size, endian=.Platform$endian, compressionType=c("none", "gzip")) { x <- writeBin(as.double(x), con=raw(), size=size, endian=endian) compressionType <- match.arg(compressionType, choices=c("none", "gzip"), several.ok=FALSE) x <- memCompress(from=x, type=compressionType) base64enc::base64encode(x) } MALDIquantForeign/R/msd-functions.R0000644000176200001440000000732214161050042016575 0ustar liggesusers## Copyright 2012-2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeMsdDocument <- function(x, file, peaks, encoding="utf-8") { ## stop if file isn't writeable if (file.exists(file) && file.access(file, 2) != 0) { stop("No permissions to write into ", sQuote(file), "!") } ## file handle f <- file(file, open="wt", encoding=encoding) ## header .writeXmlHeader(file=f, encoding=encoding) .writeXmlTag("mSD", attrs=c(version=2.2), close=FALSE, file=f) .writeMsdDescription(x, file=f) .writeMsdSpectrum(x, file=f) if (!missing(peaks)) { .writeMsdPeakList(peaks, file=f) } .writeCloseXmlTag("mSD", file=f) invisible(close(f)) } .writeMsdDescription <- function(x, file) { .writeXmlTag("description", intend=1, close=FALSE, file=file) .writeXmlTag("title", text=.createMsdTitle(file), intend=2, file=file) .writeXmlTag("date", attrs=c(value=.sanitize(metaData(x)$acquisitionDate)), intend=2, file=file) .writeXmlTag("operator", attrs=c(value=.sanitize(metaData(x)$owner)), intend=2, file=file) .writeXmlTag("contact", attrs=c(value=.sanitize(metaData(x)$owner)), intend=2, file=file) .writeXmlTag("institution", attrs=c(value=.sanitize(metaData(x)$institution)), intend=2, file=file) .writeXmlTag("instrument", attrs=c(value=.sanitize(metaData(x)$instrument)), intend=2, file=file) .writeXmlTag("notes", .sanitize(paste(metaData(x)$comments, collapse="\n")), intend=2, file=file) .writeCloseXmlTag("description", intend=1, file=file) } .writeMsdSpectrum <- function(x, file) { polarity <- paste(metaData(x)$ionizationMode, metaData(x)$polarity) if (length(polarity)) { polarity <- ifelse(grepl(pattern="+|positive", x=polarity), "1", "-1") } else { polarity <- "" } .writeXmlTag("spectrum", attrs=c(points=length(x), msLevel=ifelse(is.null(metaData(x)$msLevel), 1, metaData(x)$msLevel), polarity=polarity), close=FALSE, intend=1, file=file) .writeMsdArray(mass(x), name="mzArray", file=file) .writeMsdArray(intensity(x), name="intArray", file=file) .writeCloseXmlTag("spectrum", intend=1, file=file) } .writeMsdArray <- function(x, name, file) { .writeXmlTag(name, text=.base64encode(x, size=8, compressionType="gzip"), attrs=c(precision="64", compression="zlib", endian=.Platform$endian), intend=2, file=file) } .writeMsdPeakList <- function(x, file) { .writeXmlTag("peaklist", close=FALSE, intend=1, file=file) cat(paste0(" \n"), file=file, sep="", append=TRUE) .writeCloseXmlTag("peaklist", intend=1, file=file) } .createMsdTitle <- function(file) { .sanitize(.withoutFileExtension(basename(summary(file)$description))) } MALDIquantForeign/R/importImzMl-functions.R0000644000176200001440000001035614161050042020276 0ustar liggesusers## Copyright 2013-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importImzMl <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, coordinates=NULL, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ibdFilename <- .changeFileExtension(file, "ibd") if (!file.exists(ibdFilename)) { stop("File ", sQuote(ibdFilename), " doesn't exists!") } s <- .parseMzMl(file=file, verbose=verbose) ibd <- file(ibdFilename, open="rb") on.exit(close(ibd)) ## test UUID uuid <- paste0(readBin(ibd, raw(), n=16, size=1, signed=TRUE, endian= "little"), collapse="") if (is.null(s$ims$uuid)) { warning("There is not any UUID in ", sQuote(file), "!") } else if (tolower(uuid) != tolower(s$ims$uuid)) { warning("The UUID in ", sQuote(file) , " and ", sQuote(ibdFilename), "do not match!") } else if (!.isUuidV4(uuid)) { warning("The UUID: ", uuid, " is not valid!") } ## test checksums if (!is.null(s$ims$md5)) { .testChecksum(ibdFilename, s$ims$md5, algo="md5", verbose=verbose) } else if (!is.null(s$ims$sha1)) { .testChecksum(ibdFilename, s$ims$sha1, algo="sha1", verbose=verbose) } else { warning("At least one checksum (SHA-1 or MD5) for the idb file ", "should be provided in the imzML file.") } sel <- seq_along(s$ims$ibd) isCoordinatesMatrix <- is.matrix(coordinates) && ncol(coordinates) == 2L if (!is.null(coordinates) && !isCoordinatesMatrix) { stop("The ", sQuote("coordinates"), " argument has to be a matrix with two columns (x and y position)!") } if (isCoordinatesMatrix) { pos <- do.call(rbind, lapply(s$spectra, function(x)x$metaData$imaging$pos)) sel <- match(paste(coordinates[, 1L], coordinates[, 2L], sep=":"), paste(pos[, 1L], pos[, 2L], sep=":")) if (anyNA(sel)) { warning("The following rows contain invalid coordinates: ", paste(which(is.na(sel)), collapse=", ")) sel <- sort(sel[!is.na(sel)]) } } .readValues <- function(file, x, column, isSeekNeeded) { if (isSeekNeeded) { ## WARNING: we know that `seek` is discouraged on some platforms, ## namely Windows. See `?seek` for details. seek(file, where=x[column, "offset"]) } n <- x[column, "length"] e <- x[column, "encodedLength"] readBin(file, double(), n=n, size=e/n, signed=TRUE, endian="little") } n <- length(sel) spectra <- vector(mode="list", length=n) isProcessed <- s$ims$type == "processed" isSeekNeeded <- length(s$ims$ibd) > length(sel) if (!isProcessed) { mass <- .readValues(ibd, s$ims$ibd[[sel[1L]]], "mass", isSeekNeeded) } ## read mass and intensity values for (i in seq(along=sel)) { .msg(verbose, "Reading binary data for spectrum ", i, "/", n, " ...") m <- modifyList(s$metaData, s$spectra[[sel[i]]]$metaData) m$file <- file if (isProcessed) { mass <- .readValues(ibd, s$ims$ibd[[sel[i]]], "mass", isSeekNeeded) } intensity <- .readValues(ibd, s$ims$ibd[[sel[i]]], "intensity", isSeekNeeded) spectra[[i]] <- .createMassObject(mass=mass, intensity=intensity, metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } spectra } MALDIquantForeign/R/analyze-functions.R0000644000176200001440000001122614161050042017453 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see ## Analyze 7.5 header file .readAnalyzeHdr <- function(filename, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } size <- file.info(filename)$size ## Analyze 7.5 header must be of size 348; ABSciex files are a little bit ## larger (384) if (size != 348 && size != 384) { stop(sQuote(filename), " is no ANALYZE header file.") } .msg(verbose, "Extracting header information from ", sQuote(filename), " ...") f <- file(filename, open="rb") on.exit(close(f)) ## first 4 bytes have to be 348 in little endian mode ## (384 for ABSciex) endian <- ifelse(readBin(f, "integer", n=1, size=4, endian="little") %in% c(348, 384), "little", "big") ## skip unused entries seek(f, where=38) regular <- readChar(f, nchars=1, useBytes=TRUE) if (regular != "r") { stop("Wrong file format. Images have to be of equal size (", sQuote("regular"), " must be ", sQuote("r"), ")") } ## skip unused entries seek(f, where=40) ## 2 == number of intensity, 3 == ncol (x), 4 == nrow (y) ## use as.double() here to avoid integer overflows in calculations like nx*ny ## later ## Thanks to Ken Frankel for reporting this problem. dimensions <- as.double(readBin(f, "integer", n=8, size=2, endian=endian)) ## We use the size of the t2m file. See .readAnalyzeIntensity for details. #ni <- dimensions[2] nx <- dimensions[3] ny <- dimensions[4] ## skip unused entries seek(f, where=70) datatype <- readBin(f, "integer", n=1, size=2, endian=endian) bitpix <- readBin(f, "integer", n=1, size=2, endian=endian) if (datatype %in% c(2, 4, 8)) { what <- "integer" } else if (datatype %in% c(16, 32, 64)) { what <- "double" } else { what <- "raw" } signed <- datatype == 2 size <- bitpix/8 ## skip unused entries seek(f, where=76) pixdim <- readBin(f, "double", n=8, size=4, endian=endian) ## pixelwidth in mm xd <- pixdim[2] yd <- pixdim[3] list(nx=nx, ny=ny, xd=xd, yd=yd, endian=endian, what=what, signed=signed, size=size) } ## Analyze 7.5 img file .readAnalyzeIntensity <- function(filename, header, ni, skip=c(0, 0), verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } .msg(verbose, "Reading intensity values from ", sQuote(filename), " ...") stopifnot(length(skip) == 2) skip <- skip*header$size f <- file(filename, open="rb") on.exit(close(f)) ## header$ni should contain the number of intensity values ## because the format specification uses int16 for header$ni it is limited to ## 32767 intensity values. ## We use the size of the t2m file divided by 4 to find the correct number to ## circumvent this size limit. ## Thanks to Ken Frankel for reporting this problem. i <- vector(mode=header$what, length=ni*header$nx*header$ny) dim(i) <- c(ni, header$nx, header$ny) for (y in 1:header$ny) { for (x in 1:header$nx) { ## CAUTION: seek on Windows is possibly buggy; see ?seek for details. ## If there are any bug reports on Windows we maybe have to ignore "skip" ## on Windows (which would disable the mass range/memory saving feature ## completely). seek(f, where=seek(f)+skip[1]) i[, x, y] <- readBin(f, what=header$what, n=ni, size=header$size, signed=header$signed, endian=header$endian) seek(f, where=seek(f)+skip[2]) } } i } ## Analyze 7.5 t2m file .readAnalyzeMass <- function(filename, header, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } .msg(verbose, "Reading mass values from ", sQuote(filename), " ...") n <- file.info(filename)$size/4 f <- file(filename, open="rb") on.exit(close(f)) readBin(f, what="double", n=n, size=4, signed=TRUE, endian=header$endian) } MALDIquantForeign/R/exportTab-methods.R0000644000176200001440000000246014161050042017413 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportTab", signature=signature(x="AbstractMassObject"), definition=function(x, file="", row.names=FALSE, col.names=FALSE, ...) { write.table(as.matrix(x), file=file, row.names=row.names, col.names=col.names, ... ) }) setMethod(f=".exportCsv", signature=signature(x="AbstractMassObject"), definition=function(x, file="", sep=",", row.names=FALSE, col.names=TRUE, ...) { .exportTab(x, file=file, sep=sep, row.names=row.names, col.names=col.names, ...) }) MALDIquantForeign/R/xml-functions.R0000644000176200001440000000307314161050042016611 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeXmlHeader <- function(file, encoding) { cat("\n", file=file, sep="") } .writeCloseXmlTag <- function(tag, intend=0, file) { cat(paste0(rep(" ", times=intend)), "\n", file=file, sep="", append=TRUE) } .writeXmlTag <- function(tag, text=NULL, attrs=NULL, intend=0, close=TRUE, file) { intend <- paste0(rep(" ", times=intend)) if (length(attrs)) { attrs <- paste0(" ", names(attrs), "=\"", attrs, "\"") } if (length(text)) { text <- paste0(">", text) if (close) { text <- paste0(text, "") } } else { text <- ">" if (close) { text <- "/>" } } cat(intend, "<", tag, attrs, text, "\n", file=file, sep="", append=TRUE) } MALDIquantForeign/R/exportMsd-methods.R0000644000176200001440000000170714161050042017433 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportMsd", signature=signature(x="MassSpectrum"), definition=function(x, file, peaks, ...) { .writeMsdDocument(x=x, file=file, peaks=peaks, ...) }) MALDIquantForeign/R/ibd-functions.R0000644000176200001440000000436714161050042016556 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeIbd <- function(x, filename, uuid, processed=TRUE) { ibd <- file(filename, open="wb") on.exit(close(ibd)) uuid <- gsub("-", "", tolower(uuid)) uuid <- substring(uuid, seq(1L, 32L, by=2L), seq(2L, 32L, by=2L)) uuid <- strtoi(uuid, base=16L) writeBin(uuid, con=ibd, size=1L, endian="little") for (i in seq(along=x)) { if (processed || i == 1L) { writeBin(as.double(x[[i]]@mass), con=ibd, size=8L, endian="little") } writeBin(as.double(x[[i]]@intensity), con=ibd, size=8L, endian="little") } } .ibdOffsets <- function(x, processed=TRUE, encodedLengthSize=8L) { ## start at 16 (16 bytes for UUID) n <- rep(lengths(x), each=2L) encodedLength <- as.double(n * encodedLengthSize) if (processed) { offsets <- cumsum(as.double(c(16L, encodedLength[-length(n)]))) } else { sel <- seq(from=2L, to=length(n), by=2L) offsets <- rep.int(16L, length(n)) offsets[sel] <- 16L + cumsum(as.double(encodedLength[sel])) } matrix(c(offsets, n, encodedLength), nrow=length(n), dimnames=list(rep(c("mass", "intensity"), times=length(x)), c("offset", "length", "encodedLength"))) } .addIbdOffsets <- function(x, processed=TRUE, encodedLengthSize=8L) { offsets <- .ibdOffsets(x, processed=processed, encodedLengthSize=encodedLengthSize) i <- split(1:nrow(offsets), rep(1:length(x), each=2L)) for (j in seq(along=x)) { x[[j]]@metaData$imaging$offsets <- offsets[i[[j]],] } x } MALDIquantForeign/R/exportImzMl-methods.R0000644000176200001440000000304414161050042017734 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportImzMl", signature=signature(x="MassPeaks"), definition=function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, ...) { .writeImzMlDocument(x=x, file=file, id=id, processed=processed, ...) }) setMethod(f=".exportImzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, ...) { .writeImzMlDocument(x=x, file=file, id=id, processed=processed, ...) }) setMethod(f=".exportImzMl", signature=signature(x="list"), definition=function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, ...) { .writeImzMlDocument(x=x, file=file, id=id, processed=processed, ...) }) MALDIquantForeign/R/imzMl-functions.R0000644000176200001440000000501214161050042017074 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeImzMlDocument <- function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, uuid=.uuid(), coordinates=MALDIquant::coordinates(x), pixelSize=c(metaData(x[[1L]])$imaging$pixelSize, 100, 100)[1L:2L], ...) { if(isMassSpectrum(x) || isMassPeaks(x)) { x <- list(x) } if (!MALDIquant:::.isMassObjectList(x)) { stop("Only MALDIquant::MassSpectrum or MALDIquant::MassPeaks objects ", "are supported!") } if (is.null(metaData(x[[1L]])$imaging$pos) && is.null(coordinates)) { stop("The spectra contain no imaging information.") } isCoordinatesMatrix <- !is.null(coordinates) && is.matrix(coordinates) && ncol(coordinates) == 2L && nrow(coordinates) == length(x) if (!isCoordinatesMatrix) { stop("The ", sQuote("coordinates"), " argument has to be a matrix with two columns (x and y position)!") } else { size <- apply(coordinates, 2, max) dimension <- size * pixelSize x[[1L]]@metaData$imaging <- list(size=size, dim=dimension, pixelSize=pixelSize) MALDIquant::coordinates(x) <- coordinates } ibdFile <- .changeFileExtension(file, "ibd") .writeIbd(x, ibdFile, uuid=uuid, processed=processed) sha1 <- digest::digest(ibdFile, algo="sha1", file=TRUE) .writeMzMlDocument(x=.addIbdOffsets(x, processed=processed), file=file, id=id, imsArgs=list(uuid=uuid, sha1=sha1, processed=processed), ...) } MALDIquantForeign/R/createMassObject-functions.R0000644000176200001440000000644314161050042021233 0ustar liggesusers## Copyright 2014-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Create a MassSpectrum or a MassPeaks object. #' #' This function creates a MassSpectrum or MassPeaks object (depending on the #' centroided argument). #' #' @param mass mass data #' @param intensity intensity data #' @param snr snr data #' @param metaData \code{list}, metaData #' @param centroided \code{logical}, centroided #' (if TRUE => MassPeaks, if FALSE => MassSpectrum) #' @param massRange \code{double}, length == 2, trim spectrum to #' \code{massRange}. #' @param minIntensity \code{double}, minimal intensity #' @param verbose \code{logical}, verbose output? #' #' @return Returns a MassSpectrum or a MassPeaks object. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @rdname createMassObject #' @keywords internal #' @noRd .createMassObject <- function(mass, intensity, snr=NULL, metaData=list(), centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (!is.null(metaData$centroided) || !is.null(metaData$dataProcessing$centroided)) { isCentroided <- isTRUE(as.logical(as.numeric(metaData$centroided))) | isTRUE(as.logical(as.numeric(metaData$dataProcessing$centroided))) if (isCentroided != centroided) { warning("According to the metadata information the imported data are ", ifelse(isCentroided, "", "not "), "centroided, ", "but they are treated as ", ifelse(centroided, "centroided (MassPeaks)", "profile (MassSpectrum)"), " data. Maybe you want to use ", sQuote(paste0("centroided=", as.character(isCentroided))), ". See ", sQuote("?import"), " for details.", immediate.=TRUE) } } .msg(centroided & verbose, "Assume centroided data and creating a MassPeaks object.") ## trim AbstractMass object massRange <- MALDIquant:::.reorderRange(massRange) ## we don't use MALDIquant::trim here because we want to filter on the ## intensity as well i <- which(massRange[1L] <= mass & mass <= massRange[2L] & intensity >= minIntensity) if (is.null(snr)) { snr <- rep.int(NA_real_, length(i)) } ## create a MassPeaks object for centroided data if (centroided) { m <- createMassPeaks(mass=mass[i], intensity=intensity[i], snr=snr[i], metaData=metaData) } else { m <- createMassSpectrum(mass=mass[i], intensity=intensity[i], metaData=metaData) } m } MALDIquantForeign/R/filename-functions.R0000644000176200001440000000616514161050042017576 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .cleanFilename <- function(x) { gsub(pattern="([[:punct:]]|[[:space:]])+", replacement="_", x=x) } #' Determine file extension #' #' @param x \code{character}, filename. #' #' @return \code{character}, file extension. #' #' @seealso \code{\link[MALDIquant]{MassSpectrum-class}} #' @keywords internal #' @noRd #' @examples #' library("MALDIquantForeign") #' files <- c("/home/foo/bar.txt", "foobar.pdf") #' MALDIquantForeign:::.fileExtension(files) #' .fileExtension <- function(x) { pos <- regexpr(pattern="(\\.tar)?\\.([[:alnum:]]+)$|(/|\\\\)+[^.\\\\/]+$", text=x) ifelse(pos > -1L, substring(x, pos+1L), x) } .withoutFileExtension <- function(x) { sub(pattern="\\.[[:alnum:]]+?$|(/|\\\\)+[^.\\\\/]+$", replacement="", x=.withoutCompressionExtension(x)) } .withoutCompressionExtension <- function(x) { sub(pattern="\\.(zip|gz|bz2|bzip2|xz|lzma)+$", replacement="", x=x) } .changeFileExtension <- function(x, newExtension) { paste(.withoutFileExtension(x), newExtension, sep=".") } .cutFilenames <- function(x) { l <- strsplit(x, split=.Platform$file.sep, fixed=TRUE) if (any(lengths(l) == 0)) { return(sprintf(paste0("%0", trunc(log10(length(x))) + 1L, "d"), seq_along(x))) } nCol <- unlist(lapply(l, length)) mCol <- max(nCol) m <- matrix(NA, nrow=length(x), ncol=mCol) for (i in seq(along=l)) { cols <- 1:nCol[i] m[i, cols] <- l[[i]] } isIdentical <- apply(m, 2, function(co)all(co[1] == co)) isIdentical[is.na(isIdentical)] <- FALSE m <- as.matrix(m[, !isIdentical]) if (length(m)) { filenames <- apply(m, 1, function(r) { do.call(file.path, as.list(na.omit(r))) }) } else { filenames <- basename(x) } filenames } .uniqueBaseFilenames <- function(x, fileExtension="csv", sep="_") { filenames <- .cutFilenames(.withoutFileExtension(x)) filenames <- .cleanFilename(filenames) empty <- nchar(filenames) <= 0 filenames[empty] <- seq_along(empty) filenames <- .make.unique(filenames, sep=sep) paste(filenames, fileExtension, sep=".") } ## let make unique start by 1 .make.unique <- function(x, sep="_") { tmp <- lapply(split(x, x), function(y) { n <- length(y) if (n > 1) { fmt <- paste0("%s%s%0", floor(log10(n))+1, "d") y <- sprintf(fmt=fmt, y, sep, 1:n) } y }) unsplit(tmp, x) } MALDIquantForeign/R/importAuto-functions.R0000644000176200001440000000410614161050042020152 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importAuto <- function(path, excludePattern=NULL, removeEmptySpectra=TRUE, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { files <- lapply(importFormats$pattern, .files, path=path, excludePattern=excludePattern) names(files) <- importFormats$type ## test xml files for ciphergen format files$ciphergen <- .testCiphergenXml(files$ciphergen) n <- vapply(files, length, integer(1)) if (all(n)) { stop("Could not detect any supported file type.") } m <- which.max(n) .msg(verbose, n[m], " files of type=", sQuote(importFormats$type[m]), " found.") import(path=files[[m]], type=importFormats$type[m], pattern=importFormats$pattern[m], removeEmptySpectra=removeEmptySpectra, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose, ...) } # test xml for ciphergen format # returns files in ciphergen xml format .testCiphergenXml <- function(files) { ## read first 4 lines of each file l <- lapply(files, readLines, n=4) p <- lapply(l, grepl, pattern="||") s <- vapply(p, sum, integer(1)) isCiphergen <- s >= 2 files[isCiphergen] } MALDIquantForeign/R/filename-methods.R0000644000176200001440000000367514161050042017234 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' This method creates a filename for a \code{\linkS4class{AbstractMassObject}} #' object. #' #' @param x a \code{\linkS4class{AbstractMassObject}} object #' @param fileExtension file type (e.g. "txt", "pdf", ...) #' @return filename #' #' @seealso \code{\linkS4class{AbstractMassObject}} #' @aliases .composeFilename,AbstractMassObject-method #' @aliases .composeFilename,list-method #' @docType methods #' @keywords internal #' @noRd setMethod(f=".composeFilename", signature=signature(x="AbstractMassObject"), definition=function(x, fileExtension="csv") { if (!is.null(metaData(x)$fullName)) { if (length(metaData(x)$fullName) > 1) { filename <- paste0(metaData(x)$fullName, collapse="_") } else { filename <- metaData(x)$fullName } } else { filename <- .withoutFileExtension(metaData(x)$file[1]) } paste(filename, fileExtension, sep=".") }) setMethod(f=".composeFilename", signature=signature(x="list"), definition=function(x, fileExtension="csv") { stopifnot(MALDIquant:::.isMassObjectList(x)) filenames <- unlist(lapply(x, .composeFilename, fileExtension=fileExtension)) .uniqueBaseFilenames(filenames, fileExtension) }) MALDIquantForeign/R/testChecksum-functions.R0000644000176200001440000000246614161050042020460 0ustar liggesusers## Copyright 2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .testChecksum <- function(file, target, algo="sha1", ..., verbose=FALSE) { .msg(verbose, "Calculating ", algo, "-sum for ", sQuote(file), ": ", appendLF=FALSE) fileChecksum <- tolower(digest::digest(file, algo=algo, file=TRUE, ...)) target <- tolower(target) .msg(verbose, fileChecksum) if (fileChecksum != target) { warning("Stored and calculated ", algo, " sums do not match ", "(stored: ", sQuote(target), ", calculated: ", sQuote(fileChecksum), ")!") return(FALSE) } TRUE } MALDIquantForeign/R/download-function.R0000644000176200001440000000343214161050042017434 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .isUrl <- function(x)grepl(pattern="^https?://|^ftp://", x=x) .download <- function(url, destfile, verbose=FALSE, ...) { if (missing(destfile)) { pattern <- paste0(.withoutFileExtension(basename(url)), "_") fileext <- paste0(".", .fileExtension(url)) tmpdir <- file.path(tempdir(), "MALDIquantForeign_download") if (!file.exists(tmpdir)) { dir.create(tmpdir, showWarnings=FALSE, recursive=TRUE) } destfile <- file.path(tmpdir, tempfile(pattern=pattern, tmpdir="", fileext=fileext)) } .msg(verbose, "Downloading ", paste0(url, collapse=", ") , " to ", paste0(destfile, collapse=", "), ".") for (i in seq(along=url)) { if (download.file(url=url[i], destfile=destfile[i], quiet=!verbose, mode="wb", ...)) { warning("Download of ", url[i], " failed!") } } destfile } .cleanupDownloadedTmpFiles <- function() { unlink(file.path(tempdir(), "MALDIquantForeign_download"), recursive=TRUE) } MALDIquantForeign/R/import-functions.R0000644000176200001440000004551114161050077017336 0ustar liggesusers## Copyright 2012-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Import files #' #' This function provides a general interface to import different file formats #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @details #' Specific import functions: #' \tabular{ll}{ #' txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr #' tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr #' fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr #' ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr #' mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr #' analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr #' cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr #' msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr #' } #' #' \code{path}: In addition to the above mentioned file types the #' following (compressed) archives are supported, too: #' zip, tar, tar.gz, tar.bz2, tar.xz. The archives are uncompressed in a #' temporary directory. Afterwards the \code{\link[MALDIquantForeign]{import}} #' function is called (with \code{type="auto"}). #' #' \code{pattern}: Sometimes unusual file extensions are used (e.g. #' \code{"*.xml"} for mzXML files). In this case a specific #' \code{pattern} could be defined to import files with an unusual file #' extension (e.g. \code{pattern="^.*\\.xml$"} to read all \code{*.xml} #' files in a directory; see \code{\link[base]{regexp}} for details). #' #' \code{excludePattern}: Sometimes some files should be excluded. E.g. #' to ignore additional aquired Bruker LIFT spectra #' (MALDI-TOF/TOF; which are not support, yet) you could use #' \code{excludePattern="([[:digit:]\\.]+)LIFT[\\\\/]1SRef"}. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param type \code{character}, file format. If \code{type} is set to #' \dQuote{auto} MALDIquant tries to detect the correct file type #' automatically. It often depends on the file extension #' (if \code{path} is a directory the most represented file extension is used; #' \code{pattern} argument is ignored). #' @param pattern \code{character}, a regular expression to find files in a #' directory (see details). #' @param excludePattern \code{character}, a regular expression to exclude #' files in a directory (see details). #' @param removeEmptySpectra \code{logical}, should empty spectra excluded? #' @param centroided \code{logical}, if \code{centroided=FALSE} (default) #' the data are treated as not centroided and a list of #' \code{\link[MALDIquant]{MassSpectrum-class}} objects is returned. Use #' \code{centroided=TRUE} to assume centroided data and get a list of #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' @param massRange \code{double}, limits of mass import (left/minimal mass, #' right/maximal mass). #' @param minIntensity \code{double}, minimal intensity to import. #' @param mc.cores number of cores to use (default 1; only unix-based platforms #' are supported, see #' \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} for details). #' @param verbose \code{logical}, verbose output? #' @param \ldots arguments to be passed to specific import functions. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import mzXML files #' s <- import(exampleDirectory, type="mzXML") #' #' ## import tab delimited file with different file extension (default: *.tab) #' s <- import(exampleDirectory, type="tab", pattern="^.*\\.txt") #' #' ## import single mzML file #' s <- import(file.path(exampleDirectory, "tiny1.mzML1.1.mzML")) #' #' ## import gzipped csv file #' s <- import(file.path(exampleDirectory, "compressed", "csv1.csv.gz")) #' #' @rdname import-functions #' @export import <- function(path, type="auto", pattern, excludePattern=NULL, removeEmptySpectra=TRUE, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, mc.cores=1L, verbose=interactive(), ...) { ## download file if needed isUrl <- .isUrl(path) if (any(isUrl)) { path[isUrl] <- .download(path[isUrl], verbose=verbose) on.exit(.cleanupDownloadedTmpFiles()) } ## file exists? isReadable <- file.exists(path) & file.access(path, mode=4) == 0 if (any(!isReadable)) { stop(sQuote(path[!isReadable]), " doesn't exist or isn't readable!") } ## uncompress/unpack file if needed isCompressed <- .isPackedOrCompressed(path) if (any(isCompressed)) { path[isCompressed] <- .uncompress(path[isCompressed], verbose=verbose) on.exit(.cleanupUncompressedTmpFiles(), add=TRUE) } ## handle given file type i <- pmatch(tolower(type), c("auto", importFormats$type), nomatch=0, duplicates.ok=FALSE)-1 if (i == -1) { stop("File type ", sQuote(type), " is not supported!") } else if (i == 0) { ## auto detect file type if (!missing(pattern)) { warning("User defined ", sQuote("pattern"), " is ignored in auto-mode.") } return(.importAuto(path=path, excludePattern=excludePattern, removeEmptySpectra=removeEmptySpectra, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose, ...)) } else { ## user-defined file type if (missing(pattern)) { pattern <- importFormats$pattern[i] } handler <- get(importFormats$handler[i], mode="function") s <- unlist(MALDIquant:::.lapply(.files(path=path, pattern=pattern, excludePattern=excludePattern), handler, centroided=centroided, massRange=massRange, minIntensity=minIntensity, mc.cores=mc.cores, verbose=verbose, ...)) if (is.null(s)) { stop("Import failed! Unsupported file type?") } if (removeEmptySpectra) { emptyIdx <- MALDIquant::findEmptyMassObjects(s) if (length(emptyIdx)) { .msg(verbose, "Remove ", length(emptyIdx), " empty spectra.") return(s[-emptyIdx]) } } return(s) } } #' Import text files #' #' This function imports different text file formats #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' \code{importTab}, \code{importTxt} and \code{importCsv} use #' \code{\link[utils]{read.table}} with different defaults. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to \code{\link[utils]{read.table}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[utils]{read.table}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import txt files #' s <- importTxt(exampleDirectory) #' #' ## import csv files #' s <- importCsv(exampleDirectory) #' #' @rdname importTab-functions #' @export importTxt <- function(path, ...) { import(path=path, type="txt", ...) } #' @rdname importTab-functions #' @export importTab <- function(path, ...) { import(path=path, type="tab", ...) } #' @rdname importTab-functions #' @export importCsv <- function(path, ...) { import(path=path, type="csv", ...) } #' Import Bruker Daltonics *flex files #' #' This function imports files in Bruker Daltonics *flex-series file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[readBrukerFlexData]{readBrukerFlexFile}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[readBrukerFlexData]{readBrukerFlexFile}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' s <- importBrukerFlex(exampleDirectory) #' #' @rdname importBrukerFlex-functions #' @export importBrukerFlex <- function(path, ...) { import(path=path, type="fid", ...) } #' Import mzXML files #' #' This function imports files in mzXML file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[readMzXmlData]{readMzXmlFile}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[readMzXmlData]{readMzXmlFile}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/}, \cr #' Definition of \code{mzXML} format: #' \url{http://tools.proteomecenter.org/wiki/index.php?title=Formats:mzXML} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importMzXml(exampleDirectory) #' #' @rdname importMzXml-functions #' @export importMzXml <- function(path, ...) { import(path=path, type="mzxml", ...) } #' Import mzML files #' #' This function imports files in mzML file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/}, \cr #' Definition of \code{mzML} format: #' \url{https://www.psidev.info/mzML} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importMzMl(exampleDirectory) #' #' @rdname importMzMl-functions #' @export importMzMl <- function(path, ...) { import(path=path, type="mzml", ...) } #' Import imzML files #' #' This function imports files in imzML file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param coordinates \code{matrix}, 2 column matrix that contains the x- and #' y-coordinates for spectra that should be imported. Other spectra would be #' ignored. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/}, \cr #' Definition of \code{imzML} format: #' \url{https://ms-imaging.org/imzml/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML")) #' #' ## import only spectra for pixel 1,1 and 2,1 #' s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML"), #' coordinates = cbind(1:2, c(1, 1))) #' #' @rdname importImzMl-functions #' @export importImzMl <- function(path, coordinates=NULL, ...) { import(path=path, type="imzml", coordinates=coordinates, ...) } #' Import Ciphergen XML files #' #' This function imports files in Ciphergen XML file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importCiphergenXml(exampleDirectory) #' #' @rdname importCiphergenXml-functions #' @export importCiphergenXml <- function(path, ...) { import(path=path, type="ciphergen", ...) } #' Import Analyze 7.5 files #' #' This function imports files in Analyze 7.5 file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} \cr #' \url{http://www.grahamwideman.com/gw/brain/analyze/formatdoc.htm}, #' \url{http://eeg.sourceforge.net/ANALYZE75.pdf} #' @rdname importAnalyze-functions #' @export importAnalyze <- function(path, ...) { import(path=path, type="analyze", ...) } #' Import CDF files #' #' This function imports files in NetCDF file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects.\cr #' Please note that the \emph{RNetCDF} is needed. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' if (requireNamespace("RNetCDF", quietly=TRUE)) { #' s <- importCdf(exampleDirectory) #' } else { #' message("You have to install the RNetCDF package to use importCdf.") #' } #' #' @rdname importCdf-functions #' @export importCdf <- function(path, ...) { import(path=path, type="cdf", ...) } #' Import MSD files #' #' This function imports files in mMass MSD file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/}, \cr #' mMass homepage: \url{http://mmass.org/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importMsd(exampleDirectory) #' #' @rdname importMsd-functions #' @export importMsd <- function(path, ...) { import(path=path, type="msd", ...) } MALDIquantForeign/R/importMzMl-functions.R0000644000176200001440000000270014161050042020117 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importMzMl <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } s <- .parseMzMl(file=file, verbose=verbose) lapply(s$spectra, function(x, globalS=s) { m <- modifyList(s$metaData, x$metaData) m$file <- file .createMassObject(mass=x$mass, intensity=x$intensity, snr=x$snr, metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) }) } MALDIquantForeign/R/mzMl-functions.R0000644000176200001440000004253314161050042016734 0ustar liggesusers## Copyright 2013-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeMzMlDocument <- function(x, file, id, encoding="utf-8", imsArgs=list()) { ## stop if file isn't writeable if (file.exists(file) && file.access(file, 2) != 0) { stop("No permissions to write into ", sQuote(file), "!") } if (!MALDIquant:::.isMassObjectList(x)) { stop("Only MALDIquant::MassSpectrum or MALDIquant::MassPeaks objects ", "are supported!") } isIms <- length(imsArgs) ## file handle f <- file(file, open="wt", encoding=encoding) .writeXmlHeader(file=f, encoding=encoding) .writeXmlTag("mzML", attrs=c(xmlns="http://psi.hupo.org/ms/mzml", "xmlns:xsi"="http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation"=paste("http://psi.hupo.org/ms/mzml", "http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd"), id=.sanitize(ifelse(missing(id) || is.null(id), deparse(substitute(x)), id)), version="1.1.0"), close=FALSE, file=f) .writeMzMlCvList(file=f, isIms=isIms) .writeMzMlFileDescription(x, file=f, isIms=isIms, imsArgs=imsArgs) .writeMzMlSoftwareList(x, file=f) if (isIms) { .writeImzMlReferenceableParamGroups(x, file=f) .writeImzMlScanSettings(x, file=f) } .writeMzMlInstrumentConfigurationList(x, file=f) .writeMzMlDataProcessingList(x, file=f) .writeMzMlRun(x, file=f, isIms=isIms) .writeCloseXmlTag("mzML", file=f) invisible(close(f)) } .writeMzMlCvList <- function(file, isIms=FALSE) { items <- list( ms=list(id="MS", fullName="Proteomics Standards Initiative Mass Spectrometry Ontology", version="3.44.0", URI="http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo"), uo=list(id="UO", fullName="Unit Ontology", version="12:10:2012", URI="http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/unit.obo")) if (isIms) { items$imzml <- list(id="IMS", fullName="Imaging MS Ontology", version="0.9.1", URI="http://www.maldi-msi.org/download/imzml/imagingMS.obo") } .writeXmlTag("cvList", attrs=c(count=2), intend=1, close=FALSE, file=file) for (i in seq(along=items)) { .writeXmlTag("cv", attrs=items[[i]], intend=2, file=file) } .writeCloseXmlTag("cvList", intend=1, file=file) } .writeMzMlFileDescription <- function(x, file, isIms=FALSE, imsArgs) { .writeXmlTag("fileDescription", intend=1, close=FALSE, file=file) .writeXmlTag("fileContent", intend=2, close=FALSE, file=file) .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="MS", accession="MS:1000579", name="MS1 spectrum"), file=file) if (isIms) { .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000080", name="universally unique identifier", value=paste0("{", imsArgs$uuid, "}")), file=file) .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000091", name="ibd SHA-1", value=imsArgs$sha1), file=file) if (imsArgs$processed) { .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000031", name="processed"), file=file) } else { .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000030", name="continuous"), file=file) } } .writeXmlTag("userParam", intend=3, attrs=c(name="MALDIquantForeign", value="MALDIquant object(s) exported to mzML"), file=file) .writeCloseXmlTag("fileContent", intend=2, file=file) .writeMzMlSourceFileList(x, file=file) .writeCloseXmlTag("fileDescription", intend=1, file=file) } .writeMzMlSourceFileList <- function(x, file) { files <- unique(unlist(lapply(x, function(s)metaData(s)$file))) if (length(files)) { dname <- dirname(files) bname <- basename(files) ext <- tolower(.fileExtension(bname)) .writeXmlTag("sourceFileList", attrs=c(count=length(files)), intend=2, close=FALSE, file=file) for (i in seq(along=files)) { .writeXmlTag("sourceFile", intend=3, attrs=c(id=paste0("SF", i), location=dname[i], name=bname[i]), close=FALSE, file=file) if (ext[i] == "fid") { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000825", name="Bruker FID file"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000773", name="Bruker FID nativeID format"), file=file) } else if (ext[i] == "mzxml") { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000566", name="ISB mzXML file"), file=file) } else if (ext[i] == "mzml") { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000584", name="mzML file"), file=file) } if (file.exists(files[i])) { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000569", name="SHA-1", value=digest::digest(files[i], algo="sha1", file=TRUE)), file=file) } .writeCloseXmlTag("sourceFile", intend=3, file=file) } .writeCloseXmlTag("sourceFileList", intend=2, file=file) } } .writeMzMlSoftwareList <- function(x, file) { .writeXmlTag("softwareList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("software", intend=2, attrs=c(id="MALDIquantForeign", version=as.character(packageVersion("MALDIquantForeign"))), file=file) .writeCloseXmlTag("softwareList", intend=1, file=file) } .writeMzMlInstrumentConfigurationList <- function(x, file) { .writeXmlTag("instrumentConfigurationList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("instrumentConfiguration", attrs=c(id="IC0"), intend=2, file=file) .writeCloseXmlTag("instrumentConfigurationList", intend=1, file=file) } .writeMzMlDataProcessingList <- function(x, file) { .writeXmlTag("dataProcessingList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("dataProcessing", attrs=c(id="export"), intend=2, close=FALSE, file=file) .writeXmlTag("processingMethod", intend=3, attrs=c(order=1, softwareRef="MALDIquantForeign"), close=FALSE, file=file) .writeXmlTag("userParam", intend=4, attrs=c(name="MALDIquant object(s) exported to mzML", value=""), file=file) .writeCloseXmlTag("processingMethod", intend=3, file=file) .writeCloseXmlTag("dataProcessing", intend=2, file=file) .writeCloseXmlTag("dataProcessingList", intend=1, file=file) } .writeMzMlRun <- function(x, file, isIms=FALSE) { .writeXmlTag("run", attrs=c(id="run0", defaultInstrumentConfigurationRef="IC0"), intend=1, close=FALSE, file=file) .writeMzMlSpectrumList(x, file=file, isIms=isIms) .writeCloseXmlTag("run", intend=1, file=file) } .writeMzMlSpectrumList <- function(x, file, isIms=FALSE) { .writeXmlTag("spectrumList", attrs=c(count=length(x), defaultDataProcessingRef="export"), intend=2, close=FALSE, file=file) for (i in seq(along=x)) { id <- ifelse(is.null(metaData(x[[i]])$id), paste0("scan=", i-1L), metaData(x[[i]])$id) .writeXmlTag("spectrum", intend=3, attrs=c(index=i-1, id=id, defaultArrayLength=length(x[[i]]), spotID=metaData(x[[i]])$fullName), close=FALSE, file=file) msLevel <- ifelse(is.null(metaData(x[[i]])$msLevel), 1, metaData(x[[i]])$msLevel) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000511", name="ms level", value=msLevel), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000294", name="mass spectrum"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000528", name="lowest observed m/z", value=min(mass(x[[i]])), unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000527", name="highest observed m/z", value=max(mass(x[[i]])), unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z"), file=file) if (MALDIquant::isMassSpectrum(x[[i]])) { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000128", name="profile spectrum"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000285", name="total ion current", value=totalIonCurrent(x[[i]])), file=file) } else { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000127", name="centroid spectrum"), file=file) } if (isIms) { .writeImzMlScanList(x[[i]], file=file) .writeImzMlBinaryDataArrayList(x[[i]], file=file) } else { .writeMzMlBinaryDataArrayList(x[[i]], file=file) } .writeCloseXmlTag("spectrum", intend=3, file=file) } .writeCloseXmlTag("spectrumList", intend=2, file=file) } .writeMzMlBinaryDataArrayList <- function(x, file) { count <- ifelse(MALDIquant::isMassSpectrum(x), 2, 3) .writeXmlTag("binaryDataArrayList", attrs=c(count=count), intend=4, close=FALSE, file=file) .writeMzMlBinaryData(mass(x), file=file, c(cvRef="MS", accession="MS:1000514", name="m/z array", unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z")) .writeMzMlBinaryData(intensity(x), file=file, c(cvRef="MS", accession="MS:1000515", name="intensity array", unitCvRef="MS", unitAccession="MS:1000131", unitName="number of counts")) if (MALDIquant::isMassPeaks(x)) { .writeMzMlBinaryData(snr(x), file=file, c(cvRef="MS", accession="MS:1000517", name="signal to noise array")) } .writeCloseXmlTag("binaryDataArrayList", intend=4, file=file) } .writeMzMlBinaryData <- function(x, file, additionalAttrs) { binaryData <- .base64encode(x, size=8, endian="little", compressionType="gzip") .writeXmlTag("binaryDataArray", attrs=c(encodedLength=nchar(binaryData)), intend=5, close=FALSE, file=file) .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="MS", accession="MS:1000574", name="zlib compression")) .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="MS", accession="MS:1000523", name="64-bit float")) if (!missing(additionalAttrs)) { .writeXmlTag("cvParam", attrs=additionalAttrs, intend=6, file=file) } .writeXmlTag("binary", text=binaryData, intend=6, file=file) .writeCloseXmlTag("binaryDataArray", intend=5, file=file) } .writeImzMlReferenceableParamGroups <- function(x, file) { .writeXmlTag("referenceableParamGroupList", attrs=c(count=2), intend=1, close=FALSE, file=file) .writeXmlTag("referenceableParamGroup", attrs=c(id="mzArray"), intend=2, close=FALSE, file=file) .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="MS", accession="MS:1000514", name="m/z array", unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z")) ref <- c("MS", "MS", "IMS") accession <- paste(ref, c(1000576, 1000523, 1000101), sep=":") name <- c("no compression", "64-bit float", "external data") value <- c("", "", "true") for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef=ref[i], accession=accession[i], name=name[i], value=value[i])) } .writeCloseXmlTag("referenceableParamGroup", intend=2, file=file) .writeXmlTag("referenceableParamGroup", attrs=c(id="intensityArray"), intend=2, close=FALSE, file=file) .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="MS", accession="MS:1000515", name="intensity array", unitCvRef="MS", unitAccession="MS:1000131", unitName="number of counts")) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef=ref[i], accession=accession[i], name=name[i], value=value[i])) } .writeCloseXmlTag("referenceableParamGroup", intend=2, file=file) .writeCloseXmlTag("referenceableParamGroupList", intend=1, file=file) } .writeImzMlScanSettings <- function(x, file) { .writeXmlTag("scanSettingsList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("scanSettings", attrs=c(id="scansetting1"), intend=2, close=FALSE, file=file) accession <- paste("IMS", 1000042:1000043, sep=":") name <- paste("max count of pixel", c("x", "y")) value <- unname(metaData(x[[1L]])$imaging$size) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=value[i])) } accession <- paste("IMS", 1000044:1000047, sep=":") name <- c(paste("max dimension", c("x", "y")), paste("pixel size", c("x", "y"))) value <- unname(c(metaData(x[[1L]])$imaging$dim, metaData(x[[1L]])$imaging$pixelSize)) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=value[i], unitCvRef="UO", unitAccession="UO:0000017", unitName="micrometer")) } .writeCloseXmlTag("scanSettings", intend=2, file=file) .writeCloseXmlTag("scanSettingsList", intend=1, file=file) } .writeImzMlScanList <- function(x, file) { .writeXmlTag("scanList", attrs=c(count=1), intend=4, close=FALSE, file=file) .writeXmlTag("scan", intend=5, close=FALSE, file=file) accession <- paste("IMS", 1000050:1000051, sep=":") name <- paste("position", c("x", "y")) value <- unname(metaData(x)$imaging$pos) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=format(value[i], scientific=FALSE))) } .writeCloseXmlTag("scan", intend=5, file=file) .writeCloseXmlTag("scanList", intend=4, file=file) } .writeImzMlBinaryDataArrayList <- function(x, file) { .writeXmlTag("binaryDataArrayList", attrs=c(count=2), intend=4, close=FALSE, file=file) .writeImzMlBinaryData(metaData(x)$imaging$offsets["mass",], file=file, ref="mzArray") .writeImzMlBinaryData(metaData(x)$imaging$offsets["intensity",], file=file, ref="intensityArray") .writeCloseXmlTag("binaryDataArrayList", intend=4, file=file) } .writeImzMlBinaryData <- function(x, file, ref) { .writeXmlTag("binaryDataArray", attrs=c(encodedLength=0), intend=5, close=FALSE, file=file) .writeXmlTag("referenceableParamGroupRef", attrs=c(ref=ref), intend=6, file=file) accession <- paste("IMS", 1000102:1000104, sep=":") name <- paste("external", c("offset", "array length", "encoded length")) value <- unname(x) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=format(value[i], scientific=FALSE))) } .writeXmlTag("binary", intend=6, file=file) .writeCloseXmlTag("binaryDataArray", intend=5, file=file) } MALDIquantForeign/R/list.files-functions.R0000644000176200001440000000337114161050042020066 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .list.files <- function(path, pattern, excludePattern=NULL, recursive=TRUE, ignore.case=TRUE) { files <- list.files(path=path, pattern=pattern, recursive=recursive, ignore.case=ignore.case, full.names=TRUE) if (!is.null(excludePattern)) { isExcluded <- grepl(pattern=excludePattern, x=files, ignore.case=ignore.case) files <- files[!isExcluded] } normalizePath(files) } .files <- function(path, pattern, excludePattern=NULL, ignore.case=TRUE, ...) { isDir <- file.info(path)$isdir files <- normalizePath(path[!isDir]) isMatching <- unlist(regexpr(pattern=pattern, text=basename(files), ignore.case=ignore.case)) != -1 files <- files[isMatching] files <- c(files, .list.files(path=path[isDir], pattern=pattern, excludePattern=excludePattern, ignore.case=ignore.case, ...)) unique(files) } MALDIquantForeign/R/exportMzMl-methods.R0000644000176200001440000000257414161050042017572 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportMzMl", signature=signature(x="MassPeaks"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { .writeMzMlDocument(x=list(x), file=file, id=id, ...) }) setMethod(f=".exportMzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { .writeMzMlDocument(x=list(x), file=file, id=id, ...) }) setMethod(f=".exportMzMl", signature=signature(x="list"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { .writeMzMlDocument(x=x, file=file, id=id, ...) }) MALDIquantForeign/R/importTab-functions.R0000644000176200001440000000533414161050042017754 0ustar liggesusers## Copyright 2012-2020 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importTab <- function(file, centroided=FALSE, massRange=c(0L, Inf), minIntensity=0L, skip=0L, sep=NULL, header=NULL, comment.char="#", encoding="unknown", verbose=FALSE, ...) { text <- readLines(file, encoding=encoding) text <- tail(text, length(text) - skip) text <- text[!startsWith(trimws(text), comment.char)] if (is.null(sep)) { sep <- .autoSep(text) } if (is.null(header)) { header <- .autoHeader(text, sep=sep) } ## load ms file s <- read.table(text=text, header=header, sep=sep, skip=0L, comment.char=comment.char, stringsAsFactors=FALSE, ...) list(.createMassObject(mass=s[, 1L], intensity=s[, 2L], metaData=list(file=file), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } .importCsv <- function(file, centroided=FALSE, massRange=c(0L, Inf), minIntensity=0L, skip=0L, sep=NULL, header=NULL, comment.char="#", encoding="unknown", verbose=FALSE, ...) { .importTab(file=file, centroided=centroided, massRange=massRange, minIntensity=minIntensity, skip=skip, sep=sep, header=header, comment.char=comment.char, encoding=encoding, verbose=verbose, ...) } .autoHeader <- function(text, sep="\t") { l <- gsub(pattern='[\\\\"]*', replacement="", x=text[1L]) l <- strsplit(l, split=sep)[[1L]][1L] !is.numeric(type.convert(l, as.is=TRUE)) } .autoSep <- function(text, sep=c(",", ";", "\t", " ")) { pattern <- paste0(".+", sep, ".+") i <- vapply(pattern, function(x) { g <- gregexpr(pattern=x, text=text[1L])[[1L]] all(g > 0L) & length(g) == 1L }, logical(1L)) if (any(i)) { sep[which(i)[1L]] ## return only first match } else { sep[1L] } } MALDIquantForeign/R/importMsd-functions.R0000644000176200001440000000262214161050042017766 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importMsd <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ## read file s <- .parseMsd(file=file, verbose=verbose) s$metaData$file <- file list(.createMassObject(mass=s$spectrum$mass, intensity=s$spectrum$intensity, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/importBrukerFlex-functions.R0000644000176200001440000000247514161050042021322 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importBrukerFlex <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { s <- readBrukerFlexData::readBrukerFlexFile(fidFile=file, verbose=verbose, ...) list(.createMassObject(mass=s$spectrum$mass, intensity=s$spectrum$intensity, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/parseMsd.R0000644000176200001440000001057014161050042015561 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parse msd files. #' #' This function parses msd files. #' #' @param file \code{character}, path to msd file. #' @param verbose \code{logical}, verbose output? #' #' @return Returns a list with metadata and spectra. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd .parseMsd <- function(file, verbose=FALSE, ...) { XML::xmlEventParse(file=file, handlers=.msdHandlers(fileName=file, verbose=verbose), addContext=FALSE, useTagName=TRUE, useDotNames=TRUE, ...)$getData() } #' Parse msd files. #' #' This function is defines handlers for XML SAX parser. Internal use only. #' #' @param fileName \code{character}, path to msd file #' @param verbose \code{logical}, verbose output? #' #' @return function closure #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references mMass homepage: \url{http://mmass.org/} #' @keywords internal #' @noRd .msdHandlers <- function(fileName, verbose=FALSE) { ## define local variables ## handle different mzXML versions msdVersion <- 0 ## save last opened tag (needed for .text()-processing) text <- character() endian <- "little" precision <- 32 ## build final list xml <- list() xml$metaData <- list() xml$spectrum <- list() ## handlers for specific tags ## mSD mSD <- function(name, attrs) { ## fetch version information msdVersion <<- readMzXmlData:::.grepDouble(attrs["version"]) .msg(verbose, "Found mSD document (version: ", msdVersion, ").") } ## mSD/description/date date <- function(name, attrs) { xml$metaData[["acquisitionDate"]] <<- readMzXmlData:::.attributeToString(attrs, "value") } operator <- function(name, attrs) { xml$metaData[["owner"]] <<- readMzXmlData:::.attributeToString(attrs, "value") } institution <- function(name, attrs) { xml$metaData[[name]] <<- readMzXmlData:::.attributeToString(attrs, "value") } ## mSD/spectrum spectrum <- function(name, attrs) { attributeNames <- c("scanNumber", "msLevel", "retentionTime", "precursorMZ", "precursorCharge", "polarity") attributeNames <- intersect(attributeNames, names(attrs)) for (i in attributeNames) { xml$metaData[[i]] <<- readMzXmlData:::.attributeToDouble(attrs, i) } } ## mSD/spectrum/mzArray mzArray <- function(name, attrs) { precision <<- readMzXmlData:::.attributeToDouble(attrs, "precision") endian <<- readMzXmlData:::.attributeToString(attrs, "endian") } ## default functions to catch tags without a handler .endElement <- function(name, attrs) { if (name == "title") { xml$metaData[c("name", "fullName", "sampleName")] <<- text } else if (name == "notes") { xml$metaData[["comment"]] <<- text } else if (name == "mzArray") { xml$spectrum[["mass"]] <<- .decodeArray() } else if (name == "intArray") { xml$spectrum[["intensity"]] <<- .decodeArray() } text <<- character() } .text <- function(x) { text <<- paste0(text, x) } .decodeArray <- function() { readMzXmlData:::.base64decode(x=text, endian=endian, size=round(precision/8L), compressionType="gzip") } ## return statement (please call getData()) list(getData=function() {return(xml)}, mSD=mSD, date=date, institution=institution, instrument=institution, spectrum=spectrum, mzArray=mzArray, intArray=mzArray, .endElement=.endElement, .text=.text) } MALDIquantForeign/R/parseCiphergenXml.R0000644000176200001440000000545314161050042017427 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parse Ciphergen XML files. #' #' This function parses Ciphergen XML files. #' #' @param file \code{character}, path to Ciphergen XML file #' @param verbose \code{logical}, verbose output? #' #' @return Returns a list with metadata and spectra. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd .parseCiphergenXml <- function(file, ...) { ## metaData listNames <- c("name", "ionSourceVoltage", "digitizerRate", "massCalibrationA", "massCalibrationB", "massCalibrationT0", "massCalibrationInfo", "spotCorrectionFactor") xpath <- paste0("//spectrum/", c("spectrumName", paste0("acquisitionInfo/setting/", listNames[2:3]), paste0("processingParameters/massCalibration/", listNames[-c(1:3)])), "/text()") doc <- xmlParse(file, ...) metaData <- XML::xpathApply(doc=doc, path=xpath, fun=XML::xmlValue) names(metaData) <- listNames metaData[listNames[-c(1, 7)]] <- lapply(metaData[-c(1, 7)], as.double) metaData$file <- normalizePath(file) intensity <- XML::xpathSApply(doc=doc, path="//spectrum/tofData/tofDataSamples/text()", fun=XML::xmlValue) intensity <- as.double(strsplit(intensity, "[[:space:]]+")[[1]]) intensity <- intensity[!is.na(intensity)] ## tof2mass ## mass = U*(A*(tof-t0)^2 + B) ## Calibration formula was taken from: ## https://bioinformatics.mdanderson.org/Supplements/Datasets/KuererQC/scripts.zip ## file: ciphergenXMLreader.pl n <- 0:(length(intensity)-1) time <- metaData$spotCorrectionFactor*n/metaData$digitizerRate tof <- time-metaData$massCalibrationT0 mass <- metaData$ionSourceVoltage * (sign(tof) * metaData$massCalibrationA * tof*tof + metaData$massCalibrationB) list(spectrum=list(mass=mass, intensity=intensity), metaData=metaData) } MALDIquantForeign/R/msg-functions.R0000644000176200001440000000154714161050042016603 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .msg <- function(verbose, ...) { if (verbose) { message(...) } } MALDIquantForeign/R/export-methods.R0000644000176200001440000003610514161050221016766 0ustar liggesusers## Copyright 2012-2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Export files #' #' This function provides a general interface to export #' \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}) #' into different file formats. #' #' @details #' Specific export functions: #' \tabular{ll}{ #' tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr #' msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr #' } #' #' @usage #' \S4method{export}{AbstractMassObject}(x, file, type="auto", force=FALSE, \ldots) #' #' @param x a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a #' \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported. #' @param type \code{character}, file format. If \code{type} is set to #' \dQuote{auto} the file extension is used. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to specific export functions. #' #' @seealso #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[MALDIquant]{MassSpectrum-class}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a single spectrum #' export(s[[1]], file="spectrum.csv") #' ## identical to exportCsv(s[[1]], file="spectrum.csv") #' #' ## export a list of spectra #' export(s, path="spectra", type="csv") #' ## identical to exportCsv(s, path="spectra") #' } #' #' @aliases export export,AbstractMassObject-method export,list-method #' @rdname export-methods #' @docType methods #' @export setMethod(f="export", signature=signature(x="AbstractMassObject"), definition=function(x, file, type="auto", force=FALSE, ...) { .exportToFile(x=x, file=file, type=type, force=force, ...) }) #' @usage #' \S4method{export}{list}(x, path, type, force=FALSE, \ldots) #' @rdname export-methods #' @export setMethod(f="export", signature=signature(x="list"), definition=function(x, path, type, force=FALSE, ...) { stopifnot(MALDIquant:::.isMassObjectList(x)) onefileSupport <- exportFormats$type[exportFormats$onefile] dots <- list(...) if (missing(path) && !is.null(dots$file)) { path <- dots$file dots$file <- NULL } isFile <- !isTRUE(file.info(path)$isdir) && tolower(.fileExtension(path)) %in% onefileSupport if (isFile) { do.call(.exportToFile, modifyList(list(x=x, file=path, type=type, force=force), dots)) } else { do.call(.exportToDir, modifyList(list(x=x, path=path, type=type, force=force), dots)) } }) #' Export to text files #' #' This function exports #' \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}) #' into different text file formats. #' #' @details #' \code{exportTab} and \code{exportCsv} use \code{\link[utils]{write.table}} #' with different defaults (\code{sep="\t"} in \code{exportTab} and #' \code{sep=","} in \code{exportCsv}). #' #' @usage #' \S4method{exportTab}{AbstractMassObject}(x, file, force=FALSE, \ldots) #' #' @param x a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a #' \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to \code{\link[utils]{write.table}}. #' #' @seealso #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[utils]{write.table}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a single spectrum #' exportTab(s[[1]], file="spectrum.tab") #' #' ## export a list of spectra and use ; as separator #' exportCsv(s, path="spectra", sep=";", force=TRUE) #' } #' #' @aliases exportTab exportTab,AbstractMassObject-method exportTab,list-method #' exportCsv exportCsv,AbstractMassObject-method exportCsv,list-method #' @rdname exportTab-methods #' @docType methods #' @export setMethod(f="exportTab", signature=signature(x="AbstractMassObject"), definition=function(x, file, force=FALSE, ...) { export(x, file=file, type="tab", force=force, ...) }) #' @usage #' \S4method{exportTab}{list}(x, path, force=FALSE, \ldots) #' @rdname exportTab-methods #' @export setMethod(f="exportTab", signature=signature(x="list"), definition=function(x, path, force=FALSE, ...) { export(x, path=path, type="tab", force=force, ...) }) #' @usage #' \S4method{exportCsv}{AbstractMassObject}(x, file, force=FALSE, \ldots) #' @rdname exportTab-methods #' @export setMethod(f="exportCsv", signature=signature(x="AbstractMassObject"), definition=function(x, file, force=FALSE, ...) { export(x, file=file, type="csv", force=force, ...) }) #' @usage #' \S4method{exportCsv}{list}(x, path, force=FALSE, \ldots) #' @rdname exportTab-methods #' @export setMethod(f="exportCsv", signature=signature(x="list"), definition=function(x, path, force=FALSE, ...) { export(x, path=path, type="csv", force=force, ...) }) #' Export to MSD files #' #' This function exports #' \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}) #' into mMass MSD files. #' #' @usage #' \S4method{exportMsd}{MassSpectrum}(x, file, force=FALSE, peaks, \ldots) #' #' @param x a \code{\link[MALDIquant]{MassSpectrum-class}} object or a #' \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported. #' @param peaks a \code{\link[MALDIquant]{MassPeaks-class}} object or a #' \code{list} of \code{\link[MALDIquant]{MassPeaks-class}} objects. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to \code{\link[utils]{write.table}}. #' #' @seealso #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[MALDIquant]{MassSpectrum-class}} #' #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/}, \cr #' mMass homepage: \url{http://mmass.org/} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' p <- list(createMassPeaks(mass=4:5, intensity=4:5, snr=1:2), #' createMassPeaks(mass=4:5, intensity=4:5, snr=1:2)) #' #' ## export a single spectrum #' exportMsd(s[[1]], file="spectrum.msd") #' #' ## export a single spectrum with corresponding peaks #' exportMsd(s[[1]], file="spectrum.msd", peaks=p[[1]]) #' #' ## export a list of spectra with corresponding peaks #' exportMsd(s, path="spectra", peaks=p, force=TRUE) #' } #' #' @aliases exportMsd exportMsd,MassSpectrum-method exportMsd,list-method #' @rdname exportMsd-methods #' @docType methods #' @export setMethod(f="exportMsd", signature=signature(x="MassSpectrum"), definition=function(x, file, force=FALSE, peaks, ...) { if (!missing(peaks)) { stopifnot(isMassPeaks(peaks)) export(x, file=file, type="msd", force=force, peaks=peaks, ...) } else { export(x, file=file, type="msd", force=force, ...) } }) #' @usage #' \S4method{exportMsd}{list}(x, path, force=FALSE, peaks, \ldots) #' @rdname exportMsd-methods #' @export setMethod(f="exportMsd", signature=signature(x="list"), definition=function(x, path, force=FALSE, peaks, ...) { stopifnot(isMassSpectrumList(x)) if (!missing(peaks)) { stopifnot(isMassPeaksList(peaks)) export(x, path=path, type="msd", force=force, peaks=peaks, ...) } else { export(x, path=path, type="msd", force=force, ...) } }) #' Export to mzML files #' #' This function exports #' \code{\link[MALDIquant]{MassSpectrum-class}} objects into mzML files. #' #' @usage #' \S4method{exportMzMl}{MassSpectrum}(x, file, force=FALSE, \ldots) #' #' @param x a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a #' \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{MassSpectrum-class}} would be exported. If #' \code{path} is a single filename all spectra will be exported to a single #' mzML file. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to internal functions. #' #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}} #' #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/}, \cr #' HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: #' \url{https://www.psidev.info/mzML} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a single spectrum #' exportMzMl(s[[1]], file="spectrum.mzML") #' #' ## export a list of spectra #' exportMzMl(s, path="spectra.mzML") #' } #' #' @aliases exportMzMl exportMzMl,MassSpectrum-method exportMzMl,list-method #' @rdname exportMzMl-methods #' @docType methods #' @export setMethod(f="exportMzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, force=FALSE, ...) { export(x, file=file, type="mzml", force=force, ...) }) #' @usage #' \S4method{exportMzMl}{list}(x, path, force=FALSE, \ldots) #' @rdname exportMzMl-methods #' @export setMethod(f="exportMzMl", signature=signature(x="list"), definition=function(x, path, force=FALSE, ...) { export(x, path=path, type="mzml", force=force, ...) }) #' Export to imzML files #' #' This function exports #' \code{\link[MALDIquant]{MassSpectrum-class}} objects into imzML files. #' #' @usage #' \S4method{exportImzMl}{MassSpectrum}(x, file, force=FALSE, processed=TRUE, #' coordinates=NULL, pixelSize=c(100, 100), \ldots) #' #' @param x a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a #' \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{MassSpectrum-class}} would be exported. If #' \code{path} is a single filename all spectra will be exported to a single #' imzML file. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param processed \code{logical}, If \code{TRUE} (default) the spectra will #' be saved in processed mode (means mass and intensity is stored for each #' spectra separately in contrast to continuous mode where the mass is stored #' only for one spectrum). #' @param coordinates \code{matrix}, 2 column matrix that contains the x- and #' y-coordinates for the spectra. #' @param pixelSize \code{numeric}, a vector of length 2 that contains the x and #' y pixel size in micrometers (default: \code{c(100, 100)}). #' @param \ldots arguments to be passed to internal functions. #' #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}} #' #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' #' Schramm T, Hester A, Klinkert I, Both J-P, Heeren RMA, Brunelle A, #' Laprevote O, Desbenoit N, Robbe M-F, Stoeckli M, Spengler B, Roempp A #' (2012)\cr #' imzML - A common data format for the flexible exchange and processing of mass #' spectrometry imaging data.\cr #' Journal of Proteomics 75 (16):5106-5110. \cr #' \doi{10.1016/j.jprot.2012.07.026} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a list of spectra #' exportImzMl(s, path="processed.imzML", coordinates=cbind(x=1:2, y=c(1, 1))) #' } #' #' @aliases exportImzMl exportImzMl,MassSpectrum-method exportImzMl,list-method #' @rdname exportImzMl-methods #' @docType methods #' @export setMethod(f="exportImzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), ...) { export(x, file=file, type="imzml", force=force, processed=processed, coordinates=coordinates, pixelSize=pixelSize, ...) }) #' @usage #' \S4method{exportImzMl}{list}(x, path, force=FALSE, processed=TRUE, #' coordinates=NULL, pixelSize=c(100, 100), \ldots) #' @rdname exportImzMl-methods #' @export setMethod(f="exportImzMl", signature=signature(x="list"), definition=function(x, path, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), ...) { export(x, path=path, type="imzml", force=force, processed=processed, coordinates=coordinates, pixelSize=pixelSize, ...) }) MALDIquantForeign/R/parseMzMl.R0000644000176200001440000003054314161050042015717 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parse mzML files. #' #' This function parses mzML files. #' #' @param file \code{character}, path to mzML file #' @param verbose \code{logical}, verbose output? #' #' @return Returns a list with metadata and spectra. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd .parseMzMl <- function(file, verbose=FALSE, ...) { XML::xmlEventParse(file=file, handlers=.mzMlHandlers(fileName=file, verbose=verbose), addContext=FALSE, useTagName=TRUE, useDotNames=TRUE, ...)$getData() } #' Parse mzML files. #' #' This function is defines handlers for XML SAX parser. Internal use only. #' #' TODO: fetch obo map file and use it #' #' @param fileName \code{character}, path to mzML file #' @param verbose \code{logical}, verbose output? #' #' @return function closure #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references #' Definition of \code{mzML} format: #' \url{https://www.psidev.info/mzML} #' @keywords internal #' @noRd .mzMlHandlers <- function(fileName, verbose=FALSE) { ## define local variables ## handle different mzXML versions mzMlVersion <- 0 ## save last opened tag (needed for .text()-processing) openTag <- "" ## store current scan values nSpectra <- 0L curSpecIdx <- 0L curRefId <- character() currentArrayContent <- character() fileCheckSum <- character() ## supported? supported <- TRUE ## build final list xml <- list() xml$metaData <- list() xml$spectra <- list() ## imzML information xml$ims <- list() ## reference values references <- new.env(parent=emptyenv()) ## handlers for specific tags ## mzML mzML <- function(name, attrs) { ## fetch version information mzMlVersion <<- readMzXmlData:::.grepDouble(attrs["xsi:schemaLocation"]) .msg(verbose, "Found mzML document (version: ", mzMlVersion, ").") } ## mzML/referenceableParamGroupList/referenceableParamGroup referenceableParamGroup <- function(name, attrs) { openTag <<- name curRefId <<- readMzXmlData:::.attributeToString(attrs, "id", required=TRUE) } referenceableParamGroupRef <- function(name, attrs) { if (!is.null(references[[attrs["ref"]]])) { xml$spectra[[curSpecIdx]]$metaData <<- modifyList(xml$spectra[[curSpecIdx]]$metaData, references[[attrs["ref"]]]) } } ## mzML/run/spectrumList spectrumList <- function(name, attrs) { ## fetch number of spectra nSpectra <<- readMzXmlData:::.attributeToDouble(attrs, "count", required=TRUE) .msg(verbose, "Found ", nSpectra, " ", ifelse(nSpectra == 1, "spectrum", "spectra"), ".") } ## mzML/run/spectrumList/spectrum spectrum <- function(name, attrs) { openTag <<- name curSpecIdx <<- curSpecIdx + 1 supported <<- TRUE xml$spectra[[curSpecIdx]] <<- list() xml$spectra[[curSpecIdx]]$metaData <<- list() xml$spectra[[curSpecIdx]]$metaData[["id"]] <<- readMzXmlData:::.attributeToString(attrs, "id", required=TRUE) xml$spectra[[curSpecIdx]]$metaData[["numberInFile"]] <<- curSpecIdx ## IMS extension if (length(xml$ims)) { xml$ims$ibd[[curSpecIdx]] <<- matrix(NA, nrow=2, ncol=3, dimnames=list(c("mass", "intensity"), c("offset", "length", "encodedLength"))) xml$spectra[[curSpecIdx]]$metaData$imaging <<- list() } .msg(verbose, "Processing spectrum ", curSpecIdx, "/", nSpectra, " (id: ", attrs["id"], ") ...") } chromatogram <- function(name, attrs) { warning(" tag is not supported!") supported <<- FALSE } ## *cvParam cvParam <- function(name, attrs) { ## polarity if (.isAttrSet(attrs, "MS:1000129", "negative scan")) { .setCvValue("negative", "polarity") return() } else if (.isAttrSet(attrs, "MS:1000130", "positive scan")) { .setCvValue("positive", "polarity") return() } ## ms level if (.isAttrSet(attrs, "MS:1000511", "ms level")) { .setCvValue( readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE), "msLevel") return() } ## centroid data if (.isAttrSet(attrs, "MS:1000127", "centroid spectrum")) { .setCvValue(1, "centroided") return() } ## precision if (.isAttrSet(attrs, "MS:1000521", "32-bit float")) { .setCvValue(32, "precision") return() } else if (.isAttrSet(attrs, "MS:1000523", "64-bit float")) { .setCvValue(64, "precision") return() } ## compression if (.isAttrSet(attrs, "MS:1000576", "no compression")) { .setCvValue("none", "compressionType") return() } else if (.isAttrSet(attrs, "MS:1000574", "zlib compression")) { .setCvValue("gzip", "compressionType") return() } ## data arrays if (.isAttrSet(attrs, "MS:1000514", "m/z array")) { .setCvValue("mass", "currentArray") return() } else if (.isAttrSet(attrs, "MS:1000515", "intensity array")) { .setCvValue("intensity", "currentArray") return() } else if (.isAttrSet(attrs, "MS:1000517", "signal to noise array")) { .setCvValue("snr", "currentArray") return() } else if (.isAttrSet(attrs, "MS:1000786", "non-standard data array")) { .setCvValue("nonstandard", "currentArray") return() } ## IMS extensions if (.isAttrSet(attrs, "IMS:1000080", "universally unique identifier")) { xml$ims$uuid <<- gsub(pattern="[[:punct:]]", replacement="", x=readMzXmlData:::.attributeToString(attrs, "value", required=TRUE)) return() } if (.isAttrSet(attrs, "IMS:1000090", "ibd MD5")) { xml$ims$md5 <<- readMzXmlData:::.attributeToString(attrs, "value") return() } if (.isAttrSet(attrs, "IMS:1000091", "ibd SHA-1")) { xml$ims$sha1 <<- readMzXmlData:::.attributeToString(attrs, "value") return() } if (.isAttrSet(attrs, "IMS:1000030", "continuous")) { xml$ims$type <<- "continuous" return() } if (.isAttrSet(attrs, "IMS:1000031", "processed")) { xml$ims$type <<- "processed" return() } if (.isAttrSet(attrs, "IMS:1000042", "max count of pixel x")) { xml$metaData$imaging$size["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000043", "max count of pixel y")) { xml$metaData$imaging$size["y"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000044", "max dimension x")) { xml$metaData$imaging$dim["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000045", "max dimension y")) { xml$metaData$imaging$dim["y"]<<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000046", "pixel size x")) { xml$metaData$imaging$pixelSize["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000047", "pixel size y")) { xml$metaData$imaging$pixelSize["y"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000050", "position x")) { xml$spectra[[curSpecIdx]]$metaData$imaging$pos["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000051", "position y")) { xml$spectra[[curSpecIdx]]$metaData$imaging$pos["y"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000102", "external offset")) { xml$ims$ibd[[curSpecIdx]][xml$spectra[[curSpecIdx]]$metaData$currentArray, "offset"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000103", "external array length")) { xml$ims$ibd[[curSpecIdx]][xml$spectra[[curSpecIdx]]$metaData$currentArray, "length"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000104", "external encoded length")) { xml$ims$ibd[[curSpecIdx]][xml$spectra[[curSpecIdx]]$metaData$currentArray, "encodedLength"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } } ## default functions to catch tags without a handler .startElement <- function(name, attrs) { openTag <<- name } .endElement <- function(name, attrs) { if (name == "binary" && supported) { .decodeArray() } else if (name == "fileChecksum") { .calculateFileChecksum() } if (openTag == name) { openTag <<- "" } } .text <- function(x) { if (openTag == "binary" && supported) { currentArrayContent <<- paste0(currentArrayContent, x) } else if (openTag == "fileChecksum") { fileCheckSum <<- paste0(fileCheckSum, x) } } ## helper functions .isAttrSet <- function(attrs, id, name) { return(attrs["accession"] == id || attrs["name"] == name) } .setCvValue <- function(x, name) { if (openTag == "referenceableParamGroup") { if (is.null(references[[curRefId]])) { references[[curRefId]] <<- list() } references[[curRefId]][[name]] <<- x } else if (openTag == "spectrum" || openTag == "binaryDataArray") { xml$spectra[[curSpecIdx]]$metaData[[name]] <<- x } else { xml$metaData[[name]] <<- x } } .decodeArray <- function() { if (length(currentArrayContent)) { ## read base64 encoded array content (endian must be "little") content <- readMzXmlData:::.base64decode(x=currentArrayContent, endian="little", size=round(xml$spectra[[curSpecIdx]]$metaData$precision/8), compressionType=xml$spectra[[curSpecIdx]]$metaData$compressionType) xml$spectra[[curSpecIdx]][[xml$spectra[[curSpecIdx]]$metaData$currentArray]] <<- content ## clear array content currentArrayContent <<- character() } ## clear metaData xml$spectra[[curSpecIdx]]$metaData[c("precision", "compressionType", "currentArray")] <<- NULL } .calculateFileChecksum <- function() { n <- nchar(fileCheckSum) if (n <= 0) { return() } ## sha1 sum for this file (from the beginning of the file up to (and ## including) the opening tag .msg(verbose, "Look for '' position ...") ## 14 == nchar("") checkSumPos <- readMzXmlData:::.revfregexpr("", fileName) + 14 .testChecksum(fileName, fileCheckSum, algo="sha1", length=checkSumPos-1, verbose=verbose) } ## return statement (please call getData()) list(getData=function() {return(xml)}, mzML=mzML, referenceableParamGroup=referenceableParamGroup, referenceableParamGroupRef=referenceableParamGroupRef, spectrumList=spectrumList, spectrum=spectrum, chromatogram=chromatogram, cvParam=cvParam, .startElement=.startElement, .endElement=.endElement, .text=.text) } MALDIquantForeign/R/fileFormats.R0000644000176200001440000001000314161050042016245 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Supported file formats #' #' This function prints all file formats supported by #' \code{\link{MALDIquantForeign-package}}. #' #' \subsection{Import}{ #' #' \tabular{ll}{ #' txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr #' tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr #' fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr #' ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr #' mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr #' analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr #' cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr #' msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr #' } #' } #' #' \subsection{Export}{ #' #' \tabular{ll}{ #' tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr #' msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr #' } #' } #' #' @return a \code{list} with two named elements (\code{import} and #' \code{export}) containing a \code{character} vector of supported file types. #' #' @seealso #' \code{\link[MALDIquantForeign]{export}}, #' \code{\link[MALDIquantForeign]{import}} #' @author Sebastian Gibb #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @examples #' library("MALDIquantForeign") #' #' supportedFileFormats() #' #' @rdname supportedFileFormats-functions #' @export supportedFileFormats <- function() { list(import=importFormats$type, export=exportFormats$type) } importFormats <- data.frame(type=c("txt", "tab", "csv", "fid", "ciphergen", "mzxml", "mzml", "imzml", "analyze", "cdf", "msd"), pattern=c("^.*\\.txt$", "^.*\\.tab$", "^.*\\.csv$", "^fid$", "^.*\\.xml$", "^.*\\.mzXML$", "^.*\\.mzML$", "^.*\\.imzML$", "^.*\\.hdr$", "^.*\\.cdf$", "^.*\\.msd$"), handler=c(rep(".importTab", 2), ".importCsv", ".importBrukerFlex", ".importCiphergenXml", ".importMzXml", ".importMzMl", ".importImzMl", ".importAnalyze", ".importCdf", ".importMsd"), stringsAsFactors=FALSE) exportFormats <- data.frame(type=c("tab", "csv", "msd", "mzml", "imzml"), extension=c("tab", "csv", "msd", "mzML", "imzML"), onefile=c(FALSE, FALSE, FALSE, TRUE, TRUE), handler=c(".exportTab", ".exportCsv", ".exportMsd", ".exportMzMl", ".exportImzMl"), stringsAsFactors=FALSE) MALDIquantForeign/R/sanitize-functions.R0000644000176200001440000000171514161050042017640 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .sanitize <- function(x) { x <- gsub(pattern="&", replacement="&", x=x) x <- gsub(pattern="<", replacement="<", x=x) gsub(pattern=">", replacement=">", x=x) } MALDIquantForeign/R/package.R0000644000176200001440000000335514161050042015401 0ustar liggesusers## Copyright 2012-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Import/Export routines for \sQuote{MALDIquant} #' #' This package reads and writes different file formats of mass #' spectrometry data into/from \sQuote{MALDIquant} objects. #' #' \tabular{ll}{ #' Package: \tab MALDIquantForeign \cr #' License: \tab GPL (>= 3)\cr #' URL: \tab https://strimmerlab.github.io/software/maldiquant/\cr #' } #' #' @docType package #' @name MALDIquantForeign-package #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @keywords package #' #' @import MALDIquant #' @import readMzXmlData #' @import methods #' @importFrom base64enc base64encode #' @importFrom digest digest #' @importFrom readBrukerFlexData readBrukerFlexFile #' @importFrom stats na.omit runif #' @importFrom utils download.file modifyList packageVersion read.table tail #' type.convert write.table untar unzip #' @importFrom XML xmlEventParse xmlParse xmlValue xpathApply xpathSApply #' NULL MALDIquantForeign/R/MALDIquantForeign-parallel.R0000644000176200001440000000544714161050042021015 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parallel Support in Package \pkg{MALDIquantForeign} #' #' \code{\link[MALDIquantForeign]{MALDIquantForeign-package}} offers multi-core #' support using \code{\link[parallel]{mclapply}} and #' \code{\link[parallel]{mcmapply}}. This approach is limited to unix-based #' platforms. #' #' Please note that not all import functions benfit from parallelisation. The #' current implementation is limited to run the parallelisation over different #' files. That's why only imports of multiple files could be run on multiple #' cores. E.g. a single mzML file containing 4 spectra would always be #' read on a single core. In contrast 4 mzML files each containing just one #' spectra could be read in using 4 cores. #' #' The improvement in the runtime depends on the amount of data to read, the #' proportion of parsing/decoding of the data, the amount of memory and the #' speed of the hard disk. #' #' Please note: It is possible that using parallelisation results in a worse #' runtime! #' #' @name MALDIquantForeign-parallel #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references \url{https://strimmerlab.github.io/software/maldiquant/} #' @keywords misc #' @seealso #' \code{\link[MALDIquant]{MALDIquant-parallel}}, #' \code{\link[parallel]{mclapply}}, #' \code{\link[parallel]{mcmapply}} #' #' @examples #' ## load packages #' library("MALDIquant") #' library("MALDIquantForeign") #' #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## run single-core import #' print(system.time( #' s1 <- importMzMl(exampleDirectory, centroided=TRUE, verbose=FALSE) #' )) #' #' if(.Platform$OS.type == "unix") { #' ## run multi-core import #' ## (because the example spectra are very small (just 5 data points) the #' ## multi-core solution is slower on most systems) #' print(system.time( #' s2 <- importMzMl(exampleDirectory, centroided=TRUE, mc.cores=2, #' verbose=FALSE) #' )) #' stopifnot(all.equal(s1, s2)) #' } #' @rdname MALDIquantForeign-parallel NULL MALDIquantForeign/R/importAnalyze-functions.R0000644000176200001440000000433614161050042020652 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importAnalyze <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { header <- .readAnalyzeHdr(file, verbose=verbose) mass <- .readAnalyzeMass(.changeFileExtension(file, "t2m"), header=header, verbose=verbose) massRange <- MALDIquant:::.reorderRange(massRange) massIdx <- which(massRange[1] <= mass & mass <= massRange[2]) skip <- c(massIdx[1]-1, length(mass)-massIdx[length(massIdx)]) mass <- mass[massIdx] intensity <- .readAnalyzeIntensity(.changeFileExtension(file, "img"), header=header, ni=length(mass), skip=skip, verbose=verbose) l <- vector(mode="list", length=header$nx*header$ny) for (x in 1:header$nx) { for (y in 1:header$ny) { l[[(x-1)*header$ny+y]] <- .createMassObject(mass=mass, intensity=intensity[, x, y], metaData=list(file=file, imaging=list(pos=c(x=x, y=y), pixelSize=c(x=header$xd, y=header$yd))), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } } l } MALDIquantForeign/R/export-functions.R0000644000176200001440000000504014161050042017326 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .exportToFile <- function(x, file, type="auto", force=FALSE, ...) { if (file.exists(file) && !force) { stop("File already exists! Use ", sQuote("force=TRUE"), " to overwrite it.") } if (missing(type) || pmatch(tolower(type), "auto", nomatch=0, duplicates.ok=FALSE)) { type <- .fileExtension(file) } i <- pmatch(tolower(type), exportFormats$type, nomatch=0, duplicates.ok=FALSE) if (i) { handler <- exportFormats$handler[i] return(do.call(handler, list(x=x, file=file, ...))) } else { stop("File type ", sQuote(type), " is not supported!") } } .exportToDir <- function(x, path, type, force=FALSE, ...) { if (!file.exists(path) && force) { dir.create(path, showWarnings=FALSE, recursive=TRUE) } if (!file.exists(path)) { stop("Directory ", sQuote(path), " doesn't exist!") } if (!file.info(path)$isdir) { stop(sQuote(path), " is no directory!") } ## stop if directory isn't writeable if (file.access(path, 2) != 0) { stop("No permissions to write into ", sQuote(path), "!") } i <- pmatch(tolower(type), exportFormats$type, nomatch=0, duplicates.ok=FALSE) if (i) { filenames <- .composeFilename(x, fileExtension=exportFormats$extension[i]) filenames <- file.path(path, filenames) optArgs <- list(...) peaks <- list() if (hasArg(peaks)) { peaks <- optArgs$peaks optArgs$peaks <- NULL } for (i in seq(along=x)) { arguments <- list(x=x[[i]], file=filenames[i], type=type, force=force) arguments <- modifyList(arguments, optArgs) if (length(peaks)) { arguments$peaks <- peaks[[i]] } do.call(export, arguments) } } else { stop("File type ", sQuote(type), " is not supported!") } invisible() } MALDIquantForeign/R/importCdf-functions.R0000644000176200001440000000535114161050042017741 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' @author Pietro Franceschi \email{pietro.franceschi@@fmach.it}, Sebastian Gibb #' \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd ## original code written by Pietro Franceschi ## modified for MALDIquantForeign by Sebastian Gibb .importCdf <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (!requireNamespace("RNetCDF", quietly=TRUE)) { stop("For netCDF support the ", sQuote("RNetCDF"), " package is needed. \n", "Please install ", sQuote("RNetCDF"), ": install.packages(\"RNetCDF}\")") } nc <- RNetCDF::open.nc(file) on.exit(RNetCDF::close.nc(nc)) scanIndex <- as.integer(RNetCDF::var.get.nc(nc, variable="scan_index")) scanLength <- as.integer(RNetCDF::var.get.nc(nc, variable="point_count")) retentionTime <- as.double(RNetCDF::var.get.nc(nc, variable="scan_acquisition_time")) ## read and process the spectra/peaks l <- vector(mode="list", length=length(scanIndex)) for (i in seq(along=l)) { mass <- as.double(RNetCDF::var.get.nc(nc, variable="mass_values", start=scanIndex[i]+1L, count=scanLength[i])) intensity <- as.double(RNetCDF::var.get.nc(nc, variable="intensity_values", start=scanIndex[i]+1L, count=scanLength[i])) l[[i]] <- .createMassObject(mass=mass, intensity=intensity, metaData=list(file=file, number=i, retentionTime=retentionTime[i], scanIndex=scanIndex[i]), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } l } MALDIquantForeign/R/uuid-functions.R0000644000176200001440000000407514161050042016762 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see ## generate uuid needed for imzML idb files ## based on dplR::uuid.gen by Mikko Korpela ## should be compatible to: ## https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 ## @param init used to create the md5 string, just for testing; don't change the ## default in other use cases. ## @return uuid string ## @noRd .uuid <- function(init=paste(c(Sys.info(), Sys.getpid(), unlist(R.version), Sys.getpid(), format(Sys.time(), "%Y%m%d%H%M%OS6 %Z"), runif(5L)), collapse = "")) { md5 <- digest::digest(init, algo="md5", serialize=FALSE) md5 <- strsplit(md5, "", fixed=TRUE)[[1L]] md5[13] <- "4" md5[17] <- c("8", "9", "a", "b")[strtoi(md5[17L], base=16L)%%4L + 1L] .paste0 <- function(...)paste0(..., collapse="") paste(.paste0(md5[1L:8L]), .paste0(md5[9L:12L]), .paste0(md5[13L:16L]), .paste0(md5[17L:20L]), .paste0(md5[21L:32L]), sep="-") } ## test uuid version 4 ## @param x character vector to test ## @return logical ## @noRd .isUuidV4 <- function(x) { grepl(paste0("^[0-9a-f]{8}-?", "[0-9a-f]{4}-?", "4[0-9a-f]{3}-?", "[89ab][0-9a-f]{3}-?", "[0-9a-f]{12}"), tolower(x)) } MALDIquantForeign/R/importMzXml-functions.R0000644000176200001440000000303514161050042020311 0ustar liggesusers## Copyright 2012-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importMzXml <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { l <- readMzXmlData:::.readMzXmlFile(mzXmlFile=file, verbose=verbose, ...) lapply(l, function(x).createMassObject(mass=x$spectrum$mass, intensity=x$spectrum$intensity, snr=x$spectrum$snr, metaData=x$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/MD50000644000176200001440000001643714165370672014021 0ustar liggesusers28838347cb2787ed2e166694f1ba0893 *DESCRIPTION 239f2ca23dfb8e6e1c412d77e5fef820 *NAMESPACE 7af610e86a93241bed2eb274ba17f5e2 *NEWS 468e3370a3294e48758e68bf44eb407f *R/AllGenerics.R cb42459b9b046fee4667dec625d0cfa6 *R/MALDIquantForeign-parallel.R f9b1350a757c7834f31ca532d25d1de5 *R/analyze-functions.R 1b58692832033443e81536a702fd1851 *R/base64encode-functions.R 5eded2dfa5ab6f30adab3b5f91bc46aa *R/compression-functions.R edbb6f3bcba17838f335546d6c697bf1 *R/createMassObject-functions.R 7142580c95b7bb81548ec28a1f57a757 *R/download-function.R 3732160f3b60f23d42531b5613c0282a *R/export-functions.R 8788d9f89ed9587f28956575ca68f38e *R/export-methods.R 8e81b2f07b5ebca91079b77b11da0c65 *R/exportImzMl-methods.R d3fd02920e121a29e811d24dce0783b3 *R/exportMsd-methods.R 48a24d1dbab2f9d192a5e031d61e86af *R/exportMzMl-methods.R 6e1fd732f6c0ec57aa1f09f089068a8e *R/exportTab-methods.R 781eb5c45c622bfa78d81c7f28170b42 *R/fileFormats.R 9b2c039ff63220f1d8f2406aec505578 *R/filename-functions.R 577b0fabac835a12bbe5e57a219380f1 *R/filename-methods.R 4fef02cb2ff00e5602946fcd2b37454b *R/ibd-functions.R 41c2fa66a2d0eac2049dd07daf653b63 *R/import-functions.R 3371975060c82b5119a62c8c7579bc8c *R/importAnalyze-functions.R ed4770aec8f1ea4c60650efe0ff348f0 *R/importAuto-functions.R c06d3b011a012c10d4bb3b3f32b873a2 *R/importBrukerFlex-functions.R 991cd23737589302cfbf572bd310db16 *R/importCdf-functions.R d3dd95ff9db890c5c1d83b60502126d2 *R/importCiphergenXml-functions.R 5586b113fbb7f48486109fa3873804be *R/importImzMl-functions.R 34ecdc5f98b4a2c63917e28fa9667f69 *R/importMsd-functions.R 4e240d8c0feda7e3e4ccf8c33b65a638 *R/importMzMl-functions.R 291368ca35bc6754d0df2b33b72927fc *R/importMzXml-functions.R d92ab30da765f0d80987a3477b92fa74 *R/importTab-functions.R 3954121f5eee0b570cb941c93f5f5282 *R/imzMl-functions.R 70de7be37f0efc823649222aa7e700e8 *R/list.files-functions.R e5d102e802ed4fd8f4ee4cc1979a4c3e *R/msd-functions.R f19d21cfff588c1025ce88d1cd237426 *R/msg-functions.R d851edfeaf58521dc72cd3913e64bd30 *R/mzMl-functions.R d8fe5fb6af02a3458170a93157d5b2dd *R/package.R cdc0028d88e43ac7fef5d9b0ee0a2dcb *R/parseCiphergenXml.R 76f9f0f45f43a0fee5527580d08afcb6 *R/parseMsd.R 230f437d9b1bb85466689fe8b11b9d7a *R/parseMzMl.R d4f6dc7b3fcac7a645b9ededbe1f7725 *R/sanitize-functions.R 44d338127260829b963160af58e3bdf7 *R/testChecksum-functions.R 0c89faab57ee2bd013c2d19cbbbcb453 *R/uuid-functions.R 9bd11f78213543c6d61423efa00cdb23 *R/xml-functions.R f51f2da41b458c612fea76744802b23f *build/partial.rdb c2eff45f9af049e6e1eed616f4db400e *build/vignette.rds 52c2cb8ccc8897b4ce122bb81377b9b0 *inst/doc/MALDIquantForeign-intro.R fa3507f704915074f42215d1a7acaf19 *inst/doc/MALDIquantForeign-intro.Rnw dc581fbf32820844e6aa70ba792644a1 *inst/doc/MALDIquantForeign-intro.pdf 9274dd34d675950326a222a952309a17 *inst/exampledata/ascii.txt 85077ca13692b5a2469af51d18cffd64 *inst/exampledata/brukerflex/0_A1/1/1SLin/acqu fe054ad2e7b98bee673f9ff22d50f00c *inst/exampledata/brukerflex/0_A1/1/1SLin/fid 10e9d68aa23b1d7b85688a969be41897 *inst/exampledata/ciphergen/tiny.xml 4b725014b8cacf380e44475b95905d7d *inst/exampledata/compressed/csv.tar.gz c449fa2a93410566dba5e145ed09b0ae *inst/exampledata/compressed/csv.zip 448976240c5d1caccd3d2fe3a8c04e7e *inst/exampledata/compressed/csv1.csv.gz 4ca88a472371bd1e63d57987c06c4c43 *inst/exampledata/csv1.csv 4b2a03f6bbe5747bd50273be357533c1 *inst/exampledata/csv2.csv 90838531af29160ed4d7917edd7dbc4c *inst/exampledata/tiny.cdf 064e9a9a06250b5a29593ca23c592891 *inst/exampledata/tiny1-centroided.mzML1.1.mzML b2bc5ad00c449401ae4495677673af0a *inst/exampledata/tiny1-centroided.mzXML3.0.mzXML 4cabaefc8fe6d8f1bd0f55a9ba06e763 *inst/exampledata/tiny1-compressed.mzML1.1.mzML 09be2b7fff0d1834938d4aebaab4761c *inst/exampledata/tiny1-compressed.mzXML3.0.mzXML e06173e88f17386b359e124f8a33e758 *inst/exampledata/tiny1.msd 489b1be67d30d175969dbb66f8bcb9b7 *inst/exampledata/tiny1.mzML1.1.mzML 3b8bd26f7fc636e57388d52b3f9f3eb7 *inst/exampledata/tiny1.mzXML3.0.mzXML dcd657ee36f05b2b7be19f4db23184a4 *inst/exampledata/tiny_continuous.ibd 2decd26e6ba4ee132ab91fbe21125390 *inst/exampledata/tiny_continuous.imzML 1bcd45de54f0180c38afceb468371971 *inst/exampledata/tiny_processed.ibd ff2f70b3f12cb3cdafdcbe81b856a3ed *inst/exampledata/tiny_processed.imzML 2135cf08aee7372bb94f2d8751390022 *man/MALDIquantForeign-package.Rd 88ad938fdbfb2b78ae7952182b3b156f *man/MALDIquantForeign-parallel.Rd 6de4e4e3f192010756eabc50c291753e *man/base64-encode.Rd 0fb40e9f5596930a603e9586d4b86a5f *man/export-methods.Rd a3ebe853172535c0b79a498e51bc87b8 *man/exportImzMl-methods.Rd f31b03d8e523f36d9aa3d5b0a989f486 *man/exportMsd-methods.Rd ff72c29bf9eb1cb7420ceb7560541251 *man/exportMzMl-methods.Rd 8e9ba98d9189ee13a0314fc03db5120c *man/exportTab-methods.Rd 0a2ef3fda9ad3e4845f8ce264ee960f6 *man/import-functions.Rd a6ab255c989ba7e0b8f64afa8ba7d0a5 *man/importAnalyze-functions.Rd 438a331c57aecdcb4edc692ed912833f *man/importBrukerFlex-functions.Rd ad4373d5a94c132402c9d1e8036ee327 *man/importCdf-functions.Rd 349b2edbae5b3fe5cc7d0487c9f9c624 *man/importCiphergenXml-functions.Rd 9bf9c2d1e269fa2813979a634ccdd2ad *man/importImzMl-functions.Rd 56fb8de96fd5fe42cb00a58e8629dd8b *man/importMsd-functions.Rd 2cfa83d2b5706d0921683c2b9ae46a3f *man/importMzMl-functions.Rd 9fce880a92858b413e869f9fbc04d4e6 *man/importMzXml-functions.Rd 2dd21b28cb0ca9530fe8d3e01d3d0b91 *man/importTab-functions.Rd abd990e4b75d7356cb1b9442e35f9325 *man/supportedFileFormats-functions.Rd f743796f136a436364c76e6b0f83d474 *tests/testthat.R b798ecbef464ea1807946fa217445894 *tests/testthat/test_compression-functions.R 0857bc348532e96bcfd91f7ae4d0475d *tests/testthat/test_createMassObject-functions.R debeabc712adc81b15966652fc9be840 *tests/testthat/test_download-functions.R e74111e7717d26f7790b4f8a1709213d *tests/testthat/test_exportImzMl-methods.R 208ec10c169824675066ec8cb037aa54 *tests/testthat/test_exportMsd-methods.R bda24926bda8ba196607439c40bc8a0f *tests/testthat/test_exportMzMl-methods.R bc154ef954d4012596f14aeeb9f9d90a *tests/testthat/test_exportTab-methods.R c0c445cb3dc0146a53ed5c7cb4326467 *tests/testthat/test_fileFormats.R 4c794d2aa272d40186b93e7d19ab3d25 *tests/testthat/test_filename-functions.R 2c30aa4314b05352630a6a9a74578475 *tests/testthat/test_ibd-functions.R 84ac426570d99e3a3e4639013b4ca6b7 *tests/testthat/test_importBrukerFlex-functions.R 071c254f1a0870eb09163742840ee3eb *tests/testthat/test_importCdf-functions.R 8432026fd0ec2a342cfe9c6f23dc21ca *tests/testthat/test_importCiphergenXml-functions.R 17ea5917b8dbc97de2d1214e0391acb8 *tests/testthat/test_importImzMl-functions.R 688f77adbcefb49f0910338a8fbff29e *tests/testthat/test_importMsd-functions.R de7de747a128ba1c30656b7b3d663edd *tests/testthat/test_importMzMl-functions.R 107cb57fff1e06e1619d810443734b90 *tests/testthat/test_importMzXml-functions.R 79de24105faaba91da6564d64f8d89ee *tests/testthat/test_importTab-functions.R 683c710df52b1d3218ba8e708943b15b *tests/testthat/test_list.files-functions.R 33be42ee6c030ad06a3b25898995fa63 *tests/testthat/test_msg-functions.R c0ef452eab581e6b3f15b30f0101481f *tests/testthat/test_mzMl-functions.R 62f4062ce2e6a8e8bb3aacefded07bf0 *tests/testthat/test_sanitize-functions.R c107102debc5d24e6096c38dde9199fc *tests/testthat/test_testChecksum-functions.R 09171eb807444e4b40e76a31edec4eec *tests/testthat/test_uuid-functions.R fa3507f704915074f42215d1a7acaf19 *vignettes/MALDIquantForeign-intro.Rnw dcdcd775ae2bcfb2aea05af8e6921bef *vignettes/bibliography.bib MALDIquantForeign/inst/0000755000176200001440000000000014165366321014447 5ustar liggesusersMALDIquantForeign/inst/doc/0000755000176200001440000000000014165366321015214 5ustar liggesusersMALDIquantForeign/inst/doc/MALDIquantForeign-intro.Rnw0000644000176200001440000001370413211235236022242 0ustar liggesusers%\VignetteEngine{knitr} %\VignetteIndexEntry{MALDIquantForeign: Import/Export routines for MALDIquant} %\VignetteKeywords{Bioinformatics, Proteomics, Mass Spectrometry} %\VignettePackage{MALDIquantForeign} \documentclass[12pt]{article} \usepackage{natbib} \usepackage{hyperref} \usepackage{tikz} \usepackage{bibentry} % inline bibentries \nobibliography* % no special bibliography for bibentry \newcommand{\R}{\texttt{R}} \newcommand{\CRAN}{\texttt{CRAN}} \newcommand{\Rfunction}[1]{{\texttt{#1}}} \newcommand{\Robject}[1]{{\texttt{#1}}} \newcommand{\Rpackage}[1]{{\texttt{#1}}} \newcommand{\Mq}{\Rpackage{MALDIquant}} \newcommand{\MqF}{\Rpackage{MALDIquantForeign}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \title{\MqF{}: Import/Export routines for \Mq{}} \author{ Sebastian Gibb% \thanks{\email{mail@sebastiangibb.de}} } \date{\today} \begin{document} <>= library("knitr") opts_chunk$set(tidy.opts=list(width.cutoff=45), tidy=FALSE, fig.align="center", fig.height=4.25, comment=NA, prompt=TRUE) @ <>= suppressPackageStartupMessages(library("MALDIquant")) suppressPackageStartupMessages(library("MALDIquantForeign")) @ \maketitle \begin{abstract} \MqF{} provides routines for importing/exporting different file formats into/from \Mq{}.\\ This vignette describes the usage of the \MqF{} package. \end{abstract} \clearpage \tableofcontents \section*{Foreword} \MqF{} is free and open source software for the \R{} \citep{RPROJECT} environment and under active development. If you use it, please support the project by citing it in publications: \begin{quote} \bibentry{MALDIquant} \end{quote} If you have any questions, bugs, or suggestions do not hesitate to contact me (\email{mail@sebastiangibb.de}). \\ Please visit \url{http://strimmerlab.org/software/maldiquant/}. \section{Introduction} \Mq{} should be device and platform independent. That's why it has not any import/export functions. \\ \MqF{} fills this gap and provides import/export routines for various file formats: <>= supportedFileFormats() @ \section{Setup} After starting \R{} we could install \Mq{} and \MqF{} directly from \CRAN{} using \Rfunction{install.packages}: <>= install.packages(c("MALDIquant", "MALDIquantForeign")) @ Before we can use \Mq{} and \MqF{} we have to load the packages. <>= library("MALDIquant") library("MALDIquantForeign") @ \section{Import} \MqF{} provides an \Rfunction{import} function that tries to auto-detect the correct file type. Because this would never be perfect \MqF{} offers also many \Rfunction{import*} functions like \Rfunction{importBrukerFlex}, \Rfunction{importMzMl}, etc. Please see the manual page of \Rfunction{import} for a complete list (\Rfunction{?import}).\\ First we try to import some example data in Bruker Daltonics *flex-series file format using the \Rfunction{import} function. <>= ## get the example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") spectra <- import(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ Next we use the \Rfunction{importBrukerFlex} function (the result is the same as above). <>= spectra <- importBrukerFlex(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ \MqF{} supports compressed files, too (\emph{zip}, \emph{tar.\{bz2, gz,xz\}}). <>= spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.tar.gz"), verbose=FALSE) spectra[[1]] spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.zip"), verbose=FALSE) spectra[[1]] @ Remote files are supported as well. Data are taken from \citet{Tan2006}. <>= spectra <- import(paste0("http://www.meb.ki.se/", "~yudpaw/papers/spikein_xml.zip"), centroided=FALSE, verbose=TRUE) @ If you want to read peak lists (centroided data) instead of spectra data you have to set \Rfunction{centroided=TRUE}. <>= peaks <- import(file.path(exampleDirectory, "ascii.txt"), centroided=TRUE, verbose=FALSE) peaks @ \section{Export} The export routines in \MqF{} are very similar to the import routines. Please see manual page of \Rfunction{export} for a complete list of supported export routines (\Rfunction{?export}). First we create a simple list of \Robject{MassSpectrum} objects using \Rfunction{createMassSpectrum}. <>= spectra <- list( createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) @ Now we want to export the first spectrum into a CSV file. <>= export(spectra[[1]], file="spectrum1.csv") import("spectrum1.csv") @ Exporting every file by hand is cumbersome. We want to export the whole list of spectra. Instead of \Robject{file} we use \Robject{path} now to specify a directory. Please note that we have to add the file type/format information now (we can use the \Robject{type} argument or the corresponding \Rfunction{export*} function). If the path doesn't exists we will get an error. To force \Rfunction{export} to create/overwrite the given path, we set the argument \Robject{force=TRUE}. <>= export(spectra, type="csv", path="spectra", force=TRUE) list.files("spectra") @ \section{Analyse Mass Spectrometry Data} Please have a look at the corresponding vignette shipped with \Mq{} and the \Mq{} website: \url{http://strimmerlab.org/software/maldiquant/}. <>= vignette(topic="MALDIquant", package="MALDIquant") @ \section{Session Information} <>= toLatex(sessionInfo(), locale=FALSE) @ \bibliographystyle{apalike} \bibliography{bibliography} \end{document} MALDIquantForeign/inst/doc/MALDIquantForeign-intro.pdf0000644000176200001440000040707714165366321022270 0ustar liggesusers%PDF-1.5 % 33 0 obj << /Length 606 /Filter /FlateDecode >> st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~"X5.<`/xxs[y{5n<."Q"vQEFwlBZ %la$tUn-\h1E$JM=m.E{&'ZLiOi;C^Nwf}-XZVVXbeժZ;zG.,k#114^[N/_lD :D(# AILNA9cT"BJyԪh^+-_azr6u6Ybj5˥$J6"_l:,DgGCt(婷mqvqb{(cq\E]R9Q)bJ擱MA!(fA!Xe (1H-N) )Mh/0Hs9W6q fe !ČQy|O9aRhXdIJ@s`EV[\4_N(B.Y_jO]ތ*2Lġ͚j>s ?碆wn~Q](EqM:<};Mj7"ayra2`+X0A¸Ȍ4wSP!70'cZMWչWbVY כsTkavwi룻/p (m_J[ _a'r e%iPᨄwҎ6Aa|t^b^LV2(Yd ֮NlQ%]]ZD4<*" tnV)6AI.y?ey#όZUMGڈUtg`ۼ5ɮy.SI8;[.r^՝Ć\4|ɟ9P}WPRTd1}Y"]zlN!4i.4{/y ȕ9XMcs> stream xuRn0+xSrs\hCZ զUѢ衿ޥV6$Hpv9 '?rqQ c$)rf&L꜔@?%]ebuUGnB_kywby!=#pZzjHOtmEwC5~fWmF $\2n34:CqF/We%V_M|o;1Y$AQB"f+>{Buc?tz5LYKR yrh 4;Omp|XF/ѭMtS~2?vO`U3;3zTA7>{5/JsڹLL=":GX}1f޾P~,QEqܵ^Q5ͷMW\׿+sZ[t |߿FayRFDa#T @TL"c^Ԭ?\p endstream endobj 98 0 obj << /Length 161 /Filter /FlateDecode >> stream x337U0P0U0S01CB.c I$r9yr\`W4K)YKE!P E? 00(?;h0a$>z A?$h LF N8\ù\=Y endstream endobj 106 0 obj << /Length 136 /Filter /FlateDecode >> stream x363P0P0Q0R0P02WH1*22(%s<=\ %E\N \. ц \.  (燅w`?C "@q,P P%^.WO@. ) endstream endobj 113 0 obj << /Length 163 /Filter /FlateDecode >> stream x3135R0P0U0V06W0TH1*26(%s< =\ %E\N @QhX.O8qs憺 ꛛn 10`` 6P $RR  2d>@nr ED endstream endobj 120 0 obj << /Length1 1456 /Length2 8518 /Length3 0 /Length 9499 /Filter /FlateDecode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ps8tڿ]zJZgØ7'KΘ-IUzce˒ /Y ĴXycƦnilTʤ&ͳۜJmPcc"^s>CS䇲O,ErKix(S\A9 pG*:sR۬|CܡGMܗ\ <993263E0A9E063F779ADC6CE50A430D6>] /Length 374 /Filter /FlateDecode >> stream x%7RC16&lI&L9s0j܃pn@n~IIODM ̂ .  MALDIquantForeign/inst/exampledata/compressed/0000755000176200001440000000000013341755345021103 5ustar liggesusersMALDIquantForeign/inst/exampledata/compressed/csv1.csv.gz0000644000176200001440000000012113341751101023067 0ustar liggesusersA҇[csv1.csvSVHRVHJ,RM,.VQ+I+,T21212ֱ2ѱ214'4MALDIquantForeign/inst/exampledata/compressed/csv.tar.gz0000644000176200001440000000026013341755345023023 0ustar liggesusersڇ[csv.tarν 0̹AST` M{+"S}ӗ*6dW)G6|JA8z>Daw) er)5/J2t1OQy"9:Le7-IroZAs8+ O(MALDIquantForeign/inst/exampledata/compressed/csv.zip0000644000176200001440000000033213341755332022414 0ustar liggesusersPK nM'44csv1.csvUT ڇ[ڇ[ux # foo # bar "mass","intensity" 1,6 2,7 3,8 4,9 5,10 PK nM'44csv1.csvUTڇ[ux PKNvMALDIquantForeign/inst/exampledata/tiny1.mzML1.1.mzML0000644000176200001440000000673013211235236021674 0ustar liggesusers AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/tiny1-centroided.mzML1.1.mzML0000644000176200001440000000753213211235236024013 0ustar liggesusers AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/ascii.txt0000644000176200001440000000002513211235236020551 0ustar liggesusers1 6 2 7 3 8 4 9 5 10 MALDIquantForeign/inst/exampledata/tiny_processed.imzML0000644000176200001440000001235413211235236022734 0ustar liggesusers MALDIquantForeign/inst/exampledata/tiny1-compressed.mzXML3.0.mzXML0000644000176200001440000000304413211235236024312 0ustar liggesusers eJyz/8AABg4SUJoBSstAaQ4orQClBaC0EpQWgdIqEBoA0joENg== 0 0 7e7ef0ea030f6a56d34a4ebd446e22b22844d432 MALDIquantForeign/inst/exampledata/tiny1.msd0000644000176200001440000000106713211235236020500 0ustar liggesusers tiny eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== MALDIquantForeign/inst/exampledata/csv2.csv0000644000176200001440000000002513211235236020312 0ustar liggesusers1;6 2;7 3;8 4;9 5;10 MALDIquantForeign/inst/exampledata/tiny.cdf0000644000176200001440000000071413211235236020366 0ustar liggesusersCDF  scan_number point_number  scan_index4 point_count<scan_acquisition_timeD mass_valuesTintensity_values\?@? @ @ @@@@@ @"@$MALDIquantForeign/inst/exampledata/csv1.csv0000644000176200001440000000006413341754745020333 0ustar liggesusers# foo # bar "mass","intensity" 1,6 2,7 3,8 4,9 5,10 MALDIquantForeign/inst/exampledata/tiny1-compressed.mzML1.1.mzML0000644000176200001440000000665413211235236024043 0ustar liggesusers eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYAABFQcwxaAEpRWgtAyUlnAAACEsAds= MALDIquantForeign/inst/exampledata/tiny_continuous.ibd0000644000176200001440000000021013211235236022645 0ustar liggesusers4VxLޯ4Vx?@@@@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/brukerflex/0000755000176200001440000000000013211235236021074 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/0000755000176200001440000000000013211235236021554 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/0000755000176200001440000000000013211235236021714 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/0000755000176200001440000000000013211235236022642 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/acqu0000644000176200001440000000071113211235236023515 0ustar liggesusers##.SPECTROMETER TYPE= TOF ##.IONIZATION MODE= LD+ ##$AQOP_m= 0 ##$BYTORDA= 0 ##$CMT1= TESTSAMPLE1 ##$CMT2= TESTSAMPLE2 ##$CMT3= TESTSAMPLE3 ##$CMT4= TESTSAMPLE4 ##$DELAY= 10000 ##$DW= 20 ##$HPClBHi= 0 ##$HPClBLo= 0 ##$HPClOrd= 0 ##$HPClUse= no ##$Lift1= 0 ##$Lift2= 0 ##$ML1= 2400000 ##$ML1_raw= 2400000 ##$ML2= 280 ##$ML2_raw= 280 ##$ML3= -0.0013 ##$ML3_raw= -0.0013 ##$NoSHOTS= 100 ##$SPType= 0 ##$TD= 5 ##$TLift= 0 MALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/fid0000644000176200001440000000002413211235236023323 0ustar liggesusersMALDIquantForeign/inst/exampledata/tiny1-centroided.mzXML3.0.mzXML0000644000176200001440000000316613211235236024273 0ustar liggesusers P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 1cf2b3695447d2dd698b465e27f452a80192dd62 MALDIquantForeign/inst/exampledata/tiny1.mzXML3.0.mzXML0000644000176200001440000000313413211235236022150 0ustar liggesusers P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 b87b09a4f34561d5572f9a6d30056106f819bc69 MALDIquantForeign/inst/exampledata/ciphergen/0000755000176200001440000000000013211235236020667 5ustar liggesusersMALDIquantForeign/inst/exampledata/ciphergen/tiny.xml0000644000176200001440000000153513211235236022400 0ustar liggesusers tiny example 20000 2.5e+008 Quadratic 24000000 0.0013 0 20000 hand made 1 false 1 2 3 4 5