MALDIquantForeign/0000755000175000017500000000000012372215747015005 5ustar sebastiansebastianMALDIquantForeign/MD50000644000175000017500000001460312372215747015321 0ustar sebastiansebastian917242f9a9d9c580574c2fcecaede055 *DESCRIPTION 9e171c48506bc9172ce35f1870d4ac27 *NAMESPACE 4144383be5933a2fa093a98ee2c3d942 *NEWS 2909cdfd48e0a659215fb823fb4ee6a0 *R/AllGenerics.R a13a16884fe8b67b86884268c6f22fb8 *R/analyze-functions.R d8112fff8aa9c294f320fe85a5f16a1e *R/base64encode-functions.R 56ff0561b408289ff72ba9159627c70e *R/compression-functions.R d3a7ab6584f3433b686346a6f8105317 *R/createMassObject-functions.R 963126ae68feaf16644682cd5b754ac4 *R/download-function.R 9dd9d7d23b59bce7b233cc787b191768 *R/export-functions.R 5ff8c272c9f8ce58cf2783e052f7ec05 *R/export-methods.R 199f16e5d272ac2d60c571389e64cb7c *R/exportMsd-methods.R f73f4cc76e62d9a94c75196d9c51a32b *R/exportMzMl-methods.R 7240fda493581d8f8bf10ea95b236862 *R/exportTab-methods.R de7b3834d17bdf67e231b7a8ed48dd05 *R/fileFormats.R 8f6abf32d257b78dc7152fe0e8f5f9c8 *R/filename-functions.R d8ebaf9ac00edb4643516b10369d55be *R/filename-methods.R b32467e39aed7d5d32f06c8bcc59c761 *R/import-functions.R 3e6fdfd6bc3ebac11d59bcda592e5626 *R/importAnalyze-functions.R 62af1751029760c227028b702eb7ed5c *R/importAuto-functions.R 1e9410a25cb37118bc74138e4a9ce467 *R/importBrukerFlex-functions.R 5e2ff3eed1f54607421ce53300ac7992 *R/importCdf-functions.R 2ad5e2a7509e6c50ad4ef9e335f997fa *R/importCiphergenXml-functions.R e9879f8f5efc3f9630211dd3cc8c62c7 *R/importImzMl-functions.R eb324244818c2829f2bd30290b19a1fb *R/importMzMl-functions.R 8fd680f85438e19f3bbe1d72d7829d7f *R/importMzXml-functions.R fca6cd0ab1ffd4045b94c986494b9005 *R/importTab-functions.R e1461b5fbb9c7883b89f813b6e343968 *R/list.files-functions.R 48dbf06d13cd3fc87442cb82561364f8 *R/msd-functions.R 61dd360751c97d052c1d0e5d1026cb69 *R/mzMl-functions.R 23386bcab445375af4642684d16e18e6 *R/package.R 6a89ddd05095a15d0965b39aae05cdbd *R/parseCiphergenXml.R f81439743c0aeb3eab37c2f938e3312a *R/parseMzMl.R b5189169e03a3ae8150047e0215f40a7 *R/sanitize-functions.R a65a1518f1aad8e25629e5ddd9139508 *R/testChecksum-functions.R a4b92b6f309e60be3af2363e2066f47c *R/xml-functions.R 6720a38b98348761134bfdbd6c773341 *build/vignette.rds 9b47d07debb7bc07b22ff5877a5ad37e *inst/doc/MALDIquantForeign-intro.R fa3507f704915074f42215d1a7acaf19 *inst/doc/MALDIquantForeign-intro.Rnw 02c61d898ed38ba61c6fa4193e878bc0 *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 9f3dad6df2b7d1b0e7484d56efb135b1 *inst/exampledata/compressed/csv.tar.gz 5e7f66c3581914b38f2510a5cb81b817 *inst/exampledata/compressed/csv.zip c967aa9538fd9d26a4463503a0d5ca0e *inst/exampledata/compressed/csv1.csv.gz 5101c57f3848a853326e4aac514ee494 *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 489b1be67d30d175969dbb66f8bcb9b7 *inst/exampledata/tiny1.mzML1.1.mzML 3b8bd26f7fc636e57388d52b3f9f3eb7 *inst/exampledata/tiny1.mzXML3.0.mzXML 5e796bc727641cf2be616176940d3644 *inst/exampledata/tiny_continuous.ibd c7dc5215856e426a59c5b49a3480371c *inst/exampledata/tiny_continuous.imzML 065ae1dbeb21aada540e6a5436fd6e55 *inst/exampledata/tiny_processed.ibd 5e119389bbd61d7143989d94253d7771 *inst/exampledata/tiny_processed.imzML 153b40d0a37856e45e509adba9e3e72c *man/MALDIquantForeign-package.Rd 658493ac6a3ce58e729dac6f25640791 *man/base64-encode.Rd dea6423f9b0341ae917220d42f979efa *man/cleanFilename.Rd 883ad90366f5650502f2eee44dded745 *man/composeFilename-methods.Rd 70e311be07cf7332f6831df25c7eebf9 *man/createMassObject.Rd 2b29af40e1cc66668a086a27a68572e3 *man/export-methods.Rd 43eac398993f12f2079722d2316a10ef *man/exportMsd-methods.Rd 72b92c6f793cc455f9f6283de9a4ed49 *man/exportMzMl-methods.Rd 212c1e7bc9f0d1692ef63830fe865abf *man/exportTab-methods.Rd f9c188dd34ecc0165010e9eb56158cdc *man/fileExtension.Rd 13368ec11da3177849d08d68921127e5 *man/import-functions.Rd 3c07fb6d8eeac6e705d74922b7737251 *man/importAnalyze-functions.Rd 47cf2a37eb05410bb477fc9bdceedaaf *man/importBrukerFlex-functions.Rd df00aadf12b76b2366b8ee31ceb2f951 *man/importCdf-functions.Rd a61c1e9b52958fa3be31570e5f392a2b *man/importCiphergenXml-functions.Rd 99aeead8ff6a4974a7de45d4ce95ad1d *man/importImzMl-functions.Rd 82c3c5719797ad00ead3a096b0e2d027 *man/importMzMl-functions.Rd 495a2b9eeabbb04cd48ce686ceaed825 *man/importMzXml-functions.Rd ab43d0329ca52ea5de6bfdefb7e94a01 *man/importTab-functions.Rd 9dfc4801ecd4e28e41fe8e724a8d9ca0 *man/mzMlHandlers.Rd 9cf44188a71ad2c0cc296689cb8eea5b *man/parseCiphergenXml.Rd 0bef5deb68471becc6a4e2461636930a *man/parseMzMl.Rd cbe4f83921a45a0363a4210cff7a6373 *man/supportedFileFormats-functions.Rd f743796f136a436364c76e6b0f83d474 *tests/testthat.R 031322ef8bf6b15b9b60182da8db6415 *tests/testthat/test_compression-functions.R 7482a5e165b6b2e4be4f02a542c8ab22 *tests/testthat/test_createMassObject-functions.R 45d987b436aed14db6070090560e48b2 *tests/testthat/test_download-functions.R 365f33d698bc51d4805a20f4aa6c1bf2 *tests/testthat/test_exportMsd-methods.R 5f2bf75a41afc12a65e213e5d6e2088c *tests/testthat/test_exportMzMl-methods.R 5dbbcb5c4bde39a27e7f4da831a41ca2 *tests/testthat/test_exportTab-methods.R 78922514cb74d182e1f5d2eb32795b32 *tests/testthat/test_filename-functions.R 5e29551f34760c6d585fe5507d783767 *tests/testthat/test_importBrukerFlex-functions.R 629b1b34416db100e67ee633683d1843 *tests/testthat/test_importCdf-functions.R fd13afb539e0f7cee20bc98043fa12c5 *tests/testthat/test_importCiphergenXml-functions.R 77d7bb6814ce437adb027a32de33e119 *tests/testthat/test_importImzMl-functions.R e8dee57768f98c8d293e602098dbadf3 *tests/testthat/test_importMzMl-functions.R 569474ef580280d020909bd05a63bae0 *tests/testthat/test_importMzXml-functions.R f3e63b5b16c589abe6957dbf964f0d59 *tests/testthat/test_importTab-functions.R 2b2a91c03508aefeb1b2c31a851a2640 *tests/testthat/test_sanitize-functions.R 0480ed8c85c032945674be63619f565c *tests/testthat/test_testChecksum-functions.R fa3507f704915074f42215d1a7acaf19 *vignettes/MALDIquantForeign-intro.Rnw dcdcd775ae2bcfb2aea05af8e6921bef *vignettes/bibliography.bib MALDIquantForeign/build/0000755000175000017500000000000012372201703016067 5ustar sebastiansebastianMALDIquantForeign/build/vignette.rds0000644000175000017500000000043112372201703020424 0ustar sebastiansebastianRK0Ni*)0t06KFݛZ2G;B"(%Ð PP)1^ͥ2l0M>-q+tw*Nd8Uxd.6d-M٦?zANUkUl2ջL8ǟjY -=&y ׍~fa\-eOYgyEA6i#|٠*J:)iXϾJMALDIquantForeign/NAMESPACE0000644000175000017500000000130312325512134016205 0ustar sebastiansebastianexport(import) export(importAnalyze) export(importBrukerFlex) export(importCdf) export(importCiphergenXml) export(importCsv) export(importImzMl) export(importMzMl) export(importMzXml) export(importTab) export(importTxt) export(supportedFileFormats) exportMethods(export) exportMethods(exportCsv) 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(downloader,download) importFrom(readBrukerFlexData,readBrukerFlexFile) MALDIquantForeign/NEWS0000644000175000017500000001417012372201417015474 0ustar sebastiansebastianRELEASE HISTORY OF THE "MALDIquantForeign" PACKAGE ================================================== 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/DESCRIPTION0000644000175000017500000000226612372215746016520 0ustar sebastiansebastianPackage: MALDIquantForeign Version: 0.9 Date: 2014-08-11 Title: Import/Export routines for MALDIquant Authors@R: c(person("Sebastian", "Gibb", role=c("aut", "cre"), email="mail@sebastiangibb.de"), person("Pietro", "Franceschi", role=c("ctb"), email="pietro.franceschi@fmach.it")) Depends: R (>= 3.0.0), methods, MALDIquant (>= 1.8) Imports: base64enc, digest, downloader, readBrukerFlexData (>= 1.7), readMzXmlData (>= 2.7), XML Suggests: knitr, testthat (>= 0.8), RNetCDF (>= 1.6.1) Description: This package reads (tab, csv, Bruker fid, Ciphergen XML, mzXML, mzML, imzML, Analyze 7.5, CDF) and writes (tab, csv, msd, mzML) different file formats of mass spectrometry data into/from MALDIquant objects. License: GPL (>= 3) URL: http://strimmerlab.org/software/maldiquant/ https://github.com/sgibb/MALDIquantForeign/ BugReports: https://github.com/sgibb/MALDIquantForeign/issues/ LazyLoad: yes VignetteBuilder: knitr Packaged: 2014-08-11 17:56:19 UTC; sebastian Author: Sebastian Gibb [aut, cre], Pietro Franceschi [ctb] Maintainer: Sebastian Gibb NeedsCompilation: no Repository: CRAN Date/Publication: 2014-08-11 21:39:18 MALDIquantForeign/man/0000755000175000017500000000000012344315500015543 5ustar sebastiansebastianMALDIquantForeign/man/import-functions.Rd0000644000175000017500000001020312347075246021363 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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, verbose = TRUE, ...) } \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{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 } \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")) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/createMassObject.Rd0000644000175000017500000000166212347075246021272 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{.createMassObject} \alias{.createMassObject} \title{Create a MassSpectrum or a MassPeaks object.} \usage{ .createMassObject(data, metaData = list(), centroided = FALSE, massRange = c(0, Inf), minIntensity = 0, verbose = FALSE) } \arguments{ \item{data}{\code{list}, spectrum data with elements mass, intensity, snr} \item{metaData}{\code{list}, metaData} \item{centroided}{\code{logical}, centroided (if TRUE => MassPeaks, if FALSE => MassSpectrum)} \item{massRange}{\code{double}, length == 2, trim spectrum to \code{massRange}.} \item{minIntensity}{\code{double}, minimal intensity} \item{verbose}{\code{logical}, verbose output?} } \value{ Returns a MassSpectrum or a MassPeaks object. } \description{ This function creates a MassSpectrum or MassPeaks object (depending on the centroided argument). } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{internal} MALDIquantForeign/man/importCiphergenXml-functions.Rd0000644000175000017500000000214012347075246023672 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/base64-encode.Rd0000644000175000017500000000171512347075246020372 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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. } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \seealso{ \code{\link[base64enc]{base64encode}} from \pkg{base64enc} package } \keyword{internal} MALDIquantForeign/man/importImzMl-functions.Rd0000644000175000017500000000217012347075246022340 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{importImzMl} \alias{importImzMl} \title{Import imzML files} \usage{ importImzMl(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 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(exampleDirectory) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{imzML} format: \url{http://www.imzml.org/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/MALDIquantForeign-package.Rd0000644000175000017500000000112612347075246022651 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \docType{package} \name{MALDIquantForeign-package} \alias{MALDIquantForeign-package} \title{Import/Export routines for MALDIquant} \description{ This package reads and writes different file formats of mass spectrometry data into/from MALDIquant objects. } \details{ \tabular{ll}{ Package: \tab MALDIquantForeign \cr License: \tab GPL (>= 3)\cr URL: \tab http://strimmerlab.org/software/maldiquant/\cr } } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \keyword{package} MALDIquantForeign/man/parseCiphergenXml.Rd0000644000175000017500000000075012347075246021471 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{.parseCiphergenXml} \alias{.parseCiphergenXml} \title{Parse Ciphergen XML files.} \usage{ .parseCiphergenXml(file, ...) } \arguments{ \item{file}{\code{character}, path to Ciphergen XML file} \item{verbose}{\code{logical}, verbose output?} } \value{ Returns a list with metadata and spectra. } \description{ This function parses Ciphergen XML files. } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{internal} MALDIquantForeign/man/export-methods.Rd0000644000175000017500000000416712347075246021041 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{export,AbstractMassObject-method} \alias{export} \alias{export,AbstractMassObject-method} \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{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \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{\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 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") } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/supportedFileFormats-functions.Rd0000644000175000017500000000311312347075246024234 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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 } } \subsection{Export}{ \tabular{ll}{ tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr } } } \examples{ library("MALDIquantForeign") supportedFileFormats() } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquantForeign]{export}}, \code{\link[MALDIquantForeign]{import}} } MALDIquantForeign/man/composeFilename-methods.Rd0000644000175000017500000000124012347075246022613 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{.composeFilename,AbstractMassObject-method} \alias{.composeFilename,AbstractMassObject-method} \title{This method creates a filename for a \code{\linkS4class{AbstractMassObject}} object.} \usage{ \S4method{.composeFilename}{AbstractMassObject}(x, fileExtension = "csv") } \arguments{ \item{x}{a \code{\linkS4class{AbstractMassObject}} object} \item{fileExtension}{file type (e.g. "txt", "pdf", ...)} } \value{ filename } \description{ This method creates a filename for a \code{\linkS4class{AbstractMassObject}} object. } \seealso{ \code{\linkS4class{AbstractMassObject}} } \keyword{internal} MALDIquantForeign/man/importCdf-functions.Rd0000644000175000017500000000231312347075246022003 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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 (require("RNetCDF")) { s <- importCdf(exampleDirectory) } else { message("You have to install the RNetCDF package to use importCdf.") } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/fileExtension.Rd0000644000175000017500000000076712347075246020675 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{.fileExtension} \alias{.fileExtension} \title{Determine file extension} \usage{ .fileExtension(x) } \arguments{ \item{x}{\code{character}, filename.} } \value{ \code{character}, file extension. } \description{ Determine file extension } \examples{ library("MALDIquantForeign") files <- c("/home/foo/bar.txt", "foobar.pdf") MALDIquantForeign:::.fileExtension(files) } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } \keyword{internal} MALDIquantForeign/man/importTab-functions.Rd0000644000175000017500000000252612347075246022023 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{importTxt} \alias{importCsv} \alias{importTab} \alias{importTxt} \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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[utils]{read.table}} } MALDIquantForeign/man/parseMzMl.Rd0000644000175000017500000000070612347075246017764 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{.parseMzMl} \alias{.parseMzMl} \title{Parse mzML files.} \usage{ .parseMzMl(file, verbose = FALSE, ...) } \arguments{ \item{file}{\code{character}, path to mzML file} \item{verbose}{\code{logical}, verbose output?} } \value{ Returns a list with metadata and spectra. } \description{ This function parses mzML files. } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{internal} MALDIquantForeign/man/exportMsd-methods.Rd0000644000175000017500000000404012347075246021473 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{exportMsd,MassSpectrum-method} \alias{exportMsd} \alias{exportMsd,MassSpectrum-method} \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{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{peaks}{a \code{\link[MALDIquant]{MassPeaks-class}} object or a \code{list} of \code{\link[MALDIquant]{MassPeaks-class}} objects.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \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) } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr mMass homepage: \url{http://mmass.org/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/exportMzMl-methods.Rd0000644000175000017500000000333112347075246021631 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{exportMzMl,MassSpectrum-method} \alias{exportMzMl} \alias{exportMzMl,MassSpectrum-method} \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]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \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 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 with corresponding peaks exportMzMl(s, path="spectra.mzMl") } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: \url{http://www.psidev.info/mzml_1_0_0} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/mzMlHandlers.Rd0000644000175000017500000000115212347075246020446 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{.mzMlHandlers} \alias{.mzMlHandlers} \title{Parse mzML files.} \usage{ .mzMlHandlers(fileName, verbose = FALSE) } \arguments{ \item{fileName}{\code{character}, path to mzML file} \item{verbose}{\code{logical}, verbose output?} } \value{ function closure } \description{ This function is defines handlers for XML SAX parser. Internal use only. } \details{ TODO: fetch obo map file and use it } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \references{ Definition of \code{mzML} format: \url{http://www.psidev.info/mzml_1_0_0} } \keyword{internal} MALDIquantForeign/man/importMzMl-functions.Rd0000644000175000017500000000220112347075246022162 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{mzML} format: \url{http://www.psidev.info/mzml_1_0_0\%20} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/importAnalyze-functions.Rd0000644000175000017500000000175212347075246022720 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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. } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/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}} } MALDIquantForeign/man/importBrukerFlex-functions.Rd0000644000175000017500000000225212347075246023362 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readBrukerFlexData]{readBrukerFlexFile}} } MALDIquantForeign/man/importMzXml-functions.Rd0000644000175000017500000000230112347075246022353 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{mzXML} format: \url{http://tools.proteomecenter.org/mzXMLschema.php} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readMzXmlData]{readMzXmlFile}} } MALDIquantForeign/man/exportTab-methods.Rd0000644000175000017500000000413512347075246021463 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \docType{methods} \name{exportTab,AbstractMassObject-method} \alias{exportCsv} \alias{exportCsv,AbstractMassObject-method} \alias{exportCsv,list-method} \alias{exportTab} \alias{exportTab,AbstractMassObject-method} \alias{exportTab,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{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \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) } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[utils]{write.table}} } MALDIquantForeign/man/cleanFilename.Rd0000644000175000017500000000047112347075246020574 0ustar sebastiansebastian% Generated by roxygen2 (4.0.1): do not edit by hand \name{.cleanFilename} \alias{.cleanFilename} \title{This function removes spaces and punctuations from filenames.} \usage{ .cleanFilename(x) } \value{ filename } \description{ This function removes spaces and punctuations from filenames. } \keyword{internal} MALDIquantForeign/tests/0000755000175000017500000000000012325512134016133 5ustar sebastiansebastianMALDIquantForeign/tests/testthat/0000755000175000017500000000000012372215746020006 5ustar sebastiansebastianMALDIquantForeign/tests/testthat/test_importMzXml-functions.R0000644000175000017500000000351712346622110025472 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importMzXml(path)) expect_equal(s, import(path, type="mzXML")) 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) expect_equal(s, import(path)) expect_equal(s, importMzXml(path)) expect_equal(s, import(path, type="mzXML")) 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) expect_equal(p, import(path, centroided=TRUE)) expect_equal(p, importMzXml(path, centroided=TRUE)) expect_equal(p, import(path, type="mzXML", centroided=TRUE)) 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_exportMzMl-methods.R0000644000175000017500000001067512325512134024750 0ustar sebastiansebastiancontext("exportMzMl") m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) mzML <- c( "", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", paste0(" "), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw=", " ", " ", " ", " ", " ", " eJxjYAABCQcwxSADpRWgtBKUVnEAAB9MAds=", " ", " ", " ", " ", " ", "") test_that("exportMzMl", { tmp <- tempdir() MALDIquantForeign:::.exportMzMl(m, file=file.path(tmp, "tmp.mzML")) expect_equal(readLines(file.path(tmp, "tmp.mzML")), mzML) g <- readLines(file.path(tmp, "tmp.mzML")) }) test_that("exportMzMl,list", { tmp <- tempdir() 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_compression-functions.R0000644000175000017500000000551612325512134025533 0ustar sebastiansebastiancontext("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)) }) 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)) }) 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_filename-functions.R0000644000175000017500000000346312325512134024751 0ustar sebastiansebastiancontext("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(".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(".uniqueBaseFilenames", { expect_identical(MALDIquantForeign:::.uniqueBaseFilenames( c("/home/user/foo.bar", "/home/user/foo.bar"), fileExtension="txt"), c("foo_1.txt", "foo_2.txt")) }) 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_importCdf-functions.R0000644000175000017500000000407612325512134025121 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importCdf(path)) expect_equal(s, import(path, type="cdf")) 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_exportMsd-methods.R0000644000175000017500000000403712325512134024607 0ustar sebastiansebastiancontext("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) msd <- c( "", "", " ", " tmp.msd", " ", " ", " ", " ", " ", " ", " ", " ", " eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw=", " eJxjYAABCQcwxSADpRWgtBKUVnEAAB9MAds=", " ", " ", " ", " ", " ", "") if (.Platform$endian == "big") { msd[13:14] <- c( " eJyz/8AABg4MUJoDSgtAaREIDQBExAJc", " eJxzkGAAAwcZKK0ApZWgtAqEBgArDgHb") } test_that("exportMsd", { tmp <- tempdir() MALDIquantForeign:::.exportMsd(m, file=file.path(tmp, "tmp.msd"), peaks=p) expect_equal(readLines(file.path(tmp, "tmp.msd"))[-c(4, 5)], msd[-c(4, 5)]) }) test_that("exportMsd,list", { tmp <- tempdir() 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)]) }) test_that(".createMsdTitle", { f <- file(file.path(tempdir(), "test.msd")) expect_true(MALDIquantForeign:::.createMsdTitle(f) == "test") close(f) }) MALDIquantForeign/tests/testthat/test_importImzMl-functions.R0000644000175000017500000000246712325512134025457 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importImzMl(path)) expect_equal(s, import(path, type="imzML")) 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("importMzMl processed", { path <- normalizePath(system.file( file.path("exampledata", "tiny_processed.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path) expect_equal(s, import(path)) expect_equal(s, importImzMl(path)) expect_equal(s, import(path, type="imzML")) 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") }) MALDIquantForeign/tests/testthat/test_sanitize-functions.R0000644000175000017500000000031012325512134025003 0ustar sebastiansebastiancontext("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_createMassObject-functions.R0000644000175000017500000000300112346621604026401 0ustar sebastiansebastiancontext("createMassObject") test_that(".createMassObject", { expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( list(mass=1:5, intensity=1:5), list()))) expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( list(mass=1:5, intensity=1:5), list(), centroided=FALSE))) expect_warning(MALDIquantForeign:::.createMassObject( list(mass=1:5, intensity=1:5), list(dataProcessing=list(centroided=0)), centroided=TRUE), paste0("According to the metadata information the imported data are ", "not centroided.")) expect_warning(MALDIquantForeign:::.createMassObject( list(mass=1:5, intensity=1:5), list(centroided="1")), paste0("According to the metadata information the imported data are ", "centroided.")) expect_true(suppressWarnings(isMassPeaks( MALDIquantForeign:::.createMassObject( list(mass=1:5, intensity=1:5), list(), centroided=TRUE)))) expect_true(suppressWarnings(isMassPeaks( MALDIquantForeign:::.createMassObject( list(mass=1:5, intensity=1:5), list(dataProcessing=list(centroided="1")), centroided=TRUE)))) expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( list(mass=c(1, 5, 7), intensity=1:3), list()))) expect_equal(mass(MALDIquantForeign:::.createMassObject( list(mass=1:10, intensity=1:10), massRange=c(4, 8))), 4:8) expect_equal(intensity(MALDIquantForeign:::.createMassObject( list(mass=1:10, intensity=1:10), minIntensity=5)), 5:10) }) MALDIquantForeign/tests/testthat/test_importMzMl-functions.R0000644000175000017500000000515112346622041025301 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importMzMl(path)) expect_equal(s, import(path, type="mzML")) 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) expect_equal(s, import(path)) expect_equal(s, importMzMl(path)) expect_equal(s, import(path, type="mzML")) 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) expect_equal(p, import(path, centroided=TRUE)) expect_equal(p, importMzMl(path, centroided=TRUE)) expect_equal(p, import(path, type="mzML", centroided=TRUE)) 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_download-functions.R0000644000175000017500000000044712325512134024777 0ustar sebastiansebastiancontext("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))) }) MALDIquantForeign/tests/testthat/test_exportTab-methods.R0000644000175000017500000000164512325512134024574 0ustar sebastiansebastiancontext("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("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) }) MALDIquantForeign/tests/testthat/test_importTab-functions.R0000644000175000017500000000522412325512134025127 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importTxt(path)) expect_equal(s, import(path, type="txt")) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "ascii.txt") }) 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) expect_equal(s, import(path, sep=",", header=TRUE)) expect_equal(s, importCsv(path, sep=",", header=TRUE)) expect_equal(s, import(path, type="csv", sep=",", header=TRUE)) 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) expect_equal(s, import(path)) expect_equal(s, importCsv(path)) expect_equal(s, import(path, type="csv")) 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(textConnection(x[i]), sep=sep[i]), result[i]) } }) test_that("autoSep", { for (i in seq(along=x)) { expect_identical(MALDIquantForeign:::.autoSep(textConnection(x[i])), sep[i]) } }) MALDIquantForeign/tests/testthat/test_testChecksum-functions.R0000644000175000017500000000145212356055756025647 0ustar sebastiansebastiancontext("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_importBrukerFlex-functions.R0000644000175000017500000000126112325512134026467 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importBrukerFlex(path)) expect_equal(s, import(path, type="fid")) 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_importCiphergenXml-functions.R0000644000175000017500000000126312325512134027005 0ustar sebastiansebastiancontext("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) expect_equal(s, import(path)) expect_equal(s, importCiphergenXml(path)) expect_equal(s, import(path, type="ciph")) 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.R0000644000175000017500000000006412325512134020116 0ustar sebastiansebastianlibrary("testthat") test_check("MALDIquantForeign") MALDIquantForeign/inst/0000755000175000017500000000000012346120146015747 5ustar sebastiansebastianMALDIquantForeign/inst/doc/0000755000175000017500000000000012372201703016512 5ustar sebastiansebastianMALDIquantForeign/inst/doc/MALDIquantForeign-intro.R0000644000175000017500000000552512372201703023206 0ustar sebastiansebastian## ----setup, include=FALSE, cache=FALSE----------------------------------- library("knitr") opts_chunk$set(tidy.opts=list(width.cutoff=45), tidy=FALSE, fig.align="center", fig.height=4.25, comment=NA, prompt=TRUE) ## ----env, echo=FALSE----------------------------------------------------- suppressPackageStartupMessages(library("MALDIquant")) suppressPackageStartupMessages(library("MALDIquantForeign")) ## ----fileformats--------------------------------------------------------- supportedFileFormats() ## ----mqsetup, eval=FALSE------------------------------------------------- # install.packages(c("MALDIquant", "MALDIquantForeign")) ## ----mqlibrary, eval=FALSE----------------------------------------------- # library("MALDIquant") # library("MALDIquantForeign") ## ----import-------------------------------------------------------------- ## get the example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") spectra <- import(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] ## ----importbrukerflex---------------------------------------------------- spectra <- importBrukerFlex(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] ## ----importcsvcompressed------------------------------------------------- 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]] ## ----importremote, eval=FALSE-------------------------------------------- # spectra <- import(paste0("http://www.meb.ki.se/", # "~yudpaw/papers/spikein_xml.zip"), # centroided=FALSE, verbose=TRUE) ## ----centroided---------------------------------------------------------- peaks <- import(file.path(exampleDirectory, "ascii.txt"), centroided=TRUE, verbose=FALSE) peaks ## ----masspectrum--------------------------------------------------------- spectra <- list( createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) ## ----export1------------------------------------------------------------- export(spectra[[1]], file="spectrum1.csv") import("spectrum1.csv") ## ----exportpath, eval=TRUE----------------------------------------------- export(spectra, type="csv", path="spectra", force=TRUE) list.files("spectra") ## ----mqvignette, eval=FALSE---------------------------------------------- # vignette(topic="MALDIquant", package="MALDIquant") ## ----sessioninfo, echo=FALSE, results="asis"----------------------------- toLatex(sessionInfo(), locale=FALSE) MALDIquantForeign/inst/doc/MALDIquantForeign-intro.pdf0000644000175000017500000042554012372201703023561 0ustar sebastiansebastian%PDF-1.5 % 33 0 obj << /Length 607 /Filter /FlateDecode >> stream xڅTMs@ Wf~SiI=t[05`W 9;'==!E)w%$XKF, Z'4ɉFE_\?l*~yH{tR9'Z~Q Fއ$"A` LGpwq$EǂT%2U(Lr v (m)'ϊD h#6_eÜjj[8"aq?Tow\D4/~׏?CD2wR "1)Hh/V8 9KGL(?V+.oB,9 6uևP\m lES#'r ۔ӮYiJ Go@IuqPޝfQ&|@Z -SD0o>L q*/_~> endstream endobj 57 0 obj << /Length 1269 /Filter /FlateDecode >> stream xڵWKs6WVrƂÇNrM3ں=@"$H x绋eIe2qfrb(6Ab~-ҀgLp%:6k+rV(%0f"e"Wd£Y Ytm4o9 |̈́Y 9zACAw2 );m׃zZٴ$wQ]x,qsRW5`𣶖FwĬd;wO$~{xyMnuOL%ٞW\%+IB)c_ ϾR~{{s?覿jx؆S&&bTQ$Q%ۮ#pNZf*\^d,Tx8^XŷM;r]49f\2)}&D%H@U6;)MeAP8,MC~gLf2Y ;޴/q }m(~6BDžRȔlw¶{l/%ÿ(I%D +^5rX8Z9+7,Ayy_-}w g }Wv$Fb$^`AHv]]mHt{_ν^?Rm0@v vMߝjY裮Fq ]|GX)@K#_Wm{*8N Yd%,{uIu9&g+t/p\1ƪxF"~N[QpHNh~0Uy64D6Do~c^f_^TUL| O: "a11;]տXn6BV|jy3,(~["y0Sjtms^%k8o麬Χbd*IFl1"S\/\_ M0VX*ve 4)CrAu=@ xs%JP0'K֏ۑЦV[\xX+h $f|>Li}=4.C}!G[|mY0?˺CIMEqnD.K(AvWNiqx];L] EM5=\ɧS[XG:s4-./mq#KB.$L,iЙ`}Njy)A?HqUD9#<3q-R=fiW0k Cߵ&?;BE~LPpdr3K1 endstream endobj 67 0 obj << /Length 1486 /Filter /FlateDecode >> stream xr6(=Pi $MI鴮oNSBR)b˩g(,v`ĸWLaw`)vXN$8  i)(R$F#b%VH`e?1Q!(b$(f,8gwlD0#-HjH0b3[pTxՂzՂ SL|Pžld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*ReH İRq1kkV(5p[qYU}+WY]]7+jY5iY-BEUƗ+7+KFx8ͪ hN?B;-ESRA߮>ye֑5="' u-q;^'.W%nA-wP}+N_;S74}+^s*>NYiM;#iptѺl?"kkihZ nw֧qjYvB>0 {OzUTupkb,|v{iV7M_6uUr endstream endobj 135 0 obj << /Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(pdfTeX-1.40.13)/Keywords() /CreationDate (D:20140811195619+02'00') /ModDate (D:20140811195619+02'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) kpathsea version 6.1.0) >> endobj 127 0 obj << /Type /ObjStm /N 14 /First 105 /Length 489 /Filter /FlateDecode >> stream x}Ko0 <6ZzAڦHЃ b(QI}Hk`P p0LS@\3Ҁ";@S$ I""Dmo ī[q->3oEu*- ,%9Pzʏ7ywm8a*Pֽh 9`2Q!B={`irx&0IHQ^eHacfj}6?Oma~)/ɠy`X?W?.6z1=5C37HT|BRvTB2.LA"YFrBrkUUqE]FMia)8cˤ đšK<0yYj8rvucY6oԿ[ goEn}süV[ 6V;;PWm>V`ʹAP endstream endobj 136 0 obj << /Type /XRef /Index [0 137] /Size 137 /W [1 3 1] /Root 134 0 R /Info 135 0 R /ID [<215C5CB496CF7B70C7093ADABC6D2E7E> <215C5CB496CF7B70C7093ADABC6D2E7E>] /Length 333 /Filter /FlateDecode >> stream x%ERCQ`!x ݵXc.{`#3a XUHfթ+k_O = ^[HUI\I5)R%k؎Nj$2` Y0D͎φCT$h\8C8#؁S؇c8(AJ ʡU*a"zQHqhP TYڠI%ٺ0 *wvDVaqIiÂJڎZTYraiYҊۧUcTU^-m=ZT}JXR ٣ D8&19p~b7ō/ endstream endobj startxref 141587 %%EOF MALDIquantForeign/inst/doc/MALDIquantForeign-intro.Rnw0000644000175000017500000001370412372201703023551 0ustar sebastiansebastian%\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/exampledata/0000755000175000017500000000000012356054703020242 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/compressed/0000755000175000017500000000000012325512134022377 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/compressed/csv.tar.gz0000644000175000017500000000023512325512134024321 0ustar sebastiansebastiank/Qα 0y9HMS}X:d t"| ߤ&] *pOuGu/ߴ~RO-ܶǤ%߷jKjh:7Mp38=n(MALDIquantForeign/inst/exampledata/compressed/csv.zip0000644000175000017500000000031612325512134023716 0ustar sebastiansebastianPK bXBv((csv1.csvUT )Q)Qux "mass","intensity" 1,6 2,7 3,8 4,9 5,10 PK bXBv((csv1.csvUT)Qux PKNjMALDIquantForeign/inst/exampledata/compressed/csv1.csv.gz0000644000175000017500000000010512325512134024403 0ustar sebastiansebastian)Qcsv1.csvSM,.VQ+I+,T21212ֱ2ѱ214v(MALDIquantForeign/inst/exampledata/tiny_processed.ibd0000644000175000017500000000026012325512134023743 0ustar sebastiansebastian4Vx4444Vx?@@@@@@ @"@$@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/ciphergen/0000755000175000017500000000000012325512134022177 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/ciphergen/tiny.xml0000644000175000017500000000153512325512134023710 0ustar sebastiansebastian tiny example 20000 2.5e+008 Quadratic 24000000 0.0013 0 20000 hand made 1 false 1 2 3 4 5 MALDIquantForeign/inst/exampledata/ascii.txt0000644000175000017500000000002512325512134022061 0ustar sebastiansebastian1 6 2 7 3 8 4 9 5 10 MALDIquantForeign/inst/exampledata/tiny1.mzML1.1.mzML0000644000175000017500000000673012325512134023204 0ustar sebastiansebastian AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/tiny1-compressed.mzXML3.0.mzXML0000644000175000017500000000304412325512134025622 0ustar sebastiansebastian eJyz/8AABg4SUJoBSstAaQ4orQClBaC0EpQWgdIqEBoA0joENg== 0 0 7e7ef0ea030f6a56d34a4ebd446e22b22844d432 MALDIquantForeign/inst/exampledata/tiny_continuous.ibd0000644000175000017500000000021012325512134024155 0ustar sebastiansebastian4Vx4444Vx?@@@@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/csv1.csv0000644000175000017500000000005012325512134021617 0ustar sebastiansebastian"mass","intensity" 1,6 2,7 3,8 4,9 5,10 MALDIquantForeign/inst/exampledata/tiny1-centroided.mzXML3.0.mzXML0000644000175000017500000000316612325512134025603 0ustar sebastiansebastian P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 1cf2b3695447d2dd698b465e27f452a80192dd62 MALDIquantForeign/inst/exampledata/tiny1-compressed.mzML1.1.mzML0000644000175000017500000000665412325512134025353 0ustar sebastiansebastian eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYAABFQcwxaAEpRWgtAyUlnAAACEsAds= MALDIquantForeign/inst/exampledata/csv2.csv0000644000175000017500000000002512325512134021622 0ustar sebastiansebastian1;6 2;7 3;8 4;9 5;10 MALDIquantForeign/inst/exampledata/tiny1-centroided.mzML1.1.mzML0000644000175000017500000000753212325512134025323 0ustar sebastiansebastian AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/tiny.cdf0000644000175000017500000000071412325512134021676 0ustar sebastiansebastianCDF  scan_number point_number  scan_index4 point_count<scan_acquisition_timeD mass_valuesTintensity_values\?@? @ @ @@@@@ @"@$MALDIquantForeign/inst/exampledata/brukerflex/0000755000175000017500000000000012325512134022404 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/brukerflex/0_A1/0000755000175000017500000000000012325512134023064 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/0000755000175000017500000000000012325512134023224 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/0000755000175000017500000000000012325512134024152 5ustar sebastiansebastianMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/acqu0000644000175000017500000000071112325512134025025 0ustar sebastiansebastian##.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/fid0000644000175000017500000000002412325512134024633 0ustar sebastiansebastianMALDIquantForeign/inst/exampledata/tiny_processed.imzML0000644000175000017500000001235412325512134024244 0ustar sebastiansebastian MALDIquantForeign/inst/exampledata/tiny_continuous.imzML0000644000175000017500000001235412356046700024470 0ustar sebastiansebastian MALDIquantForeign/inst/exampledata/tiny1.mzXML3.0.mzXML0000644000175000017500000000313412325512134023460 0ustar sebastiansebastian P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 b87b09a4f34561d5572f9a6d30056106f819bc69 MALDIquantForeign/vignettes/0000755000175000017500000000000012372201703017000 5ustar sebastiansebastianMALDIquantForeign/vignettes/bibliography.bib0000644000175000017500000000250212330410473022130 0ustar sebastiansebastian@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/vignettes/MALDIquantForeign-intro.Rnw0000644000175000017500000001370412347107055024046 0ustar sebastiansebastian%\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/R/0000755000175000017500000000000012367761317015211 5ustar sebastiansebastianMALDIquantForeign/R/exportMzMl-methods.R0000644000175000017500000000227712346616745021127 0ustar sebastiansebastian## 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="MassSpectrum"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { return(.writeMzMlDocument(x=list(x), file=file, id=id, ...)) }) setMethod(f=".exportMzMl", signature=signature(x="list"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { return(.writeMzMlDocument(x=x, file=file, id=id, ...)) }) MALDIquantForeign/R/importCdf-functions.R0000644000175000017500000000533512346616745021300 0ustar sebastiansebastian## 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 ## 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 (!require("RNetCDF")) { 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(data=list(mass=mass, intensity=intensity), metaData=list(file=file, number=i, retentionTime=retentionTime[i], scanIndex=scanIndex[i]), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } return(l) } MALDIquantForeign/R/analyze-functions.R0000644000175000017500000001136212360461226020775 0ustar sebastiansebastian## 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.") } if (verbose) { message("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] return(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.") } if (verbose) { message("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]) } } return(i) } ## Analyze 7.5 t2m file .readAnalyzeMass <- function(filename, header, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } if (verbose) { message("Reading mass values from ", sQuote(filename), " ...") } n <- file.info(filename)$size/4 f <- file(filename, open="rb") on.exit(close(f)) m <- readBin(f, what="double", n=n, size=4, signed=TRUE, endian=header$endian) return(m) } MALDIquantForeign/R/parseCiphergenXml.R0000644000175000017500000000551012346616745020756 0ustar sebastiansebastian## 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} #' @rdname parseCiphergenXml #' @keywords internal #' .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: ## http://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) return(list(spectrum=list(mass=mass, intensity=intensity), metaData=metaData)) } MALDIquantForeign/R/fileFormats.R0000644000175000017500000000740112346616745017612 0ustar sebastiansebastian## 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 #' } #' } #' #' \subsection{Export}{ #' #' \tabular{ll}{ #' tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \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{http://strimmerlab.org/software/maldiquant/} #' @examples #' library("MALDIquantForeign") #' #' supportedFileFormats() #' #' @rdname supportedFileFormats-functions #' @export supportedFileFormats <- function() { return(list(import=importFormats$type, export=exportFormats$type)) } #' @keywords internal importFormats <- data.frame(type=c("txt", "tab", "csv", "fid", "ciphergen", "mzxml", "mzml", "imzml", "analyze", "cdf"), pattern=c("^.*\\.txt$", "^.*\\.tab$", "^.*\\.csv$", "^fid$", "^.*\\.xml$", "^.*\\.mzXML$", "^.*\\.mzML$", "^.*\\.imzML$", "^.*\\.hdr$", "^.*\\.cdf$"), handler=c(rep(".importTab", 2), ".importCsv", ".importBrukerFlex", ".importCiphergenXml", ".importMzXml", ".importMzMl", ".importImzMl", ".importAnalyze", ".importCdf"), stringsAsFactors=FALSE) #' @keywords internal exportFormats <- data.frame(type=c("tab", "csv", "msd", "mzml"), extension=c("tab", "csv", "msd", "mzML"), onefile=c(FALSE, FALSE, FALSE, TRUE), handler=c(".exportTab", ".exportCsv", ".exportMsd", ".exportMzMl"), stringsAsFactors=FALSE) MALDIquantForeign/R/importImzMl-functions.R0000644000175000017500000000717112356053233021620 0ustar sebastiansebastian## 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 #' @keywords internal .importImzMl <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (verbose) { message("Reading spectrum from ", sQuote(file), " ...") } if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ibdFilename <- paste0(.withoutFileExtension(file), ".ibd") if (!file.exists(ibdFilename)) { stop("File ", sQuote(ibdFilename), " doesn't exists!") } ## read file s <- .parseMzMl(file=file, verbose=verbose) ## 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 { stop("At least one checksum (SHA-1 or MD5) for the idb file ", "must be provided in the imzML file.") } 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 (tolower(uuid) != tolower(s$ims$uuid)) { stop("UUID mismatch!") } n <- length(s$ims$ibd) spectra <- vector(mode="list", length=n) .readValues <- function(file, x, column) { n <- x[column, "length"] e <- x[column, "encodedLength"] return(readBin(file, double(), n=n, size=e/n, signed=TRUE, endian="little")) } ## read mass and intensity values if (s$ims$type == "processed") { for (i in seq(along=spectra)) { if (verbose) { message("Reading binary data for spectrum ", i, "/", n, " ...") } m <- modifyList(s$metaData, s$spectra[[i]]$metaData) m$file <- file mass <- .readValues(ibd, s$ims$ibd[[i]], "mass") intensity <- .readValues(ibd, s$ims$ibd[[i]], "intensity") spectra[[i]] <- .createMassObject(list(mass=mass, intensity=intensity), metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } } else { mass <- .readValues(ibd, s$ims$ibd[[1]], "mass") for (i in seq(along=spectra)) { if (verbose) { message("Reading binary data for spectrum ", i, "/", n, " ...") } m <- modifyList(s$metaData, s$spectra[[i]]$metaData) m$file <- file intensity <- .readValues(ibd, s$ims$ibd[[i]], "intensity") spectra[[i]] <- .createMassObject(list(mass=mass, intensity=intensity), metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } } return(spectra) } MALDIquantForeign/R/base64encode-functions.R0000644000175000017500000000373512346616745021615 0ustar sebastiansebastian## 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) return(base64enc::base64encode(x)) } MALDIquantForeign/R/createMassObject-functions.R0000644000175000017500000000665512360452575022570 0ustar sebastiansebastian## 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 #' Create a MassSpectrum or a MassPeaks object. #' #' This function creates a MassSpectrum or MassPeaks object (depending on the #' centroided argument). #' #' @param data \code{list}, spectrum data with elements mass, intensity, snr #' @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 #' .createMassObject <- function(data, 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) } } if (centroided && verbose) { message("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[1] <= data$mass & data$mass <= massRange[2] & data$intensity >= minIntensity) ## create a MassPeaks object for centroided data if (centroided & is.null(data$snr)) { m <- createMassPeaks(mass=data$mass[i], intensity=data$intensity[i], metaData=metaData) } else if (centroided & !is.null(data$snr)) { m <- createMassPeaks(mass=data$mass[i], intensity=data$intensity[i], snr=data$snr[i], metaData=metaData) } else { m <- createMassSpectrum(mass=data$mass[i], intensity=data$intensity[i], metaData=metaData) } return(m) } MALDIquantForeign/R/importCiphergenXml-functions.R0000644000175000017500000000260612346616745023167 0ustar sebastiansebastian## 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 #' @keywords internal .importCiphergenXml <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (verbose) { message("Reading spectrum from ", sQuote(file), " ...") } if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ## read file s <- .parseCiphergenXml(file=file) return(list(.createMassObject(data=s$spectrum, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose))) } MALDIquantForeign/R/importMzMl-functions.R0000644000175000017500000000274112346616745021461 0ustar sebastiansebastian## 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 #' @keywords internal .importMzMl <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (verbose) { message("Reading spectrum from ", sQuote(file), " ...") } if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ## read file s <- .parseMzMl(file=file, verbose=verbose) l <- lapply(s$spectra, function(x, globalS=s) { m <- modifyList(s$metaData, x$metaData) m$file <- file return(.createMassObject(data=x, metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) }) return(l) } MALDIquantForeign/R/import-functions.R0000644000175000017500000004141212347075134020647 0ustar sebastiansebastian## 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 #' 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 #' } #' #' \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 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}} #' @author Sebastian Gibb #' @references \url{http://strimmerlab.org/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, verbose=TRUE, ...) { ## 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 <- importFormats$handler[i] s <- unlist(lapply(.files(path=path, pattern=pattern, excludePattern=excludePattern), handler, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose, ...)) if (is.null(s)) { stop("Import failed! Unsupported file type?") } if (removeEmptySpectra) { emptyIdx <- MALDIquant::findEmptyMassObjects(s) if (length(emptyIdx)) { if (verbose) { message("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{http://strimmerlab.org/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, ...) { return(import(path=path, type="txt", ...)) } #' @rdname importTab-functions #' @export importTab <- function(path, ...) { return(import(path=path, type="tab", ...)) } #' @rdname importTab-functions #' @export importCsv <- function(path, ...) { return(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{http://strimmerlab.org/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, ...) { return(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{http://strimmerlab.org/software/maldiquant/}, \cr #' Definition of \code{mzXML} format: #' \url{http://tools.proteomecenter.org/mzXMLschema.php} #' @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, ...) { return(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{http://strimmerlab.org/software/maldiquant/}, \cr #' Definition of \code{mzML} format: #' \url{http://www.psidev.info/mzml_1_0_0\%20} #' @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, ...) { return(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 \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{http://strimmerlab.org/software/maldiquant/}, \cr #' Definition of \code{imzML} format: #' \url{http://www.imzml.org/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importImzMl(exampleDirectory) #' #' @rdname importImzMl-functions #' @export importImzMl <- function(path, ...) { return(import(path=path, type="imzml", ...)) } #' 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{http://strimmerlab.org/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, ...) { return(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{http://strimmerlab.org/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, ...) { return(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{http://strimmerlab.org/software/maldiquant/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' if (require("RNetCDF")) { #' s <- importCdf(exampleDirectory) #' } else { #' message("You have to install the RNetCDF package to use importCdf.") #' } #' #' @rdname importCdf-functions #' @export importCdf <- function(path, ...) { return(import(path=path, type="cdf", ...)) } MALDIquantForeign/R/compression-functions.R0000644000175000017500000000702612346616745021711 0ustar sebastiansebastian## 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 #' @keywords internal .isCompressed <- function(x) { z <- c("bz2", "bzip2", "gz", "lzma", "xz") return(.fileExtension(x) %in% c("zip", z, paste("tar", z, sep="."))) } #' @keywords internal .isTar <- function(x) { return(grepl(pattern="^tar", x=.fileExtension(x))) } #' @keywords internal .isZip <- function(x) { return(grepl(pattern="^zip$", x=.fileExtension(x))) } #' @keywords internal .isPackedOrCompressed <- function(x) { return(.isCompressed(x) | .isTar(x)) } #' @keywords internal # 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)) } } }) return(unlist(f)) } #' @keywords internal # 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) if (verbose) { message(funName, " ", filename, " to ", destdir, ".") } unpacked <- fun(filename, exdir=destdir, ...) if (length(unpacked)) { return(destdir) } else { stop(funName, " failed!") } } #' @keywords internal # 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) } if (verbose) { message("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 } } return(destfile) } #' @keywords internal .cleanupUncompressedTmpFiles <- function() { unlink(file.path(tempdir(), "MALDIquantForeign_uncompress"), recursive=TRUE) } MALDIquantForeign/R/importBrukerFlex-functions.R0000644000175000017500000000245312346616745022653 0ustar sebastiansebastian## 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 #' @keywords internal .importBrukerFlex <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { s <- readBrukerFlexData::readBrukerFlexFile(fidFile=file, verbose=verbose, ...) return(list(.createMassObject(data=s$spectrum, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose))) } MALDIquantForeign/R/export-methods.R0000644000175000017500000002713212346616745020324 0ustar sebastiansebastian## 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 #' 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{http://strimmerlab.org/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, ...) { return(.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] isFile <- !isTRUE(file.info(path)$isdir) && tolower(.fileExtension(path)) %in% onefileSupport if (isFile) { return(.exportToFile(x=x, file=path, type=type, force=force, ...)) } else { return(.exportToDir(x=x, path=path, type=type, force=force, ...)) } }) #' 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{http://strimmerlab.org/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{http://strimmerlab.org/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]{AbstractMassObject-class}} objects (e.g. #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}) #' into mzML files. #' #' @usage #' \S4method{exportMzMl}{MassSpectrum}(x, file, force=FALSE, \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 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{http://strimmerlab.org/software/maldiquant/}, \cr #' HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: #' \url{http://www.psidev.info/mzml_1_0_0} #' @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 with corresponding peaks #' 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, ...) }) MALDIquantForeign/R/AllGenerics.R0000644000175000017500000000362612346616744017533 0ustar sebastiansebastian## 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 if (is.null(getGeneric(".composeFilename"))) setGeneric(".composeFilename", function(x, ...) standardGeneric(".composeFilename")) if (is.null(getGeneric(".exportTab"))) setGeneric(".exportTab", function(x, ...) standardGeneric(".exportTab")) if (is.null(getGeneric(".exportCsv"))) setGeneric(".exportCsv", function(x, ...) standardGeneric(".exportCsv")) if (is.null(getGeneric(".exportMsd"))) setGeneric(".exportMsd", function(x, ...) standardGeneric(".exportMsd")) if (is.null(getGeneric(".exportMzMl"))) setGeneric(".exportMzMl", function(x, ...) standardGeneric(".exportMzMl")) if (is.null(getGeneric("export"))) setGeneric("export", function(x, ...) standardGeneric("export")) if (is.null(getGeneric("exportTab"))) setGeneric("exportTab", function(x, ...) standardGeneric("exportTab")) if (is.null(getGeneric("exportCsv"))) setGeneric("exportCsv", function(x, ...) standardGeneric("exportCsv")) if (is.null(getGeneric("exportMsd"))) setGeneric("exportMsd", function(x, ...) standardGeneric("exportMsd")) if (is.null(getGeneric("exportMzMl"))) setGeneric("exportMzMl", function(x, ...) standardGeneric("exportMzMl")) MALDIquantForeign/R/filename-functions.R0000644000175000017500000000632712346616745021133 0ustar sebastiansebastian## 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 function removes spaces and punctuations from filenames. #' #' @return filename #' #' @keywords internal #' @rdname cleanFilename .cleanFilename <- function(x) { return(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 #' @rdname fileExtension #' @examples #' library("MALDIquantForeign") #' files <- c("/home/foo/bar.txt", "foobar.pdf") #' MALDIquantForeign:::.fileExtension(files) #' .fileExtension <- function(x) { pos <- regexpr(pattern="(\\.tar)?\\.([[:alnum:]]+)$|(/|\\\\)+[^.\\\\/]+$", text=x) return(ifelse(pos > -1L, substring(x, pos+1L), x)) } #' @keywords internal .withoutFileExtension <- function(x) { return(sub(pattern="\\.[[:alnum:]]+?$|(/|\\\\)+[^.\\\\/]+$", replacement="", x=.withoutCompressionExtension(x))) } #' @keywords internal .withoutCompressionExtension <- function(x) { return(sub(pattern="\\.(zip|gz|bz2|bzip2|xz|lzma)+$", replacement="", x=x)) } #' @keywords internal .cutFilenames <- function(x) { l <- strsplit(x, split=.Platform$file.sep, fixed=TRUE) 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) } return(filenames) } #' @keywords internal .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) return(paste(filenames, fileExtension, sep=".")) } #' @keywords internal ## 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) } return(y) }) return(unsplit(tmp, x)) } MALDIquantForeign/R/importTab-functions.R0000644000175000017500000000535112346616745021310 0ustar sebastiansebastian## 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 #' @keywords internal .importTab <- function(file, centroided=FALSE, massRange=c(0L, Inf), minIntensity=0L, skip=0L, sep=.autoSep(file, skip=skip), header=.autoHeader(file, sep=sep, skip=skip), verbose=FALSE, ...) { ## load ms file s <- read.table(file=file, header=header, sep=sep, skip=skip, stringsAsFactors=FALSE, ...) return(list(.createMassObject(list(mass=s[, 1L], intensity=s[, 2L]), metaData=list(file=file), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose))) } #' @keywords internal .importCsv <- function(file, centroided=FALSE, massRange=c(0L, Inf), minIntensity=0L, skip=0L, sep=.autoSep(file, skip=skip), header=.autoHeader(file, sep=sep, skip=skip), verbose=FALSE, ...) { return(.importTab(file=file, centroided=centroided, massRange=massRange, minIntensity=minIntensity, skip=skip, sep=sep, header=header, verbose=verbose, ...)) } #' @keywords internal .autoHeader <- function(file, sep="\t", skip=0L) { l <- tail(readLines(file, n=skip+1L), 1L) l <- gsub(pattern='[\\\\"]*', replacement="", x=l) l <- strsplit(l, split=sep)[[1L]][1L] return(!is.numeric(type.convert(l, as.is=TRUE))) } #' @keywords internal .autoSep <- function(file, sep=c(",", ";", "\t", " "), skip=0L) { l <- tail(readLines(file, n=skip+1L), 1L) pattern <- paste0(".+", sep, ".+") i <- vapply(pattern, function(x) { g <- gregexpr(pattern=x, text=l)[[1L]] return(all(g > 0L) & length(g) == 1L) }, logical(1L)) if (any(i)) { return(sep[which(i)[1L]]) ## return only first match } else { return(sep[1L]) } } MALDIquantForeign/R/exportTab-methods.R0000644000175000017500000000251612346616745020752 0ustar sebastiansebastian## 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, ...) { return(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, ...) { return(.exportTab(x, file=file, sep=sep, row.names=row.names, col.names=col.names, ...)) }) MALDIquantForeign/R/exportMsd-methods.R0000644000175000017500000000171712346616745020771 0ustar sebastiansebastian## 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, ...) { return(.writeMsdDocument(x=x, file=file, peaks=peaks, ...)) }) MALDIquantForeign/R/export-functions.R0000644000175000017500000000504012346616745020663 0ustar sebastiansebastian## 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/list.files-functions.R0000644000175000017500000000346512346616745021427 0ustar sebastiansebastian## 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 #' @keywords internal .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] } return(normalizePath(files)) } #' @keywords internal .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, ...)) return(unique(files)) } MALDIquantForeign/R/xml-functions.R0000644000175000017500000000307212346616745020145 0ustar sebastiansebastian## 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/msd-functions.R0000644000175000017500000000730412346616745020132 0ustar sebastiansebastian## 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(date())), 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) { return(.sanitize(.withoutFileExtension(basename(summary(file)$description)))) } MALDIquantForeign/R/sanitize-functions.R0000644000175000017500000000176412346616745021201 0ustar sebastiansebastian## 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 #' @keywords internal .sanitize <- function(x) { x <- gsub(pattern="&", replacement="&", x=x) x <- gsub(pattern="<", replacement="<", x=x) x <- gsub(pattern=">", replacement=">", x=x) return(x) } MALDIquantForeign/R/download-function.R0000644000175000017500000000355612346616745021000 0ustar sebastiansebastian## 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 #' @keywords internal .isUrl <- function(x) { return(grepl(pattern="^https?://|^ftp://", x=x)) } #' @keywords internal .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)) } if (verbose) { message("Downloading ", url , " to ", destfile, ".") } for (i in seq(along=url)) { r <- downloader::download(url=url[i], destfile=destfile[i], quiet=!verbose, mode="wb", ...) if (r != 0) { warning("Download of ", url[i], " failed!") } } return(destfile) } #' @keywords internal .cleanupDownloadedTmpFiles <- function() { unlink(file.path(tempdir(), "MALDIquantForeign_download"), recursive=TRUE) } MALDIquantForeign/R/parseMzMl.R0000644000175000017500000003071412356053230017235 0ustar sebastiansebastian## 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} #' @rdname parseMzMl #' @keywords internal #' .parseMzMl <- function(file, verbose=FALSE, ...) { return(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{http://www.psidev.info/mzml_1_0_0} #' @rdname mzMlHandlers #' @keywords internal #' .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"]) if (verbose) { message("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) if (verbose) { message("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() } if (verbose) { message("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() } ## 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:1000032", "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 if (verbose) { message("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()) return(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/importMzXml-functions.R0000644000175000017500000000271612346616745021653 0ustar sebastiansebastian## 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 #' @keywords internal .importMzXml <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { l <- readMzXmlData:::.readMzXmlFile(mzXmlFile=file, verbose=verbose, ...) return(lapply(l, function(x).createMassObject(data=x$spectrum, metaData=x$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose))) } MALDIquantForeign/R/importAnalyze-functions.R0000644000175000017500000000447412360460122022170 0ustar sebastiansebastian## 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 #' @keywords internal .importAnalyze <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { baseFilename <- .withoutFileExtension(file) header <- .readAnalyzeHdr(file, verbose=verbose) mass <- .readAnalyzeMass(paste(baseFilename, "t2m", sep="."), 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(paste(baseFilename, "img", sep="."), 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(data=list(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) } } return(l) } MALDIquantForeign/R/importAuto-functions.R0000644000175000017500000000421412346616745021507 0ustar sebastiansebastian## 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 #' @keywords internal .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) if (verbose) { message(n[m], " files of type=", sQuote(importFormats$type[m]), " found.") } return(import(path=files[[m]], type=importFormats$type[m], pattern=importFormats$pattern[m], removeEmptySpectra=removeEmptySpectra, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose, ...)) } #' @keywords internal # 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 return(files[isCiphergen]) } MALDIquantForeign/R/filename-methods.R0000644000175000017500000000376712346616745020573 0ustar sebastiansebastian## 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}} #' @keywords internal #' @aliases .composeFilename,AbstractMassObject-method #' @aliases .composeFilename,list-method #' @docType methods #' @rdname composeFilename-methods 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]) } filename <- paste(filename, fileExtension, sep=".") return(filename) }) 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.R0000644000175000017500000000257312356055511022001 0ustar sebastiansebastian## 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 #' @keywords internal .testChecksum <- function(file, target, algo="sda1", ..., verbose=FALSE) { if (verbose) { message("Calculating ", algo, "-sum for ", sQuote(file), ": ", appendLF=FALSE) } fileChecksum <- tolower(digest::digest(file, algo=algo, file=TRUE, ...)) target <- tolower(target) if (verbose) { message(fileChecksum) } if (fileChecksum != target) { warning("Stored and calculated ", algo, " sums do not match ", "(stored: ", sQuote(target), ", calculated: ", sQuote(fileChecksum), ")!") return(FALSE) } return(TRUE) } MALDIquantForeign/R/package.R0000644000175000017500000000313012346616745016725 0ustar sebastiansebastian## 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 #' Import/Export routines for MALDIquant #' #' This package reads and writes different file formats of mass #' spectrometry data into/from MALDIquant objects. #' #' \tabular{ll}{ #' Package: \tab MALDIquantForeign \cr #' License: \tab GPL (>= 3)\cr #' URL: \tab http://strimmerlab.org/software/maldiquant/\cr #' } #' #' @docType package #' @name MALDIquantForeign-package #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references \url{http://strimmerlab.org/software/maldiquant/} #' @keywords package #' #' @import MALDIquant #' @import readMzXmlData #' @import methods #' @importFrom base64enc base64encode #' @importFrom digest digest #' @importFrom downloader download #' @importFrom readBrukerFlexData readBrukerFlexFile #' @importFrom XML xmlEventParse xmlParse xmlValue xpathApply xpathSApply #' NULL MALDIquantForeign/R/mzMl-functions.R0000644000175000017500000002514112346616745020265 0ustar sebastiansebastian## 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 .writeMzMlDocument <- function(x, file, id, 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) .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) .writeMzMlFileDescription(x, file=f) .writeMzMlSoftwareList(x, file=f) .writeMzMlInstrumentConfigurationList(x, file=f) .writeMzMlDataProcessingList(x, file=f) .writeMzMlRun(x, file=f) .writeCloseXmlTag("mzML", file=f) invisible(close(f)) } .writeMzMlCvList <- function(file) { 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")) .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) { .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) .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) { .writeXmlTag("run", attrs=c(id="run0", defaultInstrumentConfigurationRef="IC0"), intend=1, close=FALSE, file=file) .writeMzMlSpectrumList(x, file=file) .writeCloseXmlTag("run", intend=1, file=file) } .writeMzMlSpectrumList <- function(x, file) { .writeXmlTag("spectrumList", attrs=c(count=length(x), defaultDataProcessingRef="export"), intend=2, close=FALSE, file=file) for (i in seq(along=x)) { .writeXmlTag("spectrum", intend=3, attrs=c(index=i-1, id=paste0("scan=", i-1), 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) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000285", name="total ion current", value=totalIonCurrent(x[[i]])), file=file) if (MALDIquant::isMassSpectrum(x[[i]])) { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000128", name="profile spectrum"), file=file) } else { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000127", name="centroid spectrum"), file=file) } .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) }