MALDIquantForeign/0000755000176200001440000000000013425002121013451 5ustar liggesusersMALDIquantForeign/inst/0000755000176200001440000000000013424407626014450 5ustar liggesusersMALDIquantForeign/inst/exampledata/0000755000176200001440000000000013341755164016736 5ustar liggesusersMALDIquantForeign/inst/exampledata/tiny_continuous.ibd0000644000176200001440000000021013211235236022645 0ustar liggesusers4VxLޯ4Vx?@@@@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/tiny1-centroided.mzML1.1.mzML0000644000176200001440000000753213211235236024013 0ustar liggesusers AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/csv1.csv0000644000176200001440000000006413341754745020333 0ustar liggesusers# foo # bar "mass","intensity" 1,6 2,7 3,8 4,9 5,10 MALDIquantForeign/inst/exampledata/tiny1-centroided.mzXML3.0.mzXML0000644000176200001440000000316613211235236024273 0ustar liggesusers P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 1cf2b3695447d2dd698b465e27f452a80192dd62 MALDIquantForeign/inst/exampledata/tiny1.mzXML3.0.mzXML0000644000176200001440000000313413211235236022150 0ustar liggesusers P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 b87b09a4f34561d5572f9a6d30056106f819bc69 MALDIquantForeign/inst/exampledata/tiny1.msd0000644000176200001440000000106713211235236020500 0ustar liggesusers tiny eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== MALDIquantForeign/inst/exampledata/tiny1.mzML1.1.mzML0000644000176200001440000000673013211235236021674 0ustar liggesusers AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/tiny_processed.ibd0000644000176200001440000000026013211235236022433 0ustar liggesusers4VxLޯ4Vx?@@@@@@ @"@$@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/tiny_continuous.imzML0000644000176200001440000001235413211235236023153 0ustar liggesusers MALDIquantForeign/inst/exampledata/ascii.txt0000644000176200001440000000002513211235236020551 0ustar liggesusers1 6 2 7 3 8 4 9 5 10 MALDIquantForeign/inst/exampledata/tiny.cdf0000644000176200001440000000071413211235236020366 0ustar liggesusersCDF  scan_number point_number  scan_index4 point_count<scan_acquisition_timeD mass_valuesTintensity_values\?@? @ @ @@@@@ @"@$MALDIquantForeign/inst/exampledata/ciphergen/0000755000176200001440000000000013211235236020667 5ustar liggesusersMALDIquantForeign/inst/exampledata/ciphergen/tiny.xml0000644000176200001440000000153513211235236022400 0ustar liggesusers tiny example 20000 2.5e+008 Quadratic 24000000 0.0013 0 20000 hand made 1 false 1 2 3 4 5 MALDIquantForeign/inst/exampledata/brukerflex/0000755000176200001440000000000013211235236021074 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/0000755000176200001440000000000013211235236021554 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/0000755000176200001440000000000013211235236021714 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/0000755000176200001440000000000013211235236022642 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/fid0000644000176200001440000000002413211235236023323 0ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/acqu0000644000176200001440000000071113211235236023515 0ustar liggesusers##.SPECTROMETER TYPE= TOF ##.IONIZATION MODE= LD+ ##$AQOP_m= 0 ##$BYTORDA= 0 ##$CMT1= TESTSAMPLE1 ##$CMT2= TESTSAMPLE2 ##$CMT3= TESTSAMPLE3 ##$CMT4= TESTSAMPLE4 ##$DELAY= 10000 ##$DW= 20 ##$HPClBHi= 0 ##$HPClBLo= 0 ##$HPClOrd= 0 ##$HPClUse= no ##$Lift1= 0 ##$Lift2= 0 ##$ML1= 2400000 ##$ML1_raw= 2400000 ##$ML2= 280 ##$ML2_raw= 280 ##$ML3= -0.0013 ##$ML3_raw= -0.0013 ##$NoSHOTS= 100 ##$SPType= 0 ##$TD= 5 ##$TLift= 0 MALDIquantForeign/inst/exampledata/compressed/0000755000176200001440000000000013341755345021103 5ustar liggesusersMALDIquantForeign/inst/exampledata/compressed/csv.zip0000644000176200001440000000033213341755332022414 0ustar liggesusersPK nM'44csv1.csvUT ڇ[ڇ[ux # foo # bar "mass","intensity" 1,6 2,7 3,8 4,9 5,10 PK nM'44csv1.csvUTڇ[ux PKNvMALDIquantForeign/inst/exampledata/compressed/csv1.csv.gz0000644000176200001440000000012113341751101023067 0ustar liggesusersA҇[csv1.csvSVHRVHJ,RM,.VQ+I+,T21212ֱ2ѱ214'4MALDIquantForeign/inst/exampledata/compressed/csv.tar.gz0000644000176200001440000000026013341755345023023 0ustar liggesusersڇ[csv.tarν 0̹AST` M{+"S}ӗ*6dW)G6|JA8z>Daw) er)5/J2t1OQy"9:Le7-IroZAs8+ O(MALDIquantForeign/inst/exampledata/tiny1-compressed.mzML1.1.mzML0000644000176200001440000000665413211235236024043 0ustar liggesusers eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYAABFQcwxaAEpRWgtAyUlnAAACEsAds= MALDIquantForeign/inst/exampledata/tiny1-compressed.mzXML3.0.mzXML0000644000176200001440000000304413211235236024312 0ustar liggesusers eJyz/8AABg4SUJoBSstAaQ4orQClBaC0EpQWgdIqEBoA0joENg== 0 0 7e7ef0ea030f6a56d34a4ebd446e22b22844d432 MALDIquantForeign/inst/exampledata/csv2.csv0000644000176200001440000000002513211235236020312 0ustar liggesusers1;6 2;7 3;8 4;9 5;10 MALDIquantForeign/inst/exampledata/tiny_processed.imzML0000644000176200001440000001235413211235236022734 0ustar liggesusers MALDIquantForeign/inst/doc/0000755000176200001440000000000013424407626015215 5ustar liggesusersMALDIquantForeign/inst/doc/MALDIquantForeign-intro.Rnw0000644000176200001440000001370413211235236022242 0ustar liggesusers%\VignetteEngine{knitr} %\VignetteIndexEntry{MALDIquantForeign: Import/Export routines for MALDIquant} %\VignetteKeywords{Bioinformatics, Proteomics, Mass Spectrometry} %\VignettePackage{MALDIquantForeign} \documentclass[12pt]{article} \usepackage{natbib} \usepackage{hyperref} \usepackage{tikz} \usepackage{bibentry} % inline bibentries \nobibliography* % no special bibliography for bibentry \newcommand{\R}{\texttt{R}} \newcommand{\CRAN}{\texttt{CRAN}} \newcommand{\Rfunction}[1]{{\texttt{#1}}} \newcommand{\Robject}[1]{{\texttt{#1}}} \newcommand{\Rpackage}[1]{{\texttt{#1}}} \newcommand{\Mq}{\Rpackage{MALDIquant}} \newcommand{\MqF}{\Rpackage{MALDIquantForeign}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \title{\MqF{}: Import/Export routines for \Mq{}} \author{ Sebastian Gibb% \thanks{\email{mail@sebastiangibb.de}} } \date{\today} \begin{document} <>= library("knitr") opts_chunk$set(tidy.opts=list(width.cutoff=45), tidy=FALSE, fig.align="center", fig.height=4.25, comment=NA, prompt=TRUE) @ <>= suppressPackageStartupMessages(library("MALDIquant")) suppressPackageStartupMessages(library("MALDIquantForeign")) @ \maketitle \begin{abstract} \MqF{} provides routines for importing/exporting different file formats into/from \Mq{}.\\ This vignette describes the usage of the \MqF{} package. \end{abstract} \clearpage \tableofcontents \section*{Foreword} \MqF{} is free and open source software for the \R{} \citep{RPROJECT} environment and under active development. If you use it, please support the project by citing it in publications: \begin{quote} \bibentry{MALDIquant} \end{quote} If you have any questions, bugs, or suggestions do not hesitate to contact me (\email{mail@sebastiangibb.de}). \\ Please visit \url{http://strimmerlab.org/software/maldiquant/}. \section{Introduction} \Mq{} should be device and platform independent. That's why it has not any import/export functions. \\ \MqF{} fills this gap and provides import/export routines for various file formats: <>= supportedFileFormats() @ \section{Setup} After starting \R{} we could install \Mq{} and \MqF{} directly from \CRAN{} using \Rfunction{install.packages}: <>= install.packages(c("MALDIquant", "MALDIquantForeign")) @ Before we can use \Mq{} and \MqF{} we have to load the packages. <>= library("MALDIquant") library("MALDIquantForeign") @ \section{Import} \MqF{} provides an \Rfunction{import} function that tries to auto-detect the correct file type. Because this would never be perfect \MqF{} offers also many \Rfunction{import*} functions like \Rfunction{importBrukerFlex}, \Rfunction{importMzMl}, etc. Please see the manual page of \Rfunction{import} for a complete list (\Rfunction{?import}).\\ First we try to import some example data in Bruker Daltonics *flex-series file format using the \Rfunction{import} function. <>= ## get the example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") spectra <- import(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ Next we use the \Rfunction{importBrukerFlex} function (the result is the same as above). <>= spectra <- importBrukerFlex(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ \MqF{} supports compressed files, too (\emph{zip}, \emph{tar.\{bz2, gz,xz\}}). <>= spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.tar.gz"), verbose=FALSE) spectra[[1]] spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.zip"), verbose=FALSE) spectra[[1]] @ Remote files are supported as well. Data are taken from \citet{Tan2006}. <>= spectra <- import(paste0("http://www.meb.ki.se/", "~yudpaw/papers/spikein_xml.zip"), centroided=FALSE, verbose=TRUE) @ If you want to read peak lists (centroided data) instead of spectra data you have to set \Rfunction{centroided=TRUE}. <>= peaks <- import(file.path(exampleDirectory, "ascii.txt"), centroided=TRUE, verbose=FALSE) peaks @ \section{Export} The export routines in \MqF{} are very similar to the import routines. Please see manual page of \Rfunction{export} for a complete list of supported export routines (\Rfunction{?export}). First we create a simple list of \Robject{MassSpectrum} objects using \Rfunction{createMassSpectrum}. <>= spectra <- list( createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) @ Now we want to export the first spectrum into a CSV file. <>= export(spectra[[1]], file="spectrum1.csv") import("spectrum1.csv") @ Exporting every file by hand is cumbersome. We want to export the whole list of spectra. Instead of \Robject{file} we use \Robject{path} now to specify a directory. Please note that we have to add the file type/format information now (we can use the \Robject{type} argument or the corresponding \Rfunction{export*} function). If the path doesn't exists we will get an error. To force \Rfunction{export} to create/overwrite the given path, we set the argument \Robject{force=TRUE}. <>= export(spectra, type="csv", path="spectra", force=TRUE) list.files("spectra") @ \section{Analyse Mass Spectrometry Data} Please have a look at the corresponding vignette shipped with \Mq{} and the \Mq{} website: \url{http://strimmerlab.org/software/maldiquant/}. <>= vignette(topic="MALDIquant", package="MALDIquant") @ \section{Session Information} <>= toLatex(sessionInfo(), locale=FALSE) @ \bibliographystyle{apalike} \bibliography{bibliography} \end{document} MALDIquantForeign/inst/doc/MALDIquantForeign-intro.R0000644000176200001440000000552513424407624021707 0ustar liggesusers## ----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.pdf0000644000176200001440000042306413424407626022263 0ustar liggesusers%PDF-1.5 % 33 0 obj << /Length 610 /Filter /FlateDecode >> stream xڅTMo0 Wh3#,kahn]Nbu}Q&],A|(.gl~" ΑUJ+-jV7׳/>?h4J5yf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Ć=Qt^/&W#OToP^OB:܎ƠQ2} 7{o~uzCs,L68xwzoWj<.kW?!gި6zAvp O pF o0Agov˯ώ^`jOMCw=НiC+з֣C~dtO}qK؄-2x+59;c=N>IkrBVzt!Пڼ_J*w7v1؟^={s#? 79T:*7 6z+}{2s;[qltǶ>AGiFXeGټ:81<(>sw|]3 {SܞZ]۳d.seNj1-wd_Vwݭ.5Wv=nkfgܥiq7s$.s}uJ;I]k&G%pKC.5~%ִMNmϾlά uKo?! endstream endobj 139 0 obj << /Author()/Title()/Subject()/Creator(LaTeX with hyperref)/Producer(pdfTeX-1.40.19)/Keywords() /CreationDate (D:20190130215654+01'00') /ModDate (D:20190130215654+01'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) kpathsea version 6.3.1/dev) >> endobj 130 0 obj << /Type /ObjStm /N 17 /First 128 /Length 552 /Filter /FlateDecode >> stream xڅMo0 <&VP 6ET N;GY+Iv)R|QL! ` * 3`g PД  YR$ T.jIH 2i_Ƨ6Iҧ|$Oe *!h`ߊ ~{ UcT0э1ܛ]@%N!DPTҋ>ǪiZn',f \tP*z)^bGe:ksԃk8mqC8 Fҟ8 B4JkQJ貞e6qNk&yKmjdky3+t+u)Jܦ.9mP(F0 b^(t(ūGgfȥcblbR%+FᛤG&h4Sty^6 ꭻu(}?n{ؿGY>7 endstream endobj 140 0 obj << /Type /XRef /Index [0 141] /Size 141 /W [1 3 1] /Root 138 0 R /Info 139 0 R /ID [ ] /Length 349 /Filter /FlateDecode >> stream x%ҷNQ &`9G !h)i頡 BtvfvDD~<CD=BTRH aj$$A'5Kְ}lJ:d@&dAd]!vv, !EP %P Ahʠ*!P*)>;Q*YUhfh6hR?XF]%lnj'*1LL ,’JT,-\XZQUwKkKKOKMy[7U߮-p{OPGJ9± ep,c+rԫ[W3 endstream endobj startxref 140247 %%EOF MALDIquantForeign/tests/0000755000176200001440000000000013211235236014623 5ustar liggesusersMALDIquantForeign/tests/testthat.R0000644000176200001440000000006413211235236016606 0ustar liggesuserslibrary("testthat") test_check("MALDIquantForeign") MALDIquantForeign/tests/testthat/0000755000176200001440000000000013425002121016453 5ustar liggesusersMALDIquantForeign/tests/testthat/test_list.files-functions.R0000644000176200001440000000167113211235236023734 0ustar liggesuserscontext("list.files") test_that("list.files-functions", { path <- normalizePath(system.file("exampledata", package="MALDIquantForeign")) expect_identical(MALDIquantForeign:::.list.files(path, pattern="tiny1-c"), normalizePath(file.path(path, c("tiny1-centroided.mzML1.1.mzML", "tiny1-centroided.mzXML3.0.mzXML", "tiny1-compressed.mzML1.1.mzML", "tiny1-compressed.mzXML3.0.mzXML")))) expect_identical(MALDIquantForeign:::.list.files(path, pattern="tiny1-c", excludePattern="\\.mzXML$"), normalizePath(file.path(path, c("tiny1-centroided.mzML1.1.mzML", "tiny1-compressed.mzML1.1.mzML")))) }) MALDIquantForeign/tests/testthat/test_exportMsd-methods.R0000644000176200001440000000506513211235236023301 0ustar liggesuserscontext("exportMsd") m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(owner="OWNER", institution="INSTITUTION", instrument="INSTRUMENT")) p <- createMassPeaks(mass=4:5, intensity=9:10, snr=1:2) tmp <- tempdir() msd <- c( "", "", " ", " tmp.msd", " ", " ", " ", " ", " ", " ", " ", " ", " eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw=", " eJxjYAABCQcwxSADpRWgtBKUVnEAAB9MAds=", " ", " ", " ", " ", " ", "") if (.Platform$endian == "big") { msd[13:14] <- c( " eJyz/8AABg4MUJoDSgtAaREIDQBExAJc", " eJxzkGAAAwcZKK0ApZWgtAqEBgArDgHb") } test_that(".exportMsd", { MALDIquantForeign:::.exportMsd(m, file=file.path(tmp, "m.msd"), peaks=p) expect_equal(readLines(file.path(tmp, "m.msd"))[-c(4:5)], msd[-c(4:5)]) }) test_that("exportMsd,MassSpectrum", { MALDIquantForeign::exportMsd(m, file=file.path(tmp, "msp.msd"), peaks=p) expect_equal(readLines(file.path(tmp, "msp.msd"))[-c(4:5)], msd[-c(4:5)]) MALDIquantForeign::exportMsd(m, file=file.path(tmp, "ms.msd")) expect_equal(readLines(file.path(tmp, "ms.msd"))[-c(4:5)], msd[-c(4:5, 16:19)]) }) test_that("exportMsd,list", { spectra <- list(m, m) peaks <- list(p, p) MALDIquantForeign::exportMsd(spectra, path=tmp, force=TRUE, peaks=peaks) expect_equal(readLines(file.path(tmp, "1.msd"))[-c(4:5)], msd[-c(4:5)]) expect_equal(readLines(file.path(tmp, "2.msd"))[-c(4:5)], msd[-c(4:5)]) MALDIquantForeign::exportMsd(spectra, path=tmp, force=TRUE) expect_equal(readLines(file.path(tmp, "1.msd"))[-c(4:5)], msd[-c(4:5, 16:19)]) expect_equal(readLines(file.path(tmp, "2.msd"))[-c(4:5)], msd[-c(4:5, 16:19)]) }) test_that(".createMsdTitle", { f <- file(file.path(tempdir(), "test.msd")) expect_true(MALDIquantForeign:::.createMsdTitle(f) == "test") close(f) }) MALDIquantForeign/tests/testthat/test_exportImzMl-methods.R0000644000176200001440000002106013330400263023573 0ustar liggesuserscontext("exportImzMl") tmp <- tempdir() imzML <- c( "", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", paste0(" "), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", "") test_that(".exportImzMl", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) expect_error(MALDIquantForeign:::.exportImzMl(m, file=file.path(tmp, "m.imzML")), "The spectra contain no imaging information.") MALDIquantForeign:::.exportImzMl(m, file=file.path(tmp, "m.imzML"), coordinates=cbind(1, 1), uuid="12345678-90ab-4cde-af12-34567890abcd") expect_equal(readLines(file.path(tmp, "m.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"m\"", x=imzML)) }) test_that("exportImzMl,MassSpectrum", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) expect_error(MALDIquantForeign::exportImzMl(m, file=file.path(tmp, "ms.imzML")), "The spectra contain no imaging information.") MALDIquantForeign::exportImzMl(m, file=file.path(tmp, "ms.imzML"), coordinates=cbind(1, 1), uuid="12345678-90ab-4cde-af12-34567890abcd") expect_equal(readLines(file.path(tmp, "ms.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"ms\"", x=imzML)) }) test_that("exportImzMl,list", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid", imaging=list(pos=c(1, 1), pixelSize=c(100, 100), size=c(1, 1), dim=c(100, 100)))) spectra <- list(m, m) MALDIquantForeign::exportImzMl(spectra, path=tmp, force=TRUE, uuid="12345678-90ab-4cde-af12-34567890abcd") expect_equal(readLines(file.path(tmp, "TESTS_1.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_1\"", x=imzML)) expect_equal(readLines(file.path(tmp, "TESTS_2.imzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_2\"", x=imzML)) }) MALDIquantForeign/tests/testthat/test_importBrukerFlex-functions.R0000644000176200001440000000135313211235236025161 0ustar liggesuserscontext("importBrukerFlex") test_that("importBrukerFlex", { expect_error(MALDIquantForeign:::.importBrukerFlex("tmp.tmp")) path <- system.file( file.path("exampledata", "brukerflex", "0_A1", "1", "1SLin", "fid"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importBrukerFlex(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importBrukerFlex(path, verbose=FALSE)) expect_equal(s, import(path, type="fid", verbose=FALSE)) expect_equal(trunc(mass(s[[1]])), 226:230) expect_equal(intensity(s[[1]]), 1:5) expect_equal(basename(metaData(s[[1]])$file), "fid") expect_equal(metaData(s[[1]])$laserShots, 100) expect_equal(metaData(s[[1]])$comments, paste0("TESTSAMPLE", 1:4)) }) MALDIquantForeign/tests/testthat/test_testChecksum-functions.R0000644000176200001440000000145113211235236024316 0ustar liggesuserscontext("testChecksum") test_that("testChecksum-functions", { f <- normalizePath(system.file( file.path("exampledata", "ascii.txt"), package="MALDIquantForeign")) md5 <- "9274dd34d675950326a222a952309a17" sha1 <- "85572c8d56504d8bba2afb32d7d7df35fb127ab8" expect_true(MALDIquantForeign:::.testChecksum(f, md5, algo="md5")) expect_true(MALDIquantForeign:::.testChecksum(f, sha1, algo="sha1")) expect_false(suppressWarnings( MALDIquantForeign:::.testChecksum(f, "12345", algo="sha1"))) expect_warning(MALDIquantForeign:::.testChecksum(f, "12345", algo="sha1"), "Stored and calculated sha1 sums do not match") expect_warning(MALDIquantForeign:::.testChecksum(f, "12345", algo="md5"), "Stored and calculated md5 sums do not match") }) MALDIquantForeign/tests/testthat/test_msg-functions.R0000644000176200001440000000037213211235236022443 0ustar liggesuserscontext("msg") test_that("msg-functions", { expect_message(MALDIquantForeign:::.msg(TRUE, "foobar"), "foobar") expect_message(MALDIquantForeign:::.msg(TRUE, "foo", "bar"), "foobar") expect_silent(MALDIquantForeign:::.msg(FALSE, "foobar")) }) MALDIquantForeign/tests/testthat/test_importCdf-functions.R0000644000176200001440000000416713211235236023612 0ustar liggesuserscontext("importCdf") ## create NetCDF test file # #library("RNetCDF") #nc <- create.nc("tiny.cdf") # #dim.def.nc(nc, "scan_number", 2) #dim.def.nc(nc, "point_number", 10, unlim=TRUE) # #var.def.nc(nc, "scan_index", "NC_INT", "scan_number") #var.def.nc(nc, "point_count", "NC_INT", "scan_number") #var.def.nc(nc, "scan_acquisition_time", "NC_DOUBLE", "scan_number") # #var.def.nc(nc, "mass_values", "NC_DOUBLE", "point_number") #var.def.nc(nc, "intensity_values", "NC_INT", "point_number") # #var.put.nc(nc, "scan_index", c(0,5)) #var.put.nc(nc, "point_count", c(5, 5)) #var.put.nc(nc, "scan_acquisition_time", c(1, 2)) # #var.put.nc(nc, "mass_values", 1:5, start=1, count=5) #var.put.nc(nc, "mass_values", 6:10, start=6, count=5) #var.put.nc(nc, "intensity_values", 11:15, start=1, count=5) #var.put.nc(nc, "intensity_values", 16:20, start=6, count=5) # #close.nc(nc) # test_that("importCdf", { path <- normalizePath(system.file(file.path("exampledata", "tiny.cdf"), package="MALDIquantForeign")) if (suppressWarnings(require("RNetCDF", quietly=TRUE))) { ## suppress warnings to avoid creation of Rplots.pdf expect_error(suppressWarnings(MALDIquantForeign:::.importCdf("tmp.tmp"))) r <- list(createMassSpectrum(mass=1:5, intensity=11:15, metaData=list(file=path, number=1, retentionTime=1, scanIndex=0)), createMassSpectrum(mass=6:10, intensity=16:20, metaData=list(file=path, number=2, retentionTime=2, scanIndex=5))) s <- MALDIquantForeign:::.importCdf(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importCdf(path, verbose=FALSE)) expect_equal(s, import(path, type="cdf", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 11:15) expect_equal(basename(metaData(s[[1]])$file), "tiny.cdf") expect_equal(s, r) } else { expect_error(suppressWarnings(MALDIquantForeign:::.importCdf(path)), "install.packages") } }) MALDIquantForeign/tests/testthat/test_createMassObject-functions.R0000644000176200001440000000340113211235236025067 0ustar liggesuserscontext("createMassObject") test_that(".createMassObject", { expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list()))) expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(), centroided=FALSE))) expect_warning(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(dataProcessing=list(centroided=0)), centroided=TRUE), paste0("According to the metadata information the imported data are ", "not centroided.")) expect_warning(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(centroided="1")), paste0("According to the metadata information the imported data are ", "centroided.")) expect_true(suppressWarnings(isMassPeaks( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(), centroided=TRUE)))) expect_true(suppressWarnings(isMassPeaks( MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, metaData=list(dataProcessing=list(centroided="1")), centroided=TRUE)))) expect_true(isMassSpectrum( MALDIquantForeign:::.createMassObject( mass=c(1, 5, 7), intensity=1:3, metaData=list()))) expect_equal(mass(MALDIquantForeign:::.createMassObject( mass=1:10, intensity=1:10, massRange=c(4, 8))), 4:8) expect_equal(intensity(MALDIquantForeign:::.createMassObject( mass=1:10, intensity=1:10, minIntensity=5)), 5:10) expect_equal(snr(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, snr=5:1, centroided=TRUE)), 5:1) expect_equal(snr(MALDIquantForeign:::.createMassObject( mass=1:5, intensity=1:5, centroided=TRUE)), rep(NA_real_, 5)) }) MALDIquantForeign/tests/testthat/test_download-functions.R0000644000176200001440000000331013341767210023465 0ustar liggesuserscontext("download") url <- c("http://www.tld.com/", "https://www.tld.com/archive.zip", "ftp://ftp.tld.com", "/data/archive.zip", "/root", "/dev/data.csv") test_that(".isUrl", { expect_identical(MALDIquantForeign:::.isUrl(url), c(rep(TRUE, 3), rep(FALSE, 3))) }) test_that(".download", { skip_on_cran() urls <- c("https://raw.githubusercontent.com/sgibb/MALDIquantForeign/master/inst/exampledata/ascii.txt", "https://raw.githubusercontent.com/sgibb/MALDIquantForeign/master/inst/exampledata/csv1.csv") tmpdir <- tempdir() ascii <- data.frame(V1=1:5, V2=6:10) csv <- data.frame(mass=1:5, intensity=6:10) expect_identical(read.table( MALDIquantForeign:::.download(urls[1], file.path(tmpdir, "a.txt"))), ascii) expect_identical(read.table(MALDIquantForeign:::.download(urls[1])), ascii) expect_true(all(grepl(paste("^a\\.txt$", "^MALDIquantForeign_download/ascii_.*\\.txt$", "^MALDIquantForeign_download/csv1_.*\\.csv$", sep="|"), list.files(tmpdir, recursive=TRUE)))) files <- MALDIquantForeign:::.download(urls) expect_identical(list(read.table(files[1]), read.csv(files[2], comment.char="#")), list(ascii, csv)) expect_message(MALDIquantForeign:::.download(urls[1], file.path(tmpdir, "a.txt"), verbose=TRUE), paste0("Downloading ", urls[1], " to ", file.path(tmpdir, "a.txt"), "\\.")) }) MALDIquantForeign/tests/testthat/test_importMzMl-functions.R0000644000176200001440000000543713211235236023776 0ustar liggesuserscontext("importMzMl") test_that("importMzMl", { expect_error(MALDIquantForeign:::.importMzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1.mzML1.1.mzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importMzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="mzML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1.mzML1.1.mzML") expect_true(isMassSpectrum(s[[2]])) expect_equal(mass(s[[2]]), 1:5) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny1.mzML1.1.mzML") }) test_that("importMzMl compressed", { expect_error(MALDIquantForeign:::.importMzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1-compressed.mzML1.1.mzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importMzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="mzML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1-compressed.mzML1.1.mzML") expect_true(isMassSpectrum(s[[2]])) expect_equal(mass(s[[2]]), 1:5) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny1-compressed.mzML1.1.mzML") }) test_that("importMzMl centroided", { expect_error(MALDIquantForeign:::.importMzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1-centroided.mzML1.1.mzML"), package="MALDIquantForeign")) p <- MALDIquantForeign:::.importMzMl(path, centroided=TRUE, verbose=FALSE) expect_equal(p, import(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, importMzMl(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, import(path, type="mzML", centroided=TRUE, verbose=FALSE)) expect_true(isMassPeaks(p[[1]])) expect_equal(mass(p[[1]]), 1:5) expect_equal(intensity(p[[1]]), 6:10) expect_equal(basename(metaData(p[[1]])$file), "tiny1-centroided.mzML1.1.mzML") expect_true(isMassPeaks(p[[2]])) expect_equal(mass(p[[2]]), 1:5) expect_equal(intensity(p[[2]]), 10:6) expect_equal(basename(metaData(p[[2]])$file), "tiny1-centroided.mzML1.1.mzML") ## overwrite default arguments path <- normalizePath(system.file( file.path("exampledata", "tiny1.mzML1.1.mzML"), package="MALDIquantForeign")) expect_true(all(sapply(MALDIquantForeign:::.importMzMl(path, centroided=TRUE), isMassPeaks))) }) MALDIquantForeign/tests/testthat/test_importCiphergenXml-functions.R0000644000176200001440000000135713211235236025501 0ustar liggesuserscontext("importCiphergenXml") test_that("importCiphergenXml", { expect_error(MALDIquantForeign:::.importCiphergenXml("tmp.tmp")) path <- system.file(file.path("exampledata", "ciphergen", "tiny.xml"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importCiphergenXml(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importCiphergenXml(path, verbose=FALSE)) expect_equal(s, import(path, type="ciph", verbose=FALSE)) expect_equal(trunc(mass(s[[1]])), rep(26, 5)) expect_false(all(mass(s[[1]])[1] == mass(s[[1]]))) expect_equal(intensity(s[[1]]), 1:5) expect_equal(basename(metaData(s[[1]])$file), "tiny.xml") expect_equal(metaData(s[[1]])$name, "tiny example") }) MALDIquantForeign/tests/testthat/test_exportTab-methods.R0000644000176200001440000000235413211235236023262 0ustar liggesuserscontext("exportTab") m <- createMassSpectrum(mass=1:5, intensity=6:10) r <- data.frame(V1=1:5, V2=6:10) test_that(".exportTab", { temp <- tempfile() MALDIquantForeign:::.exportTab(m, file=temp) ## didn't work on win-builder.r-project.org ## (but on local linux and windows install (both R 2.15.2) #expect_equivalent(tools::md5sum(temp), tools::md5sum(file.path("data", # "ascii.txt"))) expect_equal(read.table(temp), r) }) test_that("exportTab,MassSpectrum", { temp <- tempfile() MALDIquantForeign::exportTab(m, file=temp) expect_equal(read.table(temp), r) }) test_that(".exportCsv", { temp <- tempfile() MALDIquantForeign:::.exportCsv(m, file=temp) ## didn't work on win-builder.r-project.org ## (but on local linux and windows install (both R 2.15.2) #expect_equivalent(tools::md5sum(temp), tools::md5sum(file.path("data", # "csv1.csv"))) colnames(r) <- c("mass", "intensity") expect_equal(read.csv(temp), r) }) test_that("exportCsv,MassSpectrum", { temp <- tempfile() MALDIquantForeign::exportCsv(m, file=temp) colnames(r) <- c("mass", "intensity") expect_equal(read.csv(temp), r) }) MALDIquantForeign/tests/testthat/test_filename-functions.R0000644000176200001440000000536313211235236023442 0ustar liggesuserscontext("filename") test_that(".cleanFilename", { expect_identical(MALDIquantForeign:::.cleanFilename( "/home/a:/\"foo&bar\"/g.\\23!/ foo-bar?.txt"), "_home_a_foo_bar_g_23_foo_bar_txt") }) test_that("file extension is returned", { expect_identical(MALDIquantForeign:::.fileExtension("~/foo.txt"), "txt") expect_identical(MALDIquantForeign:::.fileExtension( c("/etc/a.conf", "b.pdf")), c("conf", "pdf")) }) test_that("file name is returned", { expect_identical(MALDIquantForeign:::.fileExtension("~/foo"), "foo") }) test_that("path without extension is returned", { expect_identical(MALDIquantForeign:::.withoutFileExtension( c("~/foo", "/home/user/xyz.tar.gz", "/tmp/bar.txt")), c("~", "/home/user/xyz", "/tmp/bar")) }) test_that("file extension is changed", { expect_identical(MALDIquantForeign:::.changeFileExtension( c("/home/user/xyz.tar.gz", "/tmp/bar.txt"), c("txt", "csv")), c("/home/user/xyz.txt", "/tmp/bar.csv")) }) test_that(".cutFilenames", { expect_identical(MALDIquantForeign:::.cutFilenames( c("/home/user/foo.bar", "/home/user/xyz.tar.gz")), c("foo.bar", "xyz.tar.gz")) expect_identical(MALDIquantForeign:::.cutFilenames( c("/home/user/foo.bar", "/home/user/foo.bar")), c("foo.bar", "foo.bar")) }) test_that(".composeFilenames", { s <- createMassSpectrum(mass=1:5, intensity=1:5, metaData=list(file="/foo/bar.txt")) expect_identical(MALDIquantForeign:::.composeFilename(s), "/foo/bar.csv") expect_identical(MALDIquantForeign:::.composeFilename(s, fileExtension="xml"), "/foo/bar.xml") metaData(s) <- list(fullName="foo") expect_identical(MALDIquantForeign:::.composeFilename(s), "foo.csv") metaData(s) <- list(fullName=c("foo", "bar")) expect_identical(MALDIquantForeign:::.composeFilename(s), "foo_bar.csv") }) test_that(".uniqueBaseFilenames", { expect_identical(MALDIquantForeign:::.uniqueBaseFilenames( c("/home/user/foo.bar", "/home/user/foo.bar"), fileExtension="txt"), c("foo_1.txt", "foo_2.txt")) expect_identical(MALDIquantForeign:::.uniqueBaseFilenames( c("", "")), c("1.csv", "2.csv")) }) test_that(".make.unique", { expect_equal(MALDIquantForeign:::.make.unique(LETTERS[1:5]), LETTERS[1:5]) expect_equal(MALDIquantForeign:::.make.unique(rep(LETTERS[1:5], each=2)), paste(rep(LETTERS[1:5], each=2), 1:2, sep="_")) expect_equal(MALDIquantForeign:::.make.unique(rep(LETTERS[1:2], each=10)), sprintf("%s_%02d", rep(LETTERS[1:2], each=10), 1:10)) }) MALDIquantForeign/tests/testthat/test_mzMl-functions.R0000644000176200001440000000113513302527262022576 0ustar liggesuserscontext("mzMl") test_that(".writeImzMlScanList", { m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(imaging=list(pos=c(x=1e8, y=1e8)))) f <- file.path(tempdir(), "imzlscanlist") r <- c( " ", " ", " ", " ", " ", " " ) MALDIquantForeign:::.writeImzMlScanList(m, file=f) expect_equal(readLines(f), r) }) MALDIquantForeign/tests/testthat/test_importMzXml-functions.R0000644000176200001440000000400513211235236024154 0ustar liggesuserscontext("importMzXml") test_that("importMzXml", { expect_error(MALDIquantForeign:::.importMzXml("tmp.tmp")) path <- system.file(file.path("exampledata", "tiny1.mzXML3.0.mzXML"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importMzXml(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzXml(path, verbose=FALSE)) expect_equal(s, import(path, type="mzXML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1.mzXML3.0.mzXML") }) test_that("importMzXml compressed", { expect_error(MALDIquantForeign:::.importMzXml("tmp.tmp")) path <- system.file(file.path("exampledata", "tiny1-compressed.mzXML3.0.mzXML"), package="MALDIquantForeign") s <- MALDIquantForeign:::.importMzXml(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMzXml(path, verbose=FALSE)) expect_equal(s, import(path, type="mzXML", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1-compressed.mzXML3.0.mzXML") }) test_that("importMzXml centroided", { expect_error(MALDIquantForeign:::.importMzXml("tmp.tmp")) path <- system.file(file.path("exampledata", "tiny1-centroided.mzXML3.0.mzXML"), package="MALDIquantForeign") p <- MALDIquantForeign:::.importMzXml(path, centroided=TRUE, verbose=FALSE) expect_equal(p, import(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, importMzXml(path, centroided=TRUE, verbose=FALSE)) expect_equal(p, import(path, type="mzXML", centroided=TRUE, verbose=FALSE)) expect_true(isMassPeaks(p[[1]])) expect_equal(mass(p[[1]]), 1:5) expect_equal(intensity(p[[1]]), 6:10) expect_equal(basename(metaData(p[[1]])$file), "tiny1-centroided.mzXML3.0.mzXML") }) MALDIquantForeign/tests/testthat/test_compression-functions.R0000644000176200001440000000616713211235236024226 0ustar liggesuserscontext("compression") z <- c("bz2", "bzip2", "gz", "lzma", "xz") e <- c("zip", z, paste("tar", z, sep="."), "tar", "txt", "mzML") f <- paste(letters[1:13], e, sep=".") test_that(".isCompressed", { expect_identical(MALDIquantForeign:::.isCompressed(f), c(rep(TRUE, 11), rep(FALSE, 3))) }) test_that(".isTar", { expect_identical(MALDIquantForeign:::.isTar(f), c(rep(FALSE, 6), rep(TRUE, 6), rep(FALSE, 2))) }) test_that(".isZip", { expect_identical(MALDIquantForeign:::.isZip(f), c(TRUE, rep(FALSE, 13))) }) test_that(".isPackedOrCompressed", { expect_identical(MALDIquantForeign:::.isPackedOrCompressed(f), c(rep(TRUE, 12), rep(FALSE, 2))) }) test_that(".uncompress supports single file compression by gunzip", { u <- MALDIquantForeign:::.uncompress( system.file(file.path("exampledata", "compressed", "csv1.csv.gz"), package="MALDIquantForeign")) f <- system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign") expect_identical(readLines(u), readLines(f)) expect_identical(MALDIquantForeign:::.uncompress("foobar.txt"), "foobar.txt") expect_error(MALDIquantForeign:::.uncompress("foobar.gz"), ".*foobar.gz.* doesn't exist!") }) test_that(".uncompress supports tar compression by untar", { u <- list.files(MALDIquantForeign:::.uncompress( system.file( file.path("exampledata", "compressed", "csv.tar.gz"), package="MALDIquantForeign")), recursive=TRUE, pattern="^.*\\.csv$", full.names=TRUE)[1] f <- system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign") expect_identical(readLines(u), readLines(f)) }) test_that(".uncompress supports zip compression by unzip", { u <- list.files(MALDIquantForeign:::.uncompress( system.file( file.path("exampledata", "compressed", "csv.zip"), package="MALDIquantForeign")), recursive=TRUE, pattern="^.*\\.csv$", full.names=TRUE)[1] f <- system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign") expect_identical(readLines(u), readLines(f)) expect_error(suppressWarnings(MALDIquantForeign:::.uncompress("foobar.zip")), "unzip failed!") }) test_that(".cleanupUncompressedTmpFiles works", { n <- list.files(file.path(tempdir(), "MALDIquantForeign_uncompress"), recursive=TRUE) expect_true(length(n) > 0) MALDIquantForeign:::.cleanupUncompressedTmpFiles() expect_false(file.exists(file.path(tempdir(), "MALDIquantForeign_uncompress"))) }) test_that("typical auto import", { f <- normalizePath(system.file( file.path("exampledata", "compressed", "csv1.csv.gz"), package="MALDIquantForeign")) s <- createMassSpectrum(mass=1:5, intensity=6:10) i <- import(f)[[1]] metaData(i) <- list() expect_identical(i, s) expect_false(file.exists(file.path(tempdir(), "MALDIquantForeign_uncompress"))) }) MALDIquantForeign/tests/testthat/test_exportMzMl-methods.R0000644000176200001440000001125213330400313023420 0ustar liggesuserscontext("exportMzMl") m <- createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(name="TEST", file="TESTS/fid")) tmp <- tempdir() mzML <- c( "", "", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", paste0(" "), " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw=", " ", " ", " ", " ", " ", " eJxjYAABCQcwxSADpRWgtBKUVnEAAB9MAds=", " ", " ", " ", " ", " ", "") test_that(".exportMzMl", { MALDIquantForeign:::.exportMzMl(m, file=file.path(tmp, "m.mzML")) expect_equal(readLines(file.path(tmp, "m.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"m\"", x=mzML)) }) test_that("exportMzMl,MassSpectrum", { MALDIquantForeign:::exportMzMl(m, file=file.path(tmp, "ms.mzML")) expect_equal(readLines(file.path(tmp, "ms.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"ms\"", x=mzML)) }) test_that("exportMzMl,list", { spectra <- list(m, m) MALDIquantForeign::exportMzMl(spectra, path=tmp, force=TRUE) expect_equal(readLines(file.path(tmp, "TESTS_1.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_1\"", x=mzML)) expect_equal(readLines(file.path(tmp, "TESTS_2.mzML")), sub(pattern="id=\"tmp\"", replacement="id=\"TESTS_2\"", x=mzML)) }) MALDIquantForeign/tests/testthat/test_uuid-functions.R0000644000176200001440000000167413211235236022631 0ustar liggesuserscontext("uuid") test_that(".uuid", { expect_identical(MALDIquantForeign:::.uuid(init="foobar"), "3858f622-30ac-4c91-9f30-0c664312c63f") }) test_that(".isUuidV4", { ## invalid letters (not hexadecimal) expect_false(MALDIquantForeign:::.isUuidV4("z858f622-30ac-4c91-9f30-0c664312c63f")) ## not version 4 expect_false(MALDIquantForeign:::.isUuidV4("3858f622-30ac-3c91-9f30-0c664312c63f")) ## y (pos 17 is not 8, 9, A, or B expect_false(MALDIquantForeign:::.isUuidV4("3858f622-30ac-4c91-cf30-0c664312c63f")) expect_true(MALDIquantForeign:::.isUuidV4("3858f622-30ac-4c91-9f30-0c664312c63f")) expect_true(MALDIquantForeign:::.isUuidV4("3858f62230ac4c919f300c664312c63f")) expect_true(MALDIquantForeign:::.isUuidV4(MALDIquantForeign:::.uuid())) expect_equal(MALDIquantForeign:::.isUuidV4(c("foobar", "3858f62230ac4c919f300c664312c63f")), c(FALSE, TRUE)) }) MALDIquantForeign/tests/testthat/test_importMsd-functions.R0000644000176200001440000000114613211235236023633 0ustar liggesuserscontext("importMsd") test_that("importMsd", { expect_error(MALDIquantForeign:::.importMsd("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny1.msd"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importMsd(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importMsd(path, verbose=FALSE)) expect_equal(s, import(path, type="msd", verbose=FALSE)) expect_true(isMassSpectrum(s[[1]])) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny1.msd") }) MALDIquantForeign/tests/testthat/test_importTab-functions.R0000644000176200001440000000541213341754277023635 0ustar liggesuserscontext("importTab") test_that("importTab", { ## suppress warnings to avoid creation of Rplots.pdf expect_error(suppressWarnings(MALDIquantForeign:::.importTab("tmp.tmp"))) path <- normalizePath(system.file(file.path("exampledata", "ascii.txt"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importTab(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importTxt(path, verbose=FALSE)) expect_equal(s, import(path, type="txt", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "ascii.txt") }) test_that("importCsv", { ## suppress warnings to avoid creation of Rplots.pdf expect_error(suppressWarnings(MALDIquantForeign:::.importCsv("tmp.tmp"))) path <- normalizePath(system.file(file.path("exampledata", "csv1.csv"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importCsv(path, sep=",", header=TRUE, verbose=FALSE) expect_equal(s, import(path, sep=",", header=TRUE, verbose=FALSE)) expect_equal(s, importCsv(path, sep=",", header=TRUE, verbose=FALSE)) expect_equal(s, import(path, type="csv", sep=",", header=TRUE, verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv1.csv") ## auto header s <- MALDIquantForeign:::.importCsv(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importCsv(path, verbose=FALSE)) expect_equal(s, import(path, type="csv", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv1.csv") s <- MALDIquantForeign:::.importCsv(system.file( file.path("exampledata", "csv2.csv"), package="MALDIquantForeign"), sep=";", header=FALSE) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv2.csv") ## auto header s <- MALDIquantForeign:::.importCsv(file.path(dirname(path), "csv2.csv"), sep=";") expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "csv2.csv") }) x <- c("10, 30", "\"foo\", \"bar\"", "foo; bar", "foo\tbar", "1\t 2") sep <- c(",", ",", ";", "\t", "\t") test_that("autoHeader", { result <- c(FALSE, TRUE, TRUE, TRUE, FALSE) for (i in seq(along=x)) { expect_identical(MALDIquantForeign:::.autoHeader(x[i], sep=sep[i]), result[i]) } }) test_that("autoSep", { for (i in seq(along=x)) { expect_identical(MALDIquantForeign:::.autoSep(x[i]), sep[i]) } }) MALDIquantForeign/tests/testthat/test_importImzMl-functions.R0000644000176200001440000000444313211235236024143 0ustar liggesuserscontext("importImzMl") test_that("importImzMl continuous", { expect_error(MALDIquantForeign:::.importImzMl("tmp.tmp")) path <- normalizePath(system.file( file.path("exampledata", "tiny_continuous.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importImzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="imzML", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny_continuous.imzML") expect_equal(mass(s[[2]]), 1:5) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny_continuous.imzML") }) test_that("importImzMl processed", { path <- normalizePath(system.file( file.path("exampledata", "tiny_processed.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path, verbose=FALSE) expect_equal(s, import(path, verbose=FALSE)) expect_equal(s, importImzMl(path, verbose=FALSE)) expect_equal(s, import(path, type="imzML", verbose=FALSE)) expect_equal(mass(s[[1]]), 1:5) expect_equal(intensity(s[[1]]), 6:10) expect_equal(basename(metaData(s[[1]])$file), "tiny_processed.imzML") expect_equal(mass(s[[2]]), 6:10) expect_equal(intensity(s[[2]]), 10:6) expect_equal(basename(metaData(s[[2]])$file), "tiny_processed.imzML") }) test_that("importImzMl coordinates", { path <- normalizePath(system.file( file.path("exampledata", "tiny_continuous.imzML"), package="MALDIquantForeign")) s <- MALDIquantForeign:::.importImzMl(path, verbose=FALSE) expect_equal(s, importImzMl(path, coordinates=cbind(1:2, c(1, 1)), verbose=FALSE)) expect_equal(s[1], importImzMl(path, coordinates=cbind(1, 1), verbose=FALSE)) expect_equal(s[[2]], importImzMl(path, coordinates=cbind(2, 1), verbose=FALSE)[[1]]) expect_error(importImzMl(path, coordinates=3, verbose=FALSE), "The .*coordinates.* argument has to be a matrix with two columns") expect_warning(importImzMl(path, coordinates=cbind(1:3, 2:0), verbose=FALSE), "The following rows contain invalid coordinates: 1, 3") }) MALDIquantForeign/tests/testthat/test_ibd-functions.R0000644000176200001440000000313713211235236022415 0ustar liggesuserscontext("ibd") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) processed <- matrix(c(cumsum(c(16L, rep.int(40L, 3L))), rep.int(5L, 4L), rep.int(40L, 4L)), nrow=4L) continuous<- matrix(c(16L, 56L, 16L, 96L, rep.int(5L, 4L), rep.int(40L, 4L)), nrow=4L) dimnames(processed) <- dimnames(continuous) <- list(rep(c("mass", "intensity"), 2), c("offset", "length", "encodedLength")) #test_that(".writeIbd", { #uuid <- "3858f622-30ac-4c91-9f30-0c664312c63f" #file <- tempfile() #MALDIquantForeign:::.writeIbd(filename=file, uuid=uuid) #}) test_that(".ibdOffsets", { expect_equal(MALDIquantForeign:::.ibdOffsets(s, processed=TRUE), processed) expect_equal(MALDIquantForeign:::.ibdOffsets(s, processed=FALSE), continuous) }) test_that(".addIbdOffsets", { rp <- list(createMassSpectrum(mass=1:5, intensity=1:5, metaData=list(imaging=list(offsets=processed[1:2,]))), createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(imaging=list(offsets=processed[3:4,])))) rc <- list(createMassSpectrum(mass=1:5, intensity=1:5, metaData=list(imaging=list(offsets=continuous[1:2,]))), createMassSpectrum(mass=1:5, intensity=6:10, metaData=list(imaging=list(offsets=continuous[3:4,])))) expect_equal(MALDIquantForeign:::.addIbdOffsets(s, processed=TRUE), rp) expect_equal(MALDIquantForeign:::.addIbdOffsets(s, processed=FALSE), rc) }) MALDIquantForeign/tests/testthat/test_fileFormats.R0000644000176200001440000000075613211235236022130 0ustar liggesuserscontext("fileFormats") test_that("supportedFileFormats", { r <- list(import = c("txt", "tab", "csv", "fid", "ciphergen", "mzxml", "mzml", "imzml", "analyze", "cdf", "msd"), export = c("tab", "csv", "msd", "mzml", "imzml")) expect_identical(supportedFileFormats(), r) }) MALDIquantForeign/tests/testthat/test_sanitize-functions.R0000644000176200001440000000030713211235236023501 0ustar liggesuserscontext("sanitize") test_that("sanitize-functions", { s <- c("ac", "a&o", "abc") r <- c("a<b", "b>c", "a&o", "abc") expect_identical(MALDIquantForeign:::.sanitize(s), r) }) MALDIquantForeign/NAMESPACE0000644000176200001440000000205713334627733014721 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(import) export(importAnalyze) export(importBrukerFlex) export(importCdf) export(importCiphergenXml) export(importCsv) export(importImzMl) export(importMsd) export(importMzMl) export(importMzXml) export(importTab) export(importTxt) export(supportedFileFormats) exportMethods(export) exportMethods(exportCsv) exportMethods(exportImzMl) exportMethods(exportMsd) exportMethods(exportMzMl) exportMethods(exportTab) import(MALDIquant) import(methods) import(readMzXmlData) importFrom(XML,xmlEventParse) importFrom(XML,xmlParse) importFrom(XML,xmlValue) importFrom(XML,xpathApply) importFrom(XML,xpathSApply) importFrom(base64enc,base64encode) importFrom(digest,digest) importFrom(readBrukerFlexData,readBrukerFlexFile) importFrom(stats,na.omit) importFrom(stats,runif) importFrom(utils,download.file) importFrom(utils,modifyList) importFrom(utils,packageVersion) importFrom(utils,read.table) importFrom(utils,tail) importFrom(utils,type.convert) importFrom(utils,untar) importFrom(utils,unzip) importFrom(utils,write.table) MALDIquantForeign/NEWS0000644000176200001440000002357613424400711014173 0ustar liggesusersRELEASE HISTORY OF THE "MALDIquantForeign" PACKAGE ================================================== CHANGES in MALDIquantForeign VERSION 0.12 [2019-01-30]: --------------------------------------------------------- * Fix reading of mzML with "non-standard data" arrays. Bug reported by Paul Turner. CHANGES in MALDIquantForeign VERSION 0.11.6 [2018-08-30]: --------------------------------------------------------- * Ignore comments in `.autoSep` and `.autoHeader`. Affected functions: .tab and .csv import, `import`, `importCsv`, `importTab`, `importTxt`. Bug reported by Fernando Pineda. CHANGES in MALDIquantForeign VERSION 0.11.5 [2018-08-14]: --------------------------------------------------------- * Fix psidev URLs. CHANGES in MALDIquantForeign VERSION 0.11.4 [2018-08-01]: --------------------------------------------------------- BUGFIX * Don't access `totalIonCurrent` for `MassPeaks` objects in `exportMzMl` and `exportImzMl`. CHANGES in MALDIquantForeign VERSION 0.11.3 [2018-05-27]: --------------------------------------------------------- BUGFIX * Don't use scientific format for numeric values in (i)mzML export. Patch by F. Orlando Galashan (see #25). CHANGES in MALDIquantForeign VERSION 0.11.2 [2018-03-18]: --------------------------------------------------------- BUGFIX * Fix missing unitName in intensity array in mzMl export. Reported by Jan Kobarg patch proposed by F. Orlando Galashan (see #22/#24). CHANGES IN MALDIquantForeign VERSION 0.11.1 [2017-12-04]: --------------------------------------------------------- BUGFIX * Fix handling of "processed" argument in `.writeImzMlDocument`; see #21. * Fix `export` method if there was no filename given. CHANGES IN MALDIquantForeign VERSION 0.11 [2017-09-01]: ------------------------------------------------------- BUGFIX * Fix integer overflow in `.ibdOffsets`; see issue #20. * Fix `exportImzMl` for missing coordinates, pixelSize and dimension; closes * #20. INTERNAL CHANGES * Put MALDIquant into single quotes in the DESCRIPTION file. * Rezip inst/compressed/csv.tar.gz using `gzip -n` to avoid lintian's package-contains-timestamped-gzip warning; see https://wiki.debian.org/ReproducibleBuilds for details. CHANGES IN MALDIquantForeign VERSION 0.10 [2015-10-31]: ------------------------------------------------------- IMPROVEMENTS * Add parallel support on unix-based platforms using the parallel package. All `import*` functions support the "mc.cores" argument (default is 1, means no parallel import). Please read also `?"MALDIquantForeign-parallel"`. * Add importer for .msd (mMass) files: `importMsd`. * Add basic export support for imzML files: `exportImzMl`. * `.importImzMl`: add "coordinates" argument to access specific spectra by their x, y coordinates within an imzML file; closes #14; affected functions: `import`, `importImzMl`. Thanks to Heath Patterson for this idea. MODIFICATIONS * Remove dependency "downloader". Since R 3.2.2 https is supported on all platforms by `base::download.file`. * Use "verbose = interactive()" in `import`. * Replace old imzML example files in inst/exampledata. * `exportMzMl`: improve documentation of the "path" argument. * `.importImzMl`: if the imzML file doesn't contain any UUID a warning is thrown instead of an error; affected functions: `import`, `importImzMl`. * `.importImzMl`: if the imzML file doesn't contain any checksum for its corresponding idb file a warning is thrown (before it was an error); affected functions: `import`, `importImzMl`. INTERNAL CHANGES * Import non-base functions/methods via NAMESPACE. * Use MALDIquant's new `coordinates` method. * Replace `require` by `requireNamespace` as suggested by "Writing R Extensions". * Rezip gzip'ed files using `gzip -n` to avoid lintian's package-contains-timestamped-gzip warning; see https://wiki.debian.org/ReproducibleBuilds for details. CHANGES IN MALDIquantForeign VERSION 0.9 [2014-08-11]: ------------------------------------------------------ IMPROVEMENTS * `.readAnalyzeIntensity`: allow to specify a mass range of interest to reduce memory usage while importing Analyze files; affected functions: `import`, `importAnalyze` * `importAnalyze`: use `as.double` after reading the image dimensions to avoid integer overflows in vector allocations (the Analyze 7.5 format specification limits the dimensions to integer). Thanks to Ken Frankel for reporting this problem. * `importImzMl`: add MD5 checksum support for imzML files. Thanks to Ken Frankel for reporting this problem. CHANGES IN MALDIquantForeign VERSION 0.8 [2014-06-16]: ------------------------------------------------------ MODIFICATIONS * `import`: set argument `centroided=FALSE` as default (was `NA` before). The automatically determination of profile/centroided data was too error prone. Now we read everything as profile data (use `centroided=TRUE` to read centroided data); affected functions: all `import` functions (e.g. `importBrukerFlex`, `importMzMl` ...). IMPROVEMENTS * `importAnalyze`: circumvent the limit of 32747 intensity values that is specified in the official Analyze 7.5 format. Thanks to Ken Frankel for reporting this problem. INTERNAL CHANGES * Fix VignetteIndexEntry. * Rename vignette output file from MALDIquantForeign.pdf to MALDIquantForeign-intro.pdf. * Check availability of the "RNetCDF" package in the `importCdf` man page to avoid build failures on CRAN. * Don't evaluate the remote import example in the vignette to avoid build failures on CRAN. CHANGES IN MALDIquantForeign VERSION 0.7 [2014-04-11]: ------------------------------------------------------ IMPROVEMENTS * Add vignette. INTERNAL CHANGES * Move tests into tests/testthat to adapt to testthat 0.8 and new CRAN policy; close #10. * Fix path of exampledata (needed because the test scripts moved to tests). CHANGES IN MALDIquantForeign VERSION 0.6 [2014-01-28]: ------------------------------------------------------ NEW FEATURES * Add basic import support for CDF files [contributed by Pietro Franceschi]; new function: `importCdf`. * `import`: add arguments "massRange" and "minIntensity" to limit import range; affected functions: all `import*` functions. * `import`: add argument "centroided" to allow import of centroided spectra as MassPeaks objects; affected functions: all `import*` functions. IMPROVEMENTS * Add "skip" argument to `.importCsv`, `.importTab`, `.autoSep` and `.autoHeader` to allow skipping first lines; affected functions: `import`, `importTxt`, `importTab`, `importCsv` BUG FIXES * `importAnalyze`: add support for ABSiex Analyze 7.5 files. Thanks to Pietro Franceschi for reporting this bug/odd behaviour. * `.importTab`: use `.autoSep` and `.autoHeader` (before they were used only by `.importCsv`); affected functions: `import`, `importTxt`, `importTab` * `.parseMzML`: fix assignment operation. Before all metaData of spectra were overwritten by the metaData of the last spectrum (affected only mzML files with more than one spectrum). affected functions: `importMzML` * `export`: fix one file export; additional affected functions: `exportMzMl`. INTERNAL CHANGES * Regenerate man pages with new 'roxygen2' (3.0.0). CHANGES IN MALDIquantForeign VERSION 0.5.1 [2013-09-18]: -------------------------------------------------------- BUG FIXES * Replace MALDIquant:::isMassSpectrum by MALDIquant::isMassSpectrum. * Replace deprecated function isMassObjectList. CHANGES IN MALDIquantForeign VERSION 0.5 [2013-09-08]: ------------------------------------------------------ IMPROVEMENTS * `import*`: add "excludePattern" argument to avoid import of specific files; closes #8. BUGFIXES * Fix "totalIonCurrent" test case. * Add import("methods") to NAMESPACE (fixes #9). INTERNAL CHANGES * Update dependencies; now MALDIquantForeign depends on R 3.0.0. * Replace all paste(..., sep="") by paste0. CHANGES IN MALDIquantForeign VERSION 0.4 [2013-04-28]: ------------------------------------------------------ NEW FEATURES * Add basic import support for imzML files and Analyze 7.5 files. IMPROVEMENTS * `import`: add "removeEmptySpectra" argument; closes #7. MODIFICATIONS * `import`: change default argument "verbose" to TRUE. BUGFIXES * `.download`: respects "verbose" argument now (fixes #6). INTERNAL CHANGES * Remove LICENSE file. CHANGES IN MALDIquantForeign VERSION 0.3 [2013-03-01]: ------------------------------------------------------ NEW FEATURES * Add basic support for mzML export. * Add basic import support for Ciphergen XML files. * `import`: add http(s):// and ftp:// support. * `import`: add uncompression support to allow import of zip/tar.{gz,bz2,xz}-archives. BUGFIXES * Add missing "usage" section in `export` methods manual pages. * `.files`: returns only unique file names; affected functions: all import functions. INTERNAL CHANGES * `.make.unique`: generates c("a1", "a2") instead of c("a", "a1") and c("a001", ..., "a099", "a100") instead of c("a", ..., "a98", "a99"); affected method: `export,list`. * DESCRIPTION: move base64enc, digest, readBrukerFlexData, readMzXmlData and XML to "Imports". * DESCRIPTION: remove MALDIquant from the "Imports" field. CHANGES IN MALDIquantForeign VERSION 0.2 [2013-01-14]: ------------------------------------------------------ IMPROVEMENTS * `exportMsd`: complete rewrite, write xml files manually instead of using the XML package (increasing speed). BUGFIXES * `export`: fix empty filenames. * `export,list`: stop if directory doesn't exist. * `exportMsd`: fix peaks argument. * `exportMsd` tests: respect endianness. * `import`: respect verbose argument in `import(type="auto")`. CHANGES IN MALDIquantForeign VERSION 0.1 [2012-12-10]: ------------------------------------------------------ * First public release. * Supported file formats: * Import: tab, txt, csv, Bruker Daltonics *flex files, mzXML, mzML * Export: tab, csv, msd MALDIquantForeign/R/0000755000176200001440000000000013363144245013671 5ustar liggesusersMALDIquantForeign/R/AllGenerics.R0000644000176200001440000000420313211235236016174 0ustar liggesusers## Copyright 2012-2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see 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(".exportImzMl"))) setGeneric(".exportImzMl", function(x, ...) standardGeneric(".exportImzMl")) 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("exportImzMl"))) setGeneric("exportImzMl", function(x, ...) standardGeneric("exportImzMl")) 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-methods.R0000644000176200001440000000367413211235236017240 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' This method creates a filename for a \code{\linkS4class{AbstractMassObject}} #' object. #' #' @param x a \code{\linkS4class{AbstractMassObject}} object #' @param fileExtension file type (e.g. "txt", "pdf", ...) #' @return filename #' #' @seealso \code{\linkS4class{AbstractMassObject}} #' @aliases .composeFilename,AbstractMassObject-method #' @aliases .composeFilename,list-method #' @docType methods #' @keywords internal #' @noRd setMethod(f=".composeFilename", signature=signature(x="AbstractMassObject"), definition=function(x, fileExtension="csv") { if (!is.null(metaData(x)$fullName)) { if (length(metaData(x)$fullName) > 1) { filename <- paste0(metaData(x)$fullName, collapse="_") } else { filename <- metaData(x)$fullName } } else { filename <- .withoutFileExtension(metaData(x)$file[1]) } paste(filename, fileExtension, sep=".") }) setMethod(f=".composeFilename", signature=signature(x="list"), definition=function(x, fileExtension="csv") { stopifnot(MALDIquant:::.isMassObjectList(x)) filenames <- unlist(lapply(x, .composeFilename, fileExtension=fileExtension)) .uniqueBaseFilenames(filenames, fileExtension) }) MALDIquantForeign/R/export-functions.R0000644000176200001440000000503713211235236017341 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .exportToFile <- function(x, file, type="auto", force=FALSE, ...) { if (file.exists(file) && !force) { stop("File already exists! Use ", sQuote("force=TRUE"), " to overwrite it.") } if (missing(type) || pmatch(tolower(type), "auto", nomatch=0, duplicates.ok=FALSE)) { type <- .fileExtension(file) } i <- pmatch(tolower(type), exportFormats$type, nomatch=0, duplicates.ok=FALSE) if (i) { handler <- exportFormats$handler[i] return(do.call(handler, list(x=x, file=file, ...))) } else { stop("File type ", sQuote(type), " is not supported!") } } .exportToDir <- function(x, path, type, force=FALSE, ...) { if (!file.exists(path) && force) { dir.create(path, showWarnings=FALSE, recursive=TRUE) } if (!file.exists(path)) { stop("Directory ", sQuote(path), " doesn't exist!") } if (!file.info(path)$isdir) { stop(sQuote(path), " is no directory!") } ## stop if directory isn't writeable if (file.access(path, 2) != 0) { stop("No permissions to write into ", sQuote(path), "!") } i <- pmatch(tolower(type), exportFormats$type, nomatch=0, duplicates.ok=FALSE) if (i) { filenames <- .composeFilename(x, fileExtension=exportFormats$extension[i]) filenames <- file.path(path, filenames) optArgs <- list(...) peaks <- list() if (hasArg(peaks)) { peaks <- optArgs$peaks optArgs$peaks <- NULL } for (i in seq(along=x)) { arguments <- list(x=x[[i]], file=filenames[i], type=type, force=force) arguments <- modifyList(arguments, optArgs) if (length(peaks)) { arguments$peaks <- peaks[[i]] } do.call(export, arguments) } } else { stop("File type ", sQuote(type), " is not supported!") } invisible() } MALDIquantForeign/R/download-function.R0000644000176200001440000000343113211235236017440 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .isUrl <- function(x)grepl(pattern="^https?://|^ftp://", x=x) .download <- function(url, destfile, verbose=FALSE, ...) { if (missing(destfile)) { pattern <- paste0(.withoutFileExtension(basename(url)), "_") fileext <- paste0(".", .fileExtension(url)) tmpdir <- file.path(tempdir(), "MALDIquantForeign_download") if (!file.exists(tmpdir)) { dir.create(tmpdir, showWarnings=FALSE, recursive=TRUE) } destfile <- file.path(tmpdir, tempfile(pattern=pattern, tmpdir="", fileext=fileext)) } .msg(verbose, "Downloading ", paste0(url, collapse=", ") , " to ", paste0(destfile, collapse=", "), ".") for (i in seq(along=url)) { if (download.file(url=url[i], destfile=destfile[i], quiet=!verbose, mode="wb", ...)) { warning("Download of ", url[i], " failed!") } } destfile } .cleanupDownloadedTmpFiles <- function() { unlink(file.path(tempdir(), "MALDIquantForeign_download"), recursive=TRUE) } MALDIquantForeign/R/mzMl-functions.R0000644000176200001440000004230213330376760016745 0ustar liggesusers## Copyright 2013-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeMzMlDocument <- function(x, file, id, encoding="utf-8", imsArgs=list()) { ## stop if file isn't writeable if (file.exists(file) && file.access(file, 2) != 0) { stop("No permissions to write into ", sQuote(file), "!") } isIms <- length(imsArgs) ## file handle f <- file(file, open="wt", encoding=encoding) .writeXmlHeader(file=f, encoding=encoding) .writeXmlTag("mzML", attrs=c(xmlns="http://psi.hupo.org/ms/mzml", "xmlns:xsi"="http://www.w3.org/2001/XMLSchema-instance", "xsi:schemaLocation"=paste("http://psi.hupo.org/ms/mzml", "http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd"), id=.sanitize(ifelse(missing(id) || is.null(id), deparse(substitute(x)), id)), version="1.1.0"), close=FALSE, file=f) .writeMzMlCvList(file=f, isIms=isIms) .writeMzMlFileDescription(x, file=f, isIms=isIms, imsArgs=imsArgs) .writeMzMlSoftwareList(x, file=f) if (isIms) { .writeImzMlReferenceableParamGroups(x, file=f) .writeImzMlScanSettings(x, file=f) } .writeMzMlInstrumentConfigurationList(x, file=f) .writeMzMlDataProcessingList(x, file=f) .writeMzMlRun(x, file=f, isIms=isIms) .writeCloseXmlTag("mzML", file=f) invisible(close(f)) } .writeMzMlCvList <- function(file, isIms=FALSE) { items <- list( ms=list(id="MS", fullName="Proteomics Standards Initiative Mass Spectrometry Ontology", version="3.44.0", URI="http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo"), uo=list(id="UO", fullName="Unit Ontology", version="12:10:2012", URI="http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/unit.obo")) if (isIms) { items$imzml <- list(id="IMS", fullName="Imaging MS Ontology", version="0.9.1", URI="http://www.maldi-msi.org/download/imzml/imagingMS.obo") } .writeXmlTag("cvList", attrs=c(count=2), intend=1, close=FALSE, file=file) for (i in seq(along=items)) { .writeXmlTag("cv", attrs=items[[i]], intend=2, file=file) } .writeCloseXmlTag("cvList", intend=1, file=file) } .writeMzMlFileDescription <- function(x, file, isIms=FALSE, imsArgs) { .writeXmlTag("fileDescription", intend=1, close=FALSE, file=file) .writeXmlTag("fileContent", intend=2, close=FALSE, file=file) .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="MS", accession="MS:1000579", name="MS1 spectrum"), file=file) if (isIms) { .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000080", name="universally unique identifier", value=paste0("{", imsArgs$uuid, "}")), file=file) .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000091", name="ibd SHA-1", value=imsArgs$sha1), file=file) if (imsArgs$processed) { .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000031", name="processed"), file=file) } else { .writeXmlTag("cvParam", intend=3, attrs=c(cvRef="IMS", accession="IMS:1000030", name="continuous"), file=file) } } .writeXmlTag("userParam", intend=3, attrs=c(name="MALDIquantForeign", value="MALDIquant object(s) exported to mzML"), file=file) .writeCloseXmlTag("fileContent", intend=2, file=file) .writeMzMlSourceFileList(x, file=file) .writeCloseXmlTag("fileDescription", intend=1, file=file) } .writeMzMlSourceFileList <- function(x, file) { files <- unique(unlist(lapply(x, function(s)metaData(s)$file))) if (length(files)) { dname <- dirname(files) bname <- basename(files) ext <- tolower(.fileExtension(bname)) .writeXmlTag("sourceFileList", attrs=c(count=length(files)), intend=2, close=FALSE, file=file) for (i in seq(along=files)) { .writeXmlTag("sourceFile", intend=3, attrs=c(id=paste0("SF", i), location=dname[i], name=bname[i]), close=FALSE, file=file) if (ext[i] == "fid") { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000825", name="Bruker FID file"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000773", name="Bruker FID nativeID format"), file=file) } else if (ext[i] == "mzxml") { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000566", name="ISB mzXML file"), file=file) } else if (ext[i] == "mzml") { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000584", name="mzML file"), file=file) } if (file.exists(files[i])) { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000569", name="SHA-1", value=digest::digest(files[i], algo="sha1", file=TRUE)), file=file) } .writeCloseXmlTag("sourceFile", intend=3, file=file) } .writeCloseXmlTag("sourceFileList", intend=2, file=file) } } .writeMzMlSoftwareList <- function(x, file) { .writeXmlTag("softwareList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("software", intend=2, attrs=c(id="MALDIquantForeign", version=as.character(packageVersion("MALDIquantForeign"))), file=file) .writeCloseXmlTag("softwareList", intend=1, file=file) } .writeMzMlInstrumentConfigurationList <- function(x, file) { .writeXmlTag("instrumentConfigurationList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("instrumentConfiguration", attrs=c(id="IC0"), intend=2, file=file) .writeCloseXmlTag("instrumentConfigurationList", intend=1, file=file) } .writeMzMlDataProcessingList <- function(x, file) { .writeXmlTag("dataProcessingList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("dataProcessing", attrs=c(id="export"), intend=2, close=FALSE, file=file) .writeXmlTag("processingMethod", intend=3, attrs=c(order=1, softwareRef="MALDIquantForeign"), close=FALSE, file=file) .writeXmlTag("userParam", intend=4, attrs=c(name="MALDIquant object(s) exported to mzML", value=""), file=file) .writeCloseXmlTag("processingMethod", intend=3, file=file) .writeCloseXmlTag("dataProcessing", intend=2, file=file) .writeCloseXmlTag("dataProcessingList", intend=1, file=file) } .writeMzMlRun <- function(x, file, isIms=FALSE) { .writeXmlTag("run", attrs=c(id="run0", defaultInstrumentConfigurationRef="IC0"), intend=1, close=FALSE, file=file) .writeMzMlSpectrumList(x, file=file, isIms=isIms) .writeCloseXmlTag("run", intend=1, file=file) } .writeMzMlSpectrumList <- function(x, file, isIms=FALSE) { .writeXmlTag("spectrumList", attrs=c(count=length(x), defaultDataProcessingRef="export"), intend=2, close=FALSE, file=file) for (i in seq(along=x)) { id <- ifelse(is.null(metaData(x[[i]])$id), paste0("scan=", i-1L), metaData(x[[i]])$id) .writeXmlTag("spectrum", intend=3, attrs=c(index=i-1, id=id, defaultArrayLength=length(x[[i]]), spotID=metaData(x[[i]])$fullName), close=FALSE, file=file) msLevel <- ifelse(is.null(metaData(x[[i]])$msLevel), 1, metaData(x[[i]])$msLevel) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000511", name="ms level", value=msLevel), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000294", name="mass spectrum"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000528", name="lowest observed m/z", value=min(mass(x[[i]])), unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000527", name="highest observed m/z", value=max(mass(x[[i]])), unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z"), file=file) if (MALDIquant::isMassSpectrum(x[[i]])) { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000128", name="profile spectrum"), file=file) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000285", name="total ion current", value=totalIonCurrent(x[[i]])), file=file) } else { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000127", name="centroid spectrum"), file=file) } if (isIms) { .writeImzMlScanList(x[[i]], file=file) .writeImzMlBinaryDataArrayList(x[[i]], file=file) } else { .writeMzMlBinaryDataArrayList(x[[i]], file=file) } .writeCloseXmlTag("spectrum", intend=3, file=file) } .writeCloseXmlTag("spectrumList", intend=2, file=file) } .writeMzMlBinaryDataArrayList <- function(x, file) { count <- ifelse(MALDIquant::isMassSpectrum(x), 2, 3) .writeXmlTag("binaryDataArrayList", attrs=c(count=count), intend=4, close=FALSE, file=file) .writeMzMlBinaryData(mass(x), file=file, c(cvRef="MS", accession="MS:1000514", name="m/z array", unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z")) .writeMzMlBinaryData(intensity(x), file=file, c(cvRef="MS", accession="MS:1000515", name="intensity array", unitCvRef="MS", unitAccession="MS:1000131", unitName="number of counts")) if (MALDIquant::isMassPeaks(x)) { .writeMzMlBinaryData(snr(x), file=file, c(cvRef="MS", accession="MS:1000517", name="signal to noise array")) } .writeCloseXmlTag("binaryDataArrayList", intend=4, file=file) } .writeMzMlBinaryData <- function(x, file, additionalAttrs) { binaryData <- .base64encode(x, size=8, endian="little", compressionType="gzip") .writeXmlTag("binaryDataArray", attrs=c(encodedLength=nchar(binaryData)), intend=5, close=FALSE, file=file) .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="MS", accession="MS:1000574", name="zlib compression")) .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="MS", accession="MS:1000523", name="64-bit float")) if (!missing(additionalAttrs)) { .writeXmlTag("cvParam", attrs=additionalAttrs, intend=6, file=file) } .writeXmlTag("binary", text=binaryData, intend=6, file=file) .writeCloseXmlTag("binaryDataArray", intend=5, file=file) } .writeImzMlReferenceableParamGroups <- function(x, file) { .writeXmlTag("referenceableParamGroupList", attrs=c(count=2), intend=1, close=FALSE, file=file) .writeXmlTag("referenceableParamGroup", attrs=c(id="mzArray"), intend=2, close=FALSE, file=file) .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="MS", accession="MS:1000514", name="m/z array", unitCvRef="MS", unitAccession="MS:1000040", unitName="m/z")) ref <- c("MS", "MS", "IMS") accession <- paste(ref, c(1000576, 1000523, 1000101), sep=":") name <- c("no compression", "64-bit float", "external data") value <- c("", "", "true") for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef=ref[i], accession=accession[i], name=name[i], value=value[i])) } .writeCloseXmlTag("referenceableParamGroup", intend=2, file=file) .writeXmlTag("referenceableParamGroup", attrs=c(id="intensityArray"), intend=2, close=FALSE, file=file) .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="MS", accession="MS:1000515", name="intensity array", unitCvRef="MS", unitAccession="MS:1000131", unitName="number of counts")) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef=ref[i], accession=accession[i], name=name[i], value=value[i])) } .writeCloseXmlTag("referenceableParamGroup", intend=2, file=file) .writeCloseXmlTag("referenceableParamGroupList", intend=1, file=file) } .writeImzMlScanSettings <- function(x, file) { .writeXmlTag("scanSettingsList", attrs=c(count=1), intend=1, close=FALSE, file=file) .writeXmlTag("scanSettings", attrs=c(id="scansetting1"), intend=2, close=FALSE, file=file) accession <- paste("IMS", 1000042:1000043, sep=":") name <- paste("max count of pixel", c("x", "y")) value <- unname(metaData(x[[1L]])$imaging$size) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=value[i])) } accession <- paste("IMS", 1000044:1000047, sep=":") name <- c(paste("max dimension", c("x", "y")), paste("pixel size", c("x", "y"))) value <- unname(c(metaData(x[[1L]])$imaging$dim, metaData(x[[1L]])$imaging$pixelSize)) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=3, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=value[i], unitCvRef="UO", unitAccession="UO:0000017", unitName="micrometer")) } .writeCloseXmlTag("scanSettings", intend=2, file=file) .writeCloseXmlTag("scanSettingsList", intend=1, file=file) } .writeImzMlScanList <- function(x, file) { .writeXmlTag("scanList", attrs=c(count=1), intend=4, close=FALSE, file=file) .writeXmlTag("scan", intend=5, close=FALSE, file=file) accession <- paste("IMS", 1000050:1000051, sep=":") name <- paste("position", c("x", "y")) value <- unname(metaData(x)$imaging$pos) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=format(value[i], scientific=FALSE))) } .writeCloseXmlTag("scan", intend=5, file=file) .writeCloseXmlTag("scanList", intend=4, file=file) } .writeImzMlBinaryDataArrayList <- function(x, file) { .writeXmlTag("binaryDataArrayList", attrs=c(count=2), intend=4, close=FALSE, file=file) .writeImzMlBinaryData(metaData(x)$imaging$offsets["mass",], file=file, ref="mzArray") .writeImzMlBinaryData(metaData(x)$imaging$offsets["intensity",], file=file, ref="intensityArray") .writeCloseXmlTag("binaryDataArrayList", intend=4, file=file) } .writeImzMlBinaryData <- function(x, file, ref) { .writeXmlTag("binaryDataArray", attrs=c(encodedLength=0), intend=5, close=FALSE, file=file) .writeXmlTag("referenceableParamGroupRef", attrs=c(ref=ref), intend=6, file=file) accession <- paste("IMS", 1000102:1000104, sep=":") name <- paste("external", c("offset", "array length", "encoded length")) value <- unname(x) for (i in seq(along=accession)) { .writeXmlTag("cvParam", intend=6, file=file, attrs=c(cvRef="IMS", accession=accession[i], name=name[i], value=format(value[i], scientific=FALSE))) } .writeXmlTag("binary", intend=6, file=file) .writeCloseXmlTag("binaryDataArray", intend=5, file=file) } MALDIquantForeign/R/fileFormats.R0000644000176200001440000000777313211235236016276 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Supported file formats #' #' This function prints all file formats supported by #' \code{\link{MALDIquantForeign-package}}. #' #' \subsection{Import}{ #' #' \tabular{ll}{ #' txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr #' tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr #' fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr #' ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr #' mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr #' analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr #' cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr #' msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr #' } #' } #' #' \subsection{Export}{ #' #' \tabular{ll}{ #' tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr #' msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr #' } #' } #' #' @return a \code{list} with two named elements (\code{import} and #' \code{export}) containing a \code{character} vector of supported file types. #' #' @seealso #' \code{\link[MALDIquantForeign]{export}}, #' \code{\link[MALDIquantForeign]{import}} #' @author Sebastian Gibb #' @references \url{http://strimmerlab.org/software/maldiquant/} #' @examples #' library("MALDIquantForeign") #' #' supportedFileFormats() #' #' @rdname supportedFileFormats-functions #' @export supportedFileFormats <- function() { list(import=importFormats$type, export=exportFormats$type) } importFormats <- data.frame(type=c("txt", "tab", "csv", "fid", "ciphergen", "mzxml", "mzml", "imzml", "analyze", "cdf", "msd"), pattern=c("^.*\\.txt$", "^.*\\.tab$", "^.*\\.csv$", "^fid$", "^.*\\.xml$", "^.*\\.mzXML$", "^.*\\.mzML$", "^.*\\.imzML$", "^.*\\.hdr$", "^.*\\.cdf$", "^.*\\.msd$"), handler=c(rep(".importTab", 2), ".importCsv", ".importBrukerFlex", ".importCiphergenXml", ".importMzXml", ".importMzMl", ".importImzMl", ".importAnalyze", ".importCdf", ".importMsd"), stringsAsFactors=FALSE) exportFormats <- data.frame(type=c("tab", "csv", "msd", "mzml", "imzml"), extension=c("tab", "csv", "msd", "mzML", "imzML"), onefile=c(FALSE, FALSE, FALSE, TRUE, TRUE), handler=c(".exportTab", ".exportCsv", ".exportMsd", ".exportMzMl", ".exportImzMl"), stringsAsFactors=FALSE) MALDIquantForeign/R/importAnalyze-functions.R0000644000176200001440000000433513211235236020656 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importAnalyze <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { header <- .readAnalyzeHdr(file, verbose=verbose) mass <- .readAnalyzeMass(.changeFileExtension(file, "t2m"), header=header, verbose=verbose) massRange <- MALDIquant:::.reorderRange(massRange) massIdx <- which(massRange[1] <= mass & mass <= massRange[2]) skip <- c(massIdx[1]-1, length(mass)-massIdx[length(massIdx)]) mass <- mass[massIdx] intensity <- .readAnalyzeIntensity(.changeFileExtension(file, "img"), header=header, ni=length(mass), skip=skip, verbose=verbose) l <- vector(mode="list", length=header$nx*header$ny) for (x in 1:header$nx) { for (y in 1:header$ny) { l[[(x-1)*header$ny+y]] <- .createMassObject(mass=mass, intensity=intensity[, x, y], metaData=list(file=file, imaging=list(pos=c(x=x, y=y), pixelSize=c(x=header$xd, y=header$yd))), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } } l } MALDIquantForeign/R/base64encode-functions.R0000644000176200001440000000372113211235236020260 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Converts double to base64 character. #' #' This function converts a \code{double} vector to a base64 encoded #' \code{character} vector. #' #' @param x \code{double}, vector #' @param size \code{integer}, number of bytes per element in the byte stream #' (see \code{size} in \code{\link[base]{writeBin}}). #' @param endian \code{character}, the endian-ness #' (see \code{endian} in \code{\link[base]{writeBin}}). #' @param compressionType \code{character}, type of compression to use for #' compression of \code{x} (see \code{type} in #' \code{\link[base]{memCompress}}. #' @return Vector of type \code{character}. #' @rdname base64-encode #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @seealso \code{\link[base64enc]{base64encode}} from \pkg{base64enc} package #' @keywords internal #' .base64encode <- function(x, size, endian=.Platform$endian, compressionType=c("none", "gzip")) { x <- writeBin(as.double(x), con=raw(), size=size, endian=endian) compressionType <- match.arg(compressionType, choices=c("none", "gzip"), several.ok=FALSE) x <- memCompress(from=x, type=compressionType) base64enc::base64encode(x) } MALDIquantForeign/R/createMassObject-functions.R0000644000176200001440000000644213211235236021237 0ustar liggesusers## Copyright 2014-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Create a MassSpectrum or a MassPeaks object. #' #' This function creates a MassSpectrum or MassPeaks object (depending on the #' centroided argument). #' #' @param mass mass data #' @param intensity intensity data #' @param snr snr data #' @param metaData \code{list}, metaData #' @param centroided \code{logical}, centroided #' (if TRUE => MassPeaks, if FALSE => MassSpectrum) #' @param massRange \code{double}, length == 2, trim spectrum to #' \code{massRange}. #' @param minIntensity \code{double}, minimal intensity #' @param verbose \code{logical}, verbose output? #' #' @return Returns a MassSpectrum or a MassPeaks object. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @rdname createMassObject #' @keywords internal #' @noRd .createMassObject <- function(mass, intensity, snr=NULL, metaData=list(), centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (!is.null(metaData$centroided) || !is.null(metaData$dataProcessing$centroided)) { isCentroided <- isTRUE(as.logical(as.numeric(metaData$centroided))) | isTRUE(as.logical(as.numeric(metaData$dataProcessing$centroided))) if (isCentroided != centroided) { warning("According to the metadata information the imported data are ", ifelse(isCentroided, "", "not "), "centroided, ", "but they are treated as ", ifelse(centroided, "centroided (MassPeaks)", "profile (MassSpectrum)"), " data. Maybe you want to use ", sQuote(paste0("centroided=", as.character(isCentroided))), ". See ", sQuote("?import"), " for details.", immediate.=TRUE) } } .msg(centroided & verbose, "Assume centroided data and creating a MassPeaks object.") ## trim AbstractMass object massRange <- MALDIquant:::.reorderRange(massRange) ## we don't use MALDIquant::trim here because we want to filter on the ## intensity as well i <- which(massRange[1L] <= mass & mass <= massRange[2L] & intensity >= minIntensity) if (is.null(snr)) { snr <- rep.int(NA_real_, length(i)) } ## create a MassPeaks object for centroided data if (centroided) { m <- createMassPeaks(mass=mass[i], intensity=intensity[i], snr=snr[i], metaData=metaData) } else { m <- createMassSpectrum(mass=mass[i], intensity=intensity[i], metaData=metaData) } m } MALDIquantForeign/R/filename-functions.R0000644000176200001440000000616413211235236017602 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .cleanFilename <- function(x) { gsub(pattern="([[:punct:]]|[[:space:]])+", replacement="_", x=x) } #' Determine file extension #' #' @param x \code{character}, filename. #' #' @return \code{character}, file extension. #' #' @seealso \code{\link[MALDIquant]{MassSpectrum-class}} #' @keywords internal #' @noRd #' @examples #' library("MALDIquantForeign") #' files <- c("/home/foo/bar.txt", "foobar.pdf") #' MALDIquantForeign:::.fileExtension(files) #' .fileExtension <- function(x) { pos <- regexpr(pattern="(\\.tar)?\\.([[:alnum:]]+)$|(/|\\\\)+[^.\\\\/]+$", text=x) ifelse(pos > -1L, substring(x, pos+1L), x) } .withoutFileExtension <- function(x) { sub(pattern="\\.[[:alnum:]]+?$|(/|\\\\)+[^.\\\\/]+$", replacement="", x=.withoutCompressionExtension(x)) } .withoutCompressionExtension <- function(x) { sub(pattern="\\.(zip|gz|bz2|bzip2|xz|lzma)+$", replacement="", x=x) } .changeFileExtension <- function(x, newExtension) { paste(.withoutFileExtension(x), newExtension, sep=".") } .cutFilenames <- function(x) { l <- strsplit(x, split=.Platform$file.sep, fixed=TRUE) if (any(lengths(l) == 0)) { return(sprintf(paste0("%0", trunc(log10(length(x))) + 1L, "d"), seq_along(x))) } nCol <- unlist(lapply(l, length)) mCol <- max(nCol) m <- matrix(NA, nrow=length(x), ncol=mCol) for (i in seq(along=l)) { cols <- 1:nCol[i] m[i, cols] <- l[[i]] } isIdentical <- apply(m, 2, function(co)all(co[1] == co)) isIdentical[is.na(isIdentical)] <- FALSE m <- as.matrix(m[, !isIdentical]) if (length(m)) { filenames <- apply(m, 1, function(r) { do.call(file.path, as.list(na.omit(r))) }) } else { filenames <- basename(x) } filenames } .uniqueBaseFilenames <- function(x, fileExtension="csv", sep="_") { filenames <- .cutFilenames(.withoutFileExtension(x)) filenames <- .cleanFilename(filenames) empty <- nchar(filenames) <= 0 filenames[empty] <- seq_along(empty) filenames <- .make.unique(filenames, sep=sep) paste(filenames, fileExtension, sep=".") } ## let make unique start by 1 .make.unique <- function(x, sep="_") { tmp <- lapply(split(x, x), function(y) { n <- length(y) if (n > 1) { fmt <- paste0("%s%s%0", floor(log10(n))+1, "d") y <- sprintf(fmt=fmt, y, sep, 1:n) } y }) unsplit(tmp, x) } MALDIquantForeign/R/importCdf-functions.R0000644000176200001440000000535013211235236017745 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' @author Pietro Franceschi \email{pietro.franceschi@@fmach.it}, Sebastian Gibb #' \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd ## original code written by Pietro Franceschi ## modified for MALDIquantForeign by Sebastian Gibb .importCdf <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { if (!requireNamespace("RNetCDF", quietly=TRUE)) { stop("For netCDF support the ", sQuote("RNetCDF"), " package is needed. \n", "Please install ", sQuote("RNetCDF"), ": install.packages(\"RNetCDF}\")") } nc <- RNetCDF::open.nc(file) on.exit(RNetCDF::close.nc(nc)) scanIndex <- as.integer(RNetCDF::var.get.nc(nc, variable="scan_index")) scanLength <- as.integer(RNetCDF::var.get.nc(nc, variable="point_count")) retentionTime <- as.double(RNetCDF::var.get.nc(nc, variable="scan_acquisition_time")) ## read and process the spectra/peaks l <- vector(mode="list", length=length(scanIndex)) for (i in seq(along=l)) { mass <- as.double(RNetCDF::var.get.nc(nc, variable="mass_values", start=scanIndex[i]+1L, count=scanLength[i])) intensity <- as.double(RNetCDF::var.get.nc(nc, variable="intensity_values", start=scanIndex[i]+1L, count=scanLength[i])) l[[i]] <- .createMassObject(mass=mass, intensity=intensity, metaData=list(file=file, number=i, retentionTime=retentionTime[i], scanIndex=scanIndex[i]), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } l } MALDIquantForeign/R/importImzMl-functions.R0000644000176200001440000001035513211235236020302 0ustar liggesusers## Copyright 2013-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importImzMl <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, coordinates=NULL, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ibdFilename <- .changeFileExtension(file, "ibd") if (!file.exists(ibdFilename)) { stop("File ", sQuote(ibdFilename), " doesn't exists!") } s <- .parseMzMl(file=file, verbose=verbose) ibd <- file(ibdFilename, open="rb") on.exit(close(ibd)) ## test UUID uuid <- paste0(readBin(ibd, raw(), n=16, size=1, signed=TRUE, endian= "little"), collapse="") if (is.null(s$ims$uuid)) { warning("There is not any UUID in ", sQuote(file), "!") } else if (tolower(uuid) != tolower(s$ims$uuid)) { warning("The UUID in ", sQuote(file) , " and ", sQuote(ibdFilename), "do not match!") } else if (!.isUuidV4(uuid)) { warning("The UUID: ", uuid, " is not valid!") } ## test checksums if (!is.null(s$ims$md5)) { .testChecksum(ibdFilename, s$ims$md5, algo="md5", verbose=verbose) } else if (!is.null(s$ims$sha1)) { .testChecksum(ibdFilename, s$ims$sha1, algo="sha1", verbose=verbose) } else { warning("At least one checksum (SHA-1 or MD5) for the idb file ", "should be provided in the imzML file.") } sel <- seq_along(s$ims$ibd) isCoordinatesMatrix <- is.matrix(coordinates) && ncol(coordinates) == 2L if (!is.null(coordinates) && !isCoordinatesMatrix) { stop("The ", sQuote("coordinates"), " argument has to be a matrix with two columns (x and y position)!") } if (isCoordinatesMatrix) { pos <- do.call(rbind, lapply(s$spectra, function(x)x$metaData$imaging$pos)) sel <- match(paste(coordinates[, 1L], coordinates[, 2L], sep=":"), paste(pos[, 1L], pos[, 2L], sep=":")) if (anyNA(sel)) { warning("The following rows contain invalid coordinates: ", paste(which(is.na(sel)), collapse=", ")) sel <- sort(sel[!is.na(sel)]) } } .readValues <- function(file, x, column, isSeekNeeded) { if (isSeekNeeded) { ## WARNING: we know that `seek` is discouraged on some platforms, ## namely Windows. See `?seek` for details. seek(file, where=x[column, "offset"]) } n <- x[column, "length"] e <- x[column, "encodedLength"] readBin(file, double(), n=n, size=e/n, signed=TRUE, endian="little") } n <- length(sel) spectra <- vector(mode="list", length=n) isProcessed <- s$ims$type == "processed" isSeekNeeded <- length(s$ims$ibd) > length(sel) if (!isProcessed) { mass <- .readValues(ibd, s$ims$ibd[[sel[1L]]], "mass", isSeekNeeded) } ## read mass and intensity values for (i in seq(along=sel)) { .msg(verbose, "Reading binary data for spectrum ", i, "/", n, " ...") m <- modifyList(s$metaData, s$spectra[[sel[i]]]$metaData) m$file <- file if (isProcessed) { mass <- .readValues(ibd, s$ims$ibd[[sel[i]]], "mass", isSeekNeeded) } intensity <- .readValues(ibd, s$ims$ibd[[sel[i]]], "intensity", isSeekNeeded) spectra[[i]] <- .createMassObject(mass=mass, intensity=intensity, metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) } spectra } MALDIquantForeign/R/importBrukerFlex-functions.R0000644000176200001440000000247413211235236021326 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importBrukerFlex <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { s <- readBrukerFlexData::readBrukerFlexFile(fidFile=file, verbose=verbose, ...) list(.createMassObject(mass=s$spectrum$mass, intensity=s$spectrum$intensity, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/testChecksum-functions.R0000644000176200001440000000246513211235236020464 0ustar liggesusers## Copyright 2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .testChecksum <- function(file, target, algo="sha1", ..., verbose=FALSE) { .msg(verbose, "Calculating ", algo, "-sum for ", sQuote(file), ": ", appendLF=FALSE) fileChecksum <- tolower(digest::digest(file, algo=algo, file=TRUE, ...)) target <- tolower(target) .msg(verbose, fileChecksum) if (fileChecksum != target) { warning("Stored and calculated ", algo, " sums do not match ", "(stored: ", sQuote(target), ", calculated: ", sQuote(fileChecksum), ")!") return(FALSE) } TRUE } MALDIquantForeign/R/exportTab-methods.R0000644000176200001440000000245713211235236017426 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportTab", signature=signature(x="AbstractMassObject"), definition=function(x, file="", row.names=FALSE, col.names=FALSE, ...) { write.table(as.matrix(x), file=file, row.names=row.names, col.names=col.names, ... ) }) setMethod(f=".exportCsv", signature=signature(x="AbstractMassObject"), definition=function(x, file="", sep=",", row.names=FALSE, col.names=TRUE, ...) { .exportTab(x, file=file, sep=sep, row.names=row.names, col.names=col.names, ...) }) MALDIquantForeign/R/list.files-functions.R0000644000176200001440000000337013211235236020072 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .list.files <- function(path, pattern, excludePattern=NULL, recursive=TRUE, ignore.case=TRUE) { files <- list.files(path=path, pattern=pattern, recursive=recursive, ignore.case=ignore.case, full.names=TRUE) if (!is.null(excludePattern)) { isExcluded <- grepl(pattern=excludePattern, x=files, ignore.case=ignore.case) files <- files[!isExcluded] } normalizePath(files) } .files <- function(path, pattern, excludePattern=NULL, ignore.case=TRUE, ...) { isDir <- file.info(path)$isdir files <- normalizePath(path[!isDir]) isMatching <- unlist(regexpr(pattern=pattern, text=basename(files), ignore.case=ignore.case)) != -1 files <- files[isMatching] files <- c(files, .list.files(path=path[isDir], pattern=pattern, excludePattern=excludePattern, ignore.case=ignore.case, ...)) unique(files) } MALDIquantForeign/R/importCiphergenXml-functions.R0000644000176200001440000000260613211235236021637 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importCiphergenXml <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ## read file s <- .parseCiphergenXml(file=file) list(.createMassObject(mass=s$spectrum$mass, intensity=s$spectrum$intensity, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/msg-functions.R0000644000176200001440000000154613211235236016607 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .msg <- function(verbose, ...) { if (verbose) { message(...) } } MALDIquantForeign/R/importMzMl-functions.R0000644000176200001440000000267713211235236020141 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importMzMl <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } s <- .parseMzMl(file=file, verbose=verbose) lapply(s$spectra, function(x, globalS=s) { m <- modifyList(s$metaData, x$metaData) m$file <- file .createMassObject(mass=x$mass, intensity=x$intensity, snr=x$snr, metaData=m, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose) }) } MALDIquantForeign/R/compression-functions.R0000644000176200001440000000635013211235236020360 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .isCompressed <- function(x) { z <- c("bz2", "bzip2", "gz", "lzma", "xz") .fileExtension(x) %in% c("zip", z, paste("tar", z, sep=".")) } .isTar <- function(x)grepl(pattern="^tar", x=.fileExtension(x)) .isZip <- function(x)grepl(pattern="^zip$", x=.fileExtension(x)) .isPackedOrCompressed <- function(x) { .isCompressed(x) | .isTar(x) } # unpack/uncompress files and return temporary filenames .uncompress <- function(x, verbose=TRUE) { f <- lapply(x, function(path) { if (!.isPackedOrCompressed(path)) { return(x) } else { if (.isTar(path)) { return(.unpacking(x, fun=untar, verbose=verbose)) } else if (.isZip(path)) { return(.unpacking(x, fun=unzip, verbose=verbose)) } else { return(.gunzip(x, verbose=verbose)) } } }) unlist(f) } # unpack and return tmp filename .unpacking <- function(filename, destdir, fun, verbose=FALSE, ...) { if (missing(destdir)) { pattern <- paste0(.withoutFileExtension(basename(filename)), "_") destdir <- file.path(tempdir(), "MALDIquantForeign_uncompress", tempfile(pattern=pattern, tmpdir="")) } funName <- deparse(substitute(fun)) fun <- as.function(fun) .msg(verbose, funName, " ", filename, " to ", destdir, ".") unpacked <- fun(filename, exdir=destdir, ...) if (!length(unpacked)) { stop(funName, " failed!") } destdir } # gunzip and return tmp filename .gunzip <- function(filename, destfile, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " doesn't exist!") } if (missing(destfile)) { tmpdir <- file.path(tempdir(), "MALDIquantForeign_uncompress") if (!file.exists(tmpdir)) { dir.create(tmpdir, showWarnings=FALSE, recursive=TRUE) } pattern <- paste0(.withoutFileExtension(basename(filename)), "_") fileext <- paste0(".", .fileExtension(.withoutCompressionExtension(filename))) destfile <- tempfile(pattern=pattern, tmpdir=tmpdir, fileext=fileext) } .msg(verbose, "gunzip ", filename, " to ", destfile, ".") fi <- gzfile(filename, open="rb") on.exit(close(fi)) fo <- file(destfile, open="wb") on.exit(close(fo), add=TRUE) repeat { b <- readBin(fi, what=raw(), n=1e6) ## n==1e6 => nearly 50Mb if (length(b)) { writeBin(b, con=fo) } else { break } } destfile } .cleanupUncompressedTmpFiles <- function() { unlink(file.path(tempdir(), "MALDIquantForeign_uncompress"), recursive=TRUE) } MALDIquantForeign/R/MALDIquantForeign-parallel.R0000644000176200001440000000543713211235236021021 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parallel Support in Package \pkg{MALDIquantForeign} #' #' \code{\link[MALDIquantForeign]{MALDIquantForeign-package}} offers multi-core #' support using \code{\link[parallel]{mclapply}} and #' \code{\link[parallel]{mcmapply}}. This approach is limited to unix-based #' platforms. #' #' Please note that not all import functions benfit from parallelisation. The #' current implementation is limited to run the parallelisation over different #' files. That's why only imports of multiple files could be run on multiple #' cores. E.g. a single mzML file containing 4 spectra would always be #' read on a single core. In contrast 4 mzML files each containing just one #' spectra could be read in using 4 cores. #' #' The improvement in the runtime depends on the amount of data to read, the #' proportion of parsing/decoding of the data, the amount of memory and the #' speed of the hard disk. #' #' Please note: It is possible that using parallelisation results in a worse #' runtime! #' #' @name MALDIquantForeign-parallel #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references \url{http://strimmerlab.org/software/maldiquant/} #' @keywords misc #' @seealso #' \code{\link[MALDIquant]{MALDIquant-parallel}}, #' \code{\link[parallel]{mclapply}}, #' \code{\link[parallel]{mcmapply}} #' #' @examples #' ## load packages #' library("MALDIquant") #' library("MALDIquantForeign") #' #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## run single-core import #' print(system.time( #' s1 <- importMzMl(exampleDirectory, centroided=TRUE, verbose=FALSE) #' )) #' #' if(.Platform$OS.type == "unix") { #' ## run multi-core import #' ## (because the example spectra are very small (just 5 data points) the #' ## multi-core solution is slower on most systems) #' print(system.time( #' s2 <- importMzMl(exampleDirectory, centroided=TRUE, mc.cores=2, #' verbose=FALSE) #' )) #' stopifnot(all.equal(s1, s2)) #' } #' @rdname MALDIquantForeign-parallel NULL MALDIquantForeign/R/exportImzMl-methods.R0000644000176200001440000000244013211235236017740 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportImzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, ...) { .writeImzMlDocument(x=x, file=file, id=id, processed=processed, ...) }) setMethod(f=".exportImzMl", signature=signature(x="list"), definition=function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, ...) { .writeImzMlDocument(x=x, file=file, id=id, processed=processed, ...) }) MALDIquantForeign/R/imzMl-functions.R0000644000176200001440000000452313211235236017107 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeImzMlDocument <- function(x, file, id=.withoutFileExtension(basename(file)), processed=TRUE, uuid=.uuid(), coordinates=MALDIquant::coordinates(x), pixelSize=c(metaData(x[[1L]])$imaging$pixelSize, 100, 100)[1L:2L], ...) { if(isMassSpectrum(x)) { x <- list(x) } if (is.null(metaData(x[[1L]])$imaging$pos) && is.null(coordinates)) { stop("The spectra contain no imaging information.") } isCoordinatesMatrix <- !is.null(coordinates) && is.matrix(coordinates) && ncol(coordinates) == 2L && nrow(coordinates) == length(x) if (!isCoordinatesMatrix) { stop("The ", sQuote("coordinates"), " argument has to be a matrix with two columns (x and y position)!") } else { size <- apply(coordinates, 2, max) dimension <- size * pixelSize x[[1L]]@metaData$imaging <- list(size=size, dim=dimension, pixelSize=pixelSize) coordinates(x) <- coordinates } ibdFile <- .changeFileExtension(file, "ibd") .writeIbd(x, ibdFile, uuid=uuid, processed=processed) sha1 <- digest::digest(ibdFile, algo="sha1", file=TRUE) .writeMzMlDocument(x=.addIbdOffsets(x, processed=processed), file=file, id=id, imsArgs=list(uuid=uuid, sha1=sha1, processed=processed), ...) } MALDIquantForeign/R/sanitize-functions.R0000644000176200001440000000171413211235236017644 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .sanitize <- function(x) { x <- gsub(pattern="&", replacement="&", x=x) x <- gsub(pattern="<", replacement="<", x=x) gsub(pattern=">", replacement=">", x=x) } MALDIquantForeign/R/ibd-functions.R0000644000176200001440000000436613211235236016562 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeIbd <- function(x, filename, uuid, processed=TRUE) { ibd <- file(filename, open="wb") on.exit(close(ibd)) uuid <- gsub("-", "", tolower(uuid)) uuid <- substring(uuid, seq(1L, 32L, by=2L), seq(2L, 32L, by=2L)) uuid <- strtoi(uuid, base=16L) writeBin(uuid, con=ibd, size=1L, endian="little") for (i in seq(along=x)) { if (processed || i == 1L) { writeBin(as.double(x[[i]]@mass), con=ibd, size=8L, endian="little") } writeBin(as.double(x[[i]]@intensity), con=ibd, size=8L, endian="little") } } .ibdOffsets <- function(x, processed=TRUE, encodedLengthSize=8L) { ## start at 16 (16 bytes for UUID) n <- rep(lengths(x), each=2L) encodedLength <- as.double(n * encodedLengthSize) if (processed) { offsets <- cumsum(as.double(c(16L, encodedLength[-length(n)]))) } else { sel <- seq(from=2L, to=length(n), by=2L) offsets <- rep.int(16L, length(n)) offsets[sel] <- 16L + cumsum(as.double(encodedLength[sel])) } matrix(c(offsets, n, encodedLength), nrow=length(n), dimnames=list(rep(c("mass", "intensity"), times=length(x)), c("offset", "length", "encodedLength"))) } .addIbdOffsets <- function(x, processed=TRUE, encodedLengthSize=8L) { offsets <- .ibdOffsets(x, processed=processed, encodedLengthSize=encodedLengthSize) i <- split(1:nrow(offsets), rep(1:length(x), each=2L)) for (j in seq(along=x)) { x[[j]]@metaData$imaging$offsets <- offsets[i[[j]],] } x } MALDIquantForeign/R/importMzXml-functions.R0000644000176200001440000000303413211235236020315 0ustar liggesusers## Copyright 2012-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importMzXml <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { l <- readMzXmlData:::.readMzXmlFile(mzXmlFile=file, verbose=verbose, ...) lapply(l, function(x).createMassObject(mass=x$spectrum$mass, intensity=x$spectrum$intensity, snr=x$spectrum$snr, metaData=x$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/uuid-functions.R0000644000176200001440000000407313211235236016765 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see ## generate uuid needed for imzML idb files ## based on dplR::uuid.gen by Mikko Korpela ## should be compatible to: ## http://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 ## @param init used to create the md5 string, just for testing; don't change the ## default in other use cases. ## @return uuid string ## @noRd .uuid <- function(init=paste(c(Sys.info(), Sys.getpid(), unlist(R.version), Sys.getpid(), format(Sys.time(), "%Y%m%d%H%M%OS6 %Z"), runif(5L)), collapse = "")) { md5 <- digest::digest(init, algo="md5", serialize=FALSE) md5 <- strsplit(md5, "", fixed=TRUE)[[1L]] md5[13] <- "4" md5[17] <- c("8", "9", "a", "b")[strtoi(md5[17L], base=16L)%%4L + 1L] .paste0 <- function(...)paste0(..., collapse="") paste(.paste0(md5[1L:8L]), .paste0(md5[9L:12L]), .paste0(md5[13L:16L]), .paste0(md5[17L:20L]), .paste0(md5[21L:32L]), sep="-") } ## test uuid version 4 ## @param x character vector to test ## @return logical ## @noRd .isUuidV4 <- function(x) { grepl(paste0("^[0-9a-f]{8}-?", "[0-9a-f]{4}-?", "4[0-9a-f]{3}-?", "[89ab][0-9a-f]{3}-?", "[0-9a-f]{12}"), tolower(x)) } MALDIquantForeign/R/msd-functions.R0000644000176200001440000000732113211235236016601 0ustar liggesusers## Copyright 2012-2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeMsdDocument <- function(x, file, peaks, encoding="utf-8") { ## stop if file isn't writeable if (file.exists(file) && file.access(file, 2) != 0) { stop("No permissions to write into ", sQuote(file), "!") } ## file handle f <- file(file, open="wt", encoding=encoding) ## header .writeXmlHeader(file=f, encoding=encoding) .writeXmlTag("mSD", attrs=c(version=2.2), close=FALSE, file=f) .writeMsdDescription(x, file=f) .writeMsdSpectrum(x, file=f) if (!missing(peaks)) { .writeMsdPeakList(peaks, file=f) } .writeCloseXmlTag("mSD", file=f) invisible(close(f)) } .writeMsdDescription <- function(x, file) { .writeXmlTag("description", intend=1, close=FALSE, file=file) .writeXmlTag("title", text=.createMsdTitle(file), intend=2, file=file) .writeXmlTag("date", attrs=c(value=.sanitize(metaData(x)$acquisitionDate)), intend=2, file=file) .writeXmlTag("operator", attrs=c(value=.sanitize(metaData(x)$owner)), intend=2, file=file) .writeXmlTag("contact", attrs=c(value=.sanitize(metaData(x)$owner)), intend=2, file=file) .writeXmlTag("institution", attrs=c(value=.sanitize(metaData(x)$institution)), intend=2, file=file) .writeXmlTag("instrument", attrs=c(value=.sanitize(metaData(x)$instrument)), intend=2, file=file) .writeXmlTag("notes", .sanitize(paste(metaData(x)$comments, collapse="\n")), intend=2, file=file) .writeCloseXmlTag("description", intend=1, file=file) } .writeMsdSpectrum <- function(x, file) { polarity <- paste(metaData(x)$ionizationMode, metaData(x)$polarity) if (length(polarity)) { polarity <- ifelse(grepl(pattern="+|positive", x=polarity), "1", "-1") } else { polarity <- "" } .writeXmlTag("spectrum", attrs=c(points=length(x), msLevel=ifelse(is.null(metaData(x)$msLevel), 1, metaData(x)$msLevel), polarity=polarity), close=FALSE, intend=1, file=file) .writeMsdArray(mass(x), name="mzArray", file=file) .writeMsdArray(intensity(x), name="intArray", file=file) .writeCloseXmlTag("spectrum", intend=1, file=file) } .writeMsdArray <- function(x, name, file) { .writeXmlTag(name, text=.base64encode(x, size=8, compressionType="gzip"), attrs=c(precision="64", compression="zlib", endian=.Platform$endian), intend=2, file=file) } .writeMsdPeakList <- function(x, file) { .writeXmlTag("peaklist", close=FALSE, intend=1, file=file) cat(paste0(" \n"), file=file, sep="", append=TRUE) .writeCloseXmlTag("peaklist", intend=1, file=file) } .createMsdTitle <- function(file) { .sanitize(.withoutFileExtension(basename(summary(file)$description))) } MALDIquantForeign/R/xml-functions.R0000644000176200001440000000307213211235236016615 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .writeXmlHeader <- function(file, encoding) { cat("\n", file=file, sep="") } .writeCloseXmlTag <- function(tag, intend=0, file) { cat(paste0(rep(" ", times=intend)), "\n", file=file, sep="", append=TRUE) } .writeXmlTag <- function(tag, text=NULL, attrs=NULL, intend=0, close=TRUE, file) { intend <- paste0(rep(" ", times=intend)) if (length(attrs)) { attrs <- paste0(" ", names(attrs), "=\"", attrs, "\"") } if (length(text)) { text <- paste0(">", text) if (close) { text <- paste0(text, "") } } else { text <- ">" if (close) { text <- "/>" } } cat(intend, "<", tag, attrs, text, "\n", file=file, sep="", append=TRUE) } MALDIquantForeign/R/export-methods.R0000644000176200001440000003603213334627247017010 0ustar liggesusers## Copyright 2012-2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Export files #' #' This function provides a general interface to export #' \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}) #' into different file formats. #' #' @details #' Specific export functions: #' \tabular{ll}{ #' tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr #' msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr #' } #' #' @usage #' \S4method{export}{AbstractMassObject}(x, file, type="auto", force=FALSE, \ldots) #' #' @param x a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a #' \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported. #' @param type \code{character}, file format. If \code{type} is set to #' \dQuote{auto} the file extension is used. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to specific export functions. #' #' @seealso #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[MALDIquant]{MassSpectrum-class}} #' @author Sebastian Gibb #' @references \url{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, ...) { .exportToFile(x=x, file=file, type=type, force=force, ...) }) #' @usage #' \S4method{export}{list}(x, path, type, force=FALSE, \ldots) #' @rdname export-methods #' @export setMethod(f="export", signature=signature(x="list"), definition=function(x, path, type, force=FALSE, ...) { stopifnot(MALDIquant:::.isMassObjectList(x)) onefileSupport <- exportFormats$type[exportFormats$onefile] dots <- list(...) if (missing(path) && !is.null(dots$file)) { path <- dots$file dots$file <- NULL } isFile <- !isTRUE(file.info(path)$isdir) && tolower(.fileExtension(path)) %in% onefileSupport if (isFile) { do.call(.exportToFile, modifyList(list(x=x, file=path, type=type, force=force), dots)) } else { do.call(.exportToDir, modifyList(list(x=x, path=path, type=type, force=force), dots)) } }) #' Export to text files #' #' This function exports #' \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}) #' into different text file formats. #' #' @details #' \code{exportTab} and \code{exportCsv} use \code{\link[utils]{write.table}} #' with different defaults (\code{sep="\t"} in \code{exportTab} and #' \code{sep=","} in \code{exportCsv}). #' #' @usage #' \S4method{exportTab}{AbstractMassObject}(x, file, force=FALSE, \ldots) #' #' @param x a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a #' \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects. #' @param file \code{character}, file name. #' @param path \code{character}, path to directory in which the \code{list} of #' \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to \code{\link[utils]{write.table}}. #' #' @seealso #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[utils]{write.table}} #' @author Sebastian Gibb #' @references \url{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]{MassSpectrum-class}} objects 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]{MassSpectrum-class}} would be exported. If #' \code{path} is a single filename all spectra will be exported to a single #' mzML file. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param \ldots arguments to be passed to internal functions. #' #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}} #' #' @author Sebastian Gibb #' @references \url{http://strimmerlab.org/software/maldiquant/}, \cr #' HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: #' \url{http://www.psidev.info/mzml} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a single spectrum #' exportMzMl(s[[1]], file="spectrum.mzML") #' #' ## export a list of spectra #' exportMzMl(s, path="spectra.mzML") #' } #' #' @aliases exportMzMl exportMzMl,MassSpectrum-method exportMzMl,list-method #' @rdname exportMzMl-methods #' @docType methods #' @export setMethod(f="exportMzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, force=FALSE, ...) { export(x, file=file, type="mzml", force=force, ...) }) #' @usage #' \S4method{exportMzMl}{list}(x, path, force=FALSE, \ldots) #' @rdname exportMzMl-methods #' @export setMethod(f="exportMzMl", signature=signature(x="list"), definition=function(x, path, force=FALSE, ...) { export(x, path=path, type="mzml", force=force, ...) }) #' Export to imzML files #' #' This function exports #' \code{\link[MALDIquant]{MassSpectrum-class}} objects into imzML files. #' #' @usage #' \S4method{exportImzMl}{MassSpectrum}(x, file, force=FALSE, processed=TRUE, #' coordinates=NULL, pixelSize=c(100, 100), \ldots) #' #' @param x a \code{\link[MALDIquant]{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]{MassSpectrum-class}} would be exported. If #' \code{path} is a single filename all spectra will be exported to a single #' imzML file. #' @param force \code{logical}, If \code{TRUE} the \code{file} would be #' overwritten or \code{path} would be created. #' @param processed \code{logical}, If \code{TRUE} (default) the spectra will #' be saved in processed mode (means mass and intensity is stored for each #' spectra separately in contrast to continuous mode where the mass is stored #' only for one spectrum). #' @param coordinates \code{matrix}, 2 column matrix that contains the x- and #' y-coordinates for the spectra. #' @param pixelSize \code{numeric}, a vector of length 2 that contains the x and #' y pixel size in micrometers (default: \code{c(100, 100)}). #' @param \ldots arguments to be passed to internal functions. #' #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}} #' #' @author Sebastian Gibb #' @references \url{http://strimmerlab.org/software/maldiquant/} #' #' Schramm T, Hester A, Klinkert I, Both J-P, Heeren RMA, Brunelle A, #' Laprevote O, Desbenoit N, Robbe M-F, Stoeckli M, Spengler B, Roempp A #' (2012)\cr #' imzML - A common data format for the flexible exchange and processing of mass #' spectrometry imaging data.\cr #' Journal of Proteomics 75 (16):5106-5110. \cr #' \url{http://dx.doi.org/10.1016/j.jprot.2012.07.026} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a list of spectra #' exportImzMl(s, path="processed.imzML", coordinates=cbind(x=1:2, y=c(1, 1))) #' } #' #' @aliases exportImzMl exportImzMl,MassSpectrum-method exportImzMl,list-method #' @rdname exportImzMl-methods #' @docType methods #' @export setMethod(f="exportImzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), ...) { export(x, file=file, type="imzml", force=force, processed=processed, coordinates=coordinates, pixelSize=pixelSize, ...) }) #' @usage #' \S4method{exportImzMl}{list}(x, path, force=FALSE, processed=TRUE, #' coordinates=NULL, pixelSize=c(100, 100), \ldots) #' @rdname exportImzMl-methods #' @export setMethod(f="exportImzMl", signature=signature(x="list"), definition=function(x, path, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), ...) { export(x, path=path, type="imzml", force=force, processed=processed, coordinates=coordinates, pixelSize=pixelSize, ...) }) MALDIquantForeign/R/exportMsd-methods.R0000644000176200001440000000170613211235236017437 0ustar liggesusers## Copyright 2012 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportMsd", signature=signature(x="MassSpectrum"), definition=function(x, file, peaks, ...) { .writeMsdDocument(x=x, file=file, peaks=peaks, ...) }) MALDIquantForeign/R/package.R0000644000176200001440000000333613211235236015405 0ustar liggesusers## Copyright 2012-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Import/Export routines for \sQuote{MALDIquant} #' #' This package reads and writes different file formats of mass #' spectrometry data into/from \sQuote{MALDIquant} objects. #' #' \tabular{ll}{ #' Package: \tab MALDIquantForeign \cr #' License: \tab GPL (>= 3)\cr #' URL: \tab 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 readBrukerFlexData readBrukerFlexFile #' @importFrom stats na.omit runif #' @importFrom utils download.file modifyList packageVersion read.table tail #' type.convert write.table untar unzip #' @importFrom XML xmlEventParse xmlParse xmlValue xpathApply xpathSApply #' NULL MALDIquantForeign/R/parseMsd.R0000644000176200001440000001056713211235236015574 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parse msd files. #' #' This function parses msd files. #' #' @param file \code{character}, path to msd file. #' @param verbose \code{logical}, verbose output? #' #' @return Returns a list with metadata and spectra. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd .parseMsd <- function(file, verbose=FALSE, ...) { XML::xmlEventParse(file=file, handlers=.msdHandlers(fileName=file, verbose=verbose), addContext=FALSE, useTagName=TRUE, useDotNames=TRUE, ...)$getData() } #' Parse msd files. #' #' This function is defines handlers for XML SAX parser. Internal use only. #' #' @param fileName \code{character}, path to msd file #' @param verbose \code{logical}, verbose output? #' #' @return function closure #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references mMass homepage: \url{http://mmass.org/} #' @keywords internal #' @noRd .msdHandlers <- function(fileName, verbose=FALSE) { ## define local variables ## handle different mzXML versions msdVersion <- 0 ## save last opened tag (needed for .text()-processing) text <- character() endian <- "little" precision <- 32 ## build final list xml <- list() xml$metaData <- list() xml$spectrum <- list() ## handlers for specific tags ## mSD mSD <- function(name, attrs) { ## fetch version information msdVersion <<- readMzXmlData:::.grepDouble(attrs["version"]) .msg(verbose, "Found mSD document (version: ", msdVersion, ").") } ## mSD/description/date date <- function(name, attrs) { xml$metaData[["acquisitionDate"]] <<- readMzXmlData:::.attributeToString(attrs, "value") } operator <- function(name, attrs) { xml$metaData[["owner"]] <<- readMzXmlData:::.attributeToString(attrs, "value") } institution <- function(name, attrs) { xml$metaData[[name]] <<- readMzXmlData:::.attributeToString(attrs, "value") } ## mSD/spectrum spectrum <- function(name, attrs) { attributeNames <- c("scanNumber", "msLevel", "retentionTime", "precursorMZ", "precursorCharge", "polarity") attributeNames <- intersect(attributeNames, names(attrs)) for (i in attributeNames) { xml$metaData[[i]] <<- readMzXmlData:::.attributeToDouble(attrs, i) } } ## mSD/spectrum/mzArray mzArray <- function(name, attrs) { precision <<- readMzXmlData:::.attributeToDouble(attrs, "precision") endian <<- readMzXmlData:::.attributeToString(attrs, "endian") } ## default functions to catch tags without a handler .endElement <- function(name, attrs) { if (name == "title") { xml$metaData[c("name", "fullName", "sampleName")] <<- text } else if (name == "notes") { xml$metaData[["comment"]] <<- text } else if (name == "mzArray") { xml$spectrum[["mass"]] <<- .decodeArray() } else if (name == "intArray") { xml$spectrum[["intensity"]] <<- .decodeArray() } text <<- character() } .text <- function(x) { text <<- paste0(text, x) } .decodeArray <- function() { readMzXmlData:::.base64decode(x=text, endian=endian, size=round(precision/8L), compressionType="gzip") } ## return statement (please call getData()) list(getData=function() {return(xml)}, mSD=mSD, date=date, institution=institution, instrument=institution, spectrum=spectrum, mzArray=mzArray, intArray=mzArray, .endElement=.endElement, .text=.text) } MALDIquantForeign/R/import-functions.R0000644000176200001440000004534613334627376017361 0ustar liggesusers## Copyright 2012-2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Import files #' #' This function provides a general interface to import different file formats #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @details #' Specific import functions: #' \tabular{ll}{ #' txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr #' tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr #' csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr #' fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr #' ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr #' mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr #' mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr #' imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr #' analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr #' cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr #' msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr #' } #' #' \code{path}: In addition to the above mentioned file types the #' following (compressed) archives are supported, too: #' zip, tar, tar.gz, tar.bz2, tar.xz. The archives are uncompressed in a #' temporary directory. Afterwards the \code{\link[MALDIquantForeign]{import}} #' function is called (with \code{type="auto"}). #' #' \code{pattern}: Sometimes unusual file extensions are used (e.g. #' \code{"*.xml"} for mzXML files). In this case a specific #' \code{pattern} could be defined to import files with an unusual file #' extension (e.g. \code{pattern="^.*\\.xml$"} to read all \code{*.xml} #' files in a directory; see \code{\link[base]{regexp}} for details). #' #' \code{excludePattern}: Sometimes some files should be excluded. E.g. #' to ignore additional aquired Bruker LIFT spectra #' (MALDI-TOF/TOF; which are not support, yet) you could use #' \code{excludePattern="([[:digit:]\\.]+)LIFT[\\\\/]1SRef"}. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param type \code{character}, file format. If \code{type} is set to #' \dQuote{auto} MALDIquant tries to detect the correct file type #' automatically. It often depends on the file extension #' (if \code{path} is a directory the most represented file extension is used; #' \code{pattern} argument is ignored). #' @param pattern \code{character}, a regular expression to find files in a #' directory (see details). #' @param excludePattern \code{character}, a regular expression to exclude #' files in a directory (see details). #' @param removeEmptySpectra \code{logical}, should empty spectra excluded? #' @param centroided \code{logical}, if \code{centroided=FALSE} (default) #' the data are treated as not centroided and a list of #' \code{\link[MALDIquant]{MassSpectrum-class}} objects is returned. Use #' \code{centroided=TRUE} to assume centroided data and get a list of #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' @param massRange \code{double}, limits of mass import (left/minimal mass, #' right/maximal mass). #' @param minIntensity \code{double}, minimal intensity to import. #' @param mc.cores number of cores to use (default 1; only unix-based platforms #' are supported, see #' \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} for details). #' @param verbose \code{logical}, verbose output? #' @param \ldots arguments to be passed to specific import functions. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} #' @author Sebastian Gibb #' @references \url{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, mc.cores=1L, verbose=interactive(), ...) { ## download file if needed isUrl <- .isUrl(path) if (any(isUrl)) { path[isUrl] <- .download(path[isUrl], verbose=verbose) on.exit(.cleanupDownloadedTmpFiles()) } ## file exists? isReadable <- file.exists(path) & file.access(path, mode=4) == 0 if (any(!isReadable)) { stop(sQuote(path[!isReadable]), " doesn't exist or isn't readable!") } ## uncompress/unpack file if needed isCompressed <- .isPackedOrCompressed(path) if (any(isCompressed)) { path[isCompressed] <- .uncompress(path[isCompressed], verbose=verbose) on.exit(.cleanupUncompressedTmpFiles(), add=TRUE) } ## handle given file type i <- pmatch(tolower(type), c("auto", importFormats$type), nomatch=0, duplicates.ok=FALSE)-1 if (i == -1) { stop("File type ", sQuote(type), " is not supported!") } else if (i == 0) { ## auto detect file type if (!missing(pattern)) { warning("User defined ", sQuote("pattern"), " is ignored in auto-mode.") } return(.importAuto(path=path, excludePattern=excludePattern, removeEmptySpectra=removeEmptySpectra, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose, ...)) } else { ## user-defined file type if (missing(pattern)) { pattern <- importFormats$pattern[i] } handler <- get(importFormats$handler[i], mode="function") s <- unlist(MALDIquant:::.lapply(.files(path=path, pattern=pattern, excludePattern=excludePattern), handler, centroided=centroided, massRange=massRange, minIntensity=minIntensity, mc.cores=mc.cores, verbose=verbose, ...)) if (is.null(s)) { stop("Import failed! Unsupported file type?") } if (removeEmptySpectra) { emptyIdx <- MALDIquant::findEmptyMassObjects(s) if (length(emptyIdx)) { .msg(verbose, "Remove ", length(emptyIdx), " empty spectra.") return(s[-emptyIdx]) } } return(s) } } #' Import text files #' #' This function imports different text file formats #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' \code{importTab}, \code{importTxt} and \code{importCsv} use #' \code{\link[utils]{read.table}} with different defaults. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to \code{\link[utils]{read.table}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[utils]{read.table}} #' @author Sebastian Gibb #' @references \url{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, ...) { import(path=path, type="txt", ...) } #' @rdname importTab-functions #' @export importTab <- function(path, ...) { import(path=path, type="tab", ...) } #' @rdname importTab-functions #' @export importCsv <- function(path, ...) { import(path=path, type="csv", ...) } #' Import Bruker Daltonics *flex files #' #' This function imports files in Bruker Daltonics *flex-series file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[readBrukerFlexData]{readBrukerFlexFile}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}}, #' \code{\link[readBrukerFlexData]{readBrukerFlexFile}} #' @author Sebastian Gibb #' @references \url{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, ...) { 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, ...) { 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} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importMzMl(exampleDirectory) #' #' @rdname importMzMl-functions #' @export importMzMl <- function(path, ...) { import(path=path, type="mzml", ...) } #' Import imzML files #' #' This function imports files in imzML file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param coordinates \code{matrix}, 2 column matrix that contains the x- and #' y-coordinates for spectra that should be imported. Other spectra would be #' ignored. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{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(file.path(exampleDirectory, "tiny_continuous.imzML")) #' #' ## import only spectra for pixel 1,1 and 2,1 #' s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML"), #' coordinates = cbind(1:2, c(1, 1))) #' #' @rdname importImzMl-functions #' @export importImzMl <- function(path, coordinates=NULL, ...) { import(path=path, type="imzml", coordinates=coordinates, ...) } #' Import Ciphergen XML files #' #' This function imports files in Ciphergen XML file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{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, ...) { 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, ...) { 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 (requireNamespace("RNetCDF", quietly=TRUE)) { #' s <- importCdf(exampleDirectory) #' } else { #' message("You have to install the RNetCDF package to use importCdf.") #' } #' #' @rdname importCdf-functions #' @export importCdf <- function(path, ...) { import(path=path, type="cdf", ...) } #' Import MSD files #' #' This function imports files in mMass MSD file format #' into \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects. #' #' @param path \code{character}, path to directory or file which should be read #' in. #' @param \ldots arguments to be passed to #' \code{\link[MALDIquantForeign]{import}}. #' #' @return a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or #' \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the #' \code{centroided} argument). #' @seealso #' \code{\link[MALDIquant]{MassSpectrum-class}}, #' \code{\link[MALDIquant]{MassPeaks-class}} #' @author Sebastian Gibb #' @references \url{http://strimmerlab.org/software/maldiquant/}, \cr #' mMass homepage: \url{http://mmass.org/} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importMsd(exampleDirectory) #' #' @rdname importMsd-functions #' @export importMsd <- function(path, ...) { import(path=path, type="msd", ...) } MALDIquantForeign/R/importMsd-functions.R0000644000176200001440000000262113211235236017772 0ustar liggesusers## Copyright 2015 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importMsd <- function(file, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE) { .msg(verbose, "Reading spectrum from ", sQuote(file), " ...") if (!file.exists(file)) { stop("File ", sQuote(file), " doesn't exists!") } ## read file s <- .parseMsd(file=file, verbose=verbose) s$metaData$file <- file list(.createMassObject(mass=s$spectrum$mass, intensity=s$spectrum$intensity, metaData=s$metaData, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } MALDIquantForeign/R/parseMzMl.R0000644000176200001440000003054113424370143015725 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parse mzML files. #' #' This function parses mzML files. #' #' @param file \code{character}, path to mzML file #' @param verbose \code{logical}, verbose output? #' #' @return Returns a list with metadata and spectra. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd .parseMzMl <- function(file, verbose=FALSE, ...) { XML::xmlEventParse(file=file, handlers=.mzMlHandlers(fileName=file, verbose=verbose), addContext=FALSE, useTagName=TRUE, useDotNames=TRUE, ...)$getData() } #' Parse mzML files. #' #' This function is defines handlers for XML SAX parser. Internal use only. #' #' TODO: fetch obo map file and use it #' #' @param fileName \code{character}, path to mzML file #' @param verbose \code{logical}, verbose output? #' #' @return function closure #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @references #' Definition of \code{mzML} format: #' \url{http://www.psidev.info/mzml} #' @keywords internal #' @noRd .mzMlHandlers <- function(fileName, verbose=FALSE) { ## define local variables ## handle different mzXML versions mzMlVersion <- 0 ## save last opened tag (needed for .text()-processing) openTag <- "" ## store current scan values nSpectra <- 0L curSpecIdx <- 0L curRefId <- character() currentArrayContent <- character() fileCheckSum <- character() ## supported? supported <- TRUE ## build final list xml <- list() xml$metaData <- list() xml$spectra <- list() ## imzML information xml$ims <- list() ## reference values references <- new.env(parent=emptyenv()) ## handlers for specific tags ## mzML mzML <- function(name, attrs) { ## fetch version information mzMlVersion <<- readMzXmlData:::.grepDouble(attrs["xsi:schemaLocation"]) .msg(verbose, "Found mzML document (version: ", mzMlVersion, ").") } ## mzML/referenceableParamGroupList/referenceableParamGroup referenceableParamGroup <- function(name, attrs) { openTag <<- name curRefId <<- readMzXmlData:::.attributeToString(attrs, "id", required=TRUE) } referenceableParamGroupRef <- function(name, attrs) { if (!is.null(references[[attrs["ref"]]])) { xml$spectra[[curSpecIdx]]$metaData <<- modifyList(xml$spectra[[curSpecIdx]]$metaData, references[[attrs["ref"]]]) } } ## mzML/run/spectrumList spectrumList <- function(name, attrs) { ## fetch number of spectra nSpectra <<- readMzXmlData:::.attributeToDouble(attrs, "count", required=TRUE) .msg(verbose, "Found ", nSpectra, " ", ifelse(nSpectra == 1, "spectrum", "spectra"), ".") } ## mzML/run/spectrumList/spectrum spectrum <- function(name, attrs) { openTag <<- name curSpecIdx <<- curSpecIdx + 1 supported <<- TRUE xml$spectra[[curSpecIdx]] <<- list() xml$spectra[[curSpecIdx]]$metaData <<- list() xml$spectra[[curSpecIdx]]$metaData[["id"]] <<- readMzXmlData:::.attributeToString(attrs, "id", required=TRUE) xml$spectra[[curSpecIdx]]$metaData[["numberInFile"]] <<- curSpecIdx ## IMS extension if (length(xml$ims)) { xml$ims$ibd[[curSpecIdx]] <<- matrix(NA, nrow=2, ncol=3, dimnames=list(c("mass", "intensity"), c("offset", "length", "encodedLength"))) xml$spectra[[curSpecIdx]]$metaData$imaging <<- list() } .msg(verbose, "Processing spectrum ", curSpecIdx, "/", nSpectra, " (id: ", attrs["id"], ") ...") } chromatogram <- function(name, attrs) { warning(" tag is not supported!") supported <<- FALSE } ## *cvParam cvParam <- function(name, attrs) { ## polarity if (.isAttrSet(attrs, "MS:1000129", "negative scan")) { .setCvValue("negative", "polarity") return() } else if (.isAttrSet(attrs, "MS:1000130", "positive scan")) { .setCvValue("positive", "polarity") return() } ## ms level if (.isAttrSet(attrs, "MS:1000511", "ms level")) { .setCvValue( readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE), "msLevel") return() } ## centroid data if (.isAttrSet(attrs, "MS:1000127", "centroid spectrum")) { .setCvValue(1, "centroided") return() } ## precision if (.isAttrSet(attrs, "MS:1000521", "32-bit float")) { .setCvValue(32, "precision") return() } else if (.isAttrSet(attrs, "MS:1000523", "64-bit float")) { .setCvValue(64, "precision") return() } ## compression if (.isAttrSet(attrs, "MS:1000576", "no compression")) { .setCvValue("none", "compressionType") return() } else if (.isAttrSet(attrs, "MS:1000574", "zlib compression")) { .setCvValue("gzip", "compressionType") return() } ## data arrays if (.isAttrSet(attrs, "MS:1000514", "m/z array")) { .setCvValue("mass", "currentArray") return() } else if (.isAttrSet(attrs, "MS:1000515", "intensity array")) { .setCvValue("intensity", "currentArray") return() } else if (.isAttrSet(attrs, "MS:1000517", "signal to noise array")) { .setCvValue("snr", "currentArray") return() } else if (.isAttrSet(attrs, "MS:1000786", "non-standard data array")) { .setCvValue("nonstandard", "currentArray") return() } ## IMS extensions if (.isAttrSet(attrs, "IMS:1000080", "universally unique identifier")) { xml$ims$uuid <<- gsub(pattern="[[:punct:]]", replacement="", x=readMzXmlData:::.attributeToString(attrs, "value", required=TRUE)) return() } if (.isAttrSet(attrs, "IMS:1000090", "ibd MD5")) { xml$ims$md5 <<- readMzXmlData:::.attributeToString(attrs, "value") return() } if (.isAttrSet(attrs, "IMS:1000091", "ibd SHA-1")) { xml$ims$sha1 <<- readMzXmlData:::.attributeToString(attrs, "value") return() } if (.isAttrSet(attrs, "IMS:1000030", "continuous")) { xml$ims$type <<- "continuous" return() } if (.isAttrSet(attrs, "IMS:1000031", "processed")) { xml$ims$type <<- "processed" return() } if (.isAttrSet(attrs, "IMS:1000042", "max count of pixel x")) { xml$metaData$imaging$size["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000043", "max count of pixel y")) { xml$metaData$imaging$size["y"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000044", "max dimension x")) { xml$metaData$imaging$dim["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000045", "max dimension y")) { xml$metaData$imaging$dim["y"]<<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000046", "pixel size x")) { xml$metaData$imaging$pixelSize["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000047", "pixel size y")) { xml$metaData$imaging$pixelSize["y"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000050", "position x")) { xml$spectra[[curSpecIdx]]$metaData$imaging$pos["x"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000051", "position y")) { xml$spectra[[curSpecIdx]]$metaData$imaging$pos["y"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000102", "external offset")) { xml$ims$ibd[[curSpecIdx]][xml$spectra[[curSpecIdx]]$metaData$currentArray, "offset"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000103", "external array length")) { xml$ims$ibd[[curSpecIdx]][xml$spectra[[curSpecIdx]]$metaData$currentArray, "length"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } if (.isAttrSet(attrs, "IMS:1000104", "external encoded length")) { xml$ims$ibd[[curSpecIdx]][xml$spectra[[curSpecIdx]]$metaData$currentArray, "encodedLength"] <<- readMzXmlData:::.attributeToDouble(attrs, "value", required=TRUE) return() } } ## default functions to catch tags without a handler .startElement <- function(name, attrs) { openTag <<- name } .endElement <- function(name, attrs) { if (name == "binary" && supported) { .decodeArray() } else if (name == "fileChecksum") { .calculateFileChecksum() } if (openTag == name) { openTag <<- "" } } .text <- function(x) { if (openTag == "binary" && supported) { currentArrayContent <<- paste0(currentArrayContent, x) } else if (openTag == "fileChecksum") { fileCheckSum <<- paste0(fileCheckSum, x) } } ## helper functions .isAttrSet <- function(attrs, id, name) { return(attrs["accession"] == id || attrs["name"] == name) } .setCvValue <- function(x, name) { if (openTag == "referenceableParamGroup") { if (is.null(references[[curRefId]])) { references[[curRefId]] <<- list() } references[[curRefId]][[name]] <<- x } else if (openTag == "spectrum" || openTag == "binaryDataArray") { xml$spectra[[curSpecIdx]]$metaData[[name]] <<- x } else { xml$metaData[[name]] <<- x } } .decodeArray <- function() { if (length(currentArrayContent)) { ## read base64 encoded array content (endian must be "little") content <- readMzXmlData:::.base64decode(x=currentArrayContent, endian="little", size=round(xml$spectra[[curSpecIdx]]$metaData$precision/8), compressionType=xml$spectra[[curSpecIdx]]$metaData$compressionType) xml$spectra[[curSpecIdx]][[xml$spectra[[curSpecIdx]]$metaData$currentArray]] <<- content ## clear array content currentArrayContent <<- character() } ## clear metaData xml$spectra[[curSpecIdx]]$metaData[c("precision", "compressionType", "currentArray")] <<- NULL } .calculateFileChecksum <- function() { n <- nchar(fileCheckSum) if (n <= 0) { return() } ## sha1 sum for this file (from the beginning of the file up to (and ## including) the opening tag .msg(verbose, "Look for '' position ...") ## 14 == nchar("") checkSumPos <- readMzXmlData:::.revfregexpr("", fileName) + 14 .testChecksum(fileName, fileCheckSum, algo="sha1", length=checkSumPos-1, verbose=verbose) } ## return statement (please call getData()) list(getData=function() {return(xml)}, mzML=mzML, referenceableParamGroup=referenceableParamGroup, referenceableParamGroupRef=referenceableParamGroupRef, spectrumList=spectrumList, spectrum=spectrum, chromatogram=chromatogram, cvParam=cvParam, .startElement=.startElement, .endElement=.endElement, .text=.text) } MALDIquantForeign/R/parseCiphergenXml.R0000644000176200001440000000545113211235236017432 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see #' Parse Ciphergen XML files. #' #' This function parses Ciphergen XML files. #' #' @param file \code{character}, path to Ciphergen XML file #' @param verbose \code{logical}, verbose output? #' #' @return Returns a list with metadata and spectra. #' #' @author Sebastian Gibb \email{mail@@sebastiangibb.de} #' @keywords internal #' @noRd .parseCiphergenXml <- function(file, ...) { ## metaData listNames <- c("name", "ionSourceVoltage", "digitizerRate", "massCalibrationA", "massCalibrationB", "massCalibrationT0", "massCalibrationInfo", "spotCorrectionFactor") xpath <- paste0("//spectrum/", c("spectrumName", paste0("acquisitionInfo/setting/", listNames[2:3]), paste0("processingParameters/massCalibration/", listNames[-c(1:3)])), "/text()") doc <- xmlParse(file, ...) metaData <- XML::xpathApply(doc=doc, path=xpath, fun=XML::xmlValue) names(metaData) <- listNames metaData[listNames[-c(1, 7)]] <- lapply(metaData[-c(1, 7)], as.double) metaData$file <- normalizePath(file) intensity <- XML::xpathSApply(doc=doc, path="//spectrum/tofData/tofDataSamples/text()", fun=XML::xmlValue) intensity <- as.double(strsplit(intensity, "[[:space:]]+")[[1]]) intensity <- intensity[!is.na(intensity)] ## tof2mass ## mass = U*(A*(tof-t0)^2 + B) ## Calibration formula was taken from: ## 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) list(spectrum=list(mass=mass, intensity=intensity), metaData=metaData) } MALDIquantForeign/R/importAuto-functions.R0000644000176200001440000000410513211235236020156 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importAuto <- function(path, excludePattern=NULL, removeEmptySpectra=TRUE, centroided=FALSE, massRange=c(0, Inf), minIntensity=0, verbose=FALSE, ...) { files <- lapply(importFormats$pattern, .files, path=path, excludePattern=excludePattern) names(files) <- importFormats$type ## test xml files for ciphergen format files$ciphergen <- .testCiphergenXml(files$ciphergen) n <- vapply(files, length, integer(1)) if (all(n)) { stop("Could not detect any supported file type.") } m <- which.max(n) .msg(verbose, n[m], " files of type=", sQuote(importFormats$type[m]), " found.") import(path=files[[m]], type=importFormats$type[m], pattern=importFormats$pattern[m], removeEmptySpectra=removeEmptySpectra, centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose, ...) } # test xml for ciphergen format # returns files in ciphergen xml format .testCiphergenXml <- function(files) { ## read first 4 lines of each file l <- lapply(files, readLines, n=4) p <- lapply(l, grepl, pattern="||") s <- vapply(p, sum, integer(1)) isCiphergen <- s >= 2 files[isCiphergen] } MALDIquantForeign/R/exportMzMl-methods.R0000644000176200001440000000225613211235236017574 0ustar liggesusers## Copyright 2013 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see setMethod(f=".exportMzMl", signature=signature(x="MassSpectrum"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { .writeMzMlDocument(x=list(x), file=file, id=id, ...) }) setMethod(f=".exportMzMl", signature=signature(x="list"), definition=function(x, file, id=.withoutFileExtension(basename(file)), ...) { .writeMzMlDocument(x=x, file=file, id=id, ...) }) MALDIquantForeign/R/analyze-functions.R0000644000176200001440000001122513363142044017461 0ustar liggesusers## Copyright 2013-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see ## Analyze 7.5 header file .readAnalyzeHdr <- function(filename, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } size <- file.info(filename)$size ## Analyze 7.5 header must be of size 348; ABSciex files are a little bit ## larger (384) if (size != 348 && size != 384) { stop(sQuote(filename), " is no ANALYZE header file.") } .msg(verbose, "Extracting header information from ", sQuote(filename), " ...") f <- file(filename, open="rb") on.exit(close(f)) ## first 4 bytes have to be 348 in little endian mode ## (384 for ABSciex) endian <- ifelse(readBin(f, "integer", n=1, size=4, endian="little") %in% c(348, 384), "little", "big") ## skip unused entries seek(f, where=38) regular <- readChar(f, nchars=1, useBytes=TRUE) if (regular != "r") { stop("Wrong file format. Images have to be of equal size (", sQuote("regular"), " must be ", sQuote("r"), ")") } ## skip unused entries seek(f, where=40) ## 2 == number of intensity, 3 == ncol (x), 4 == nrow (y) ## use as.double() here to avoid integer overflows in calculations like nx*ny ## later ## Thanks to Ken Frankel for reporting this problem. dimensions <- as.double(readBin(f, "integer", n=8, size=2, endian=endian)) ## We use the size of the t2m file. See .readAnalyzeIntensity for details. #ni <- dimensions[2] nx <- dimensions[3] ny <- dimensions[4] ## skip unused entries seek(f, where=70) datatype <- readBin(f, "integer", n=1, size=2, endian=endian) bitpix <- readBin(f, "integer", n=1, size=2, endian=endian) if (datatype %in% c(2, 4, 8)) { what <- "integer" } else if (datatype %in% c(16, 32, 64)) { what <- "double" } else { what <- "raw" } signed <- datatype == 2 size <- bitpix/8 ## skip unused entries seek(f, where=76) pixdim <- readBin(f, "double", n=8, size=4, endian=endian) ## pixelwidth in mm xd <- pixdim[2] yd <- pixdim[3] list(nx=nx, ny=ny, xd=xd, yd=yd, endian=endian, what=what, signed=signed, size=size) } ## Analyze 7.5 img file .readAnalyzeIntensity <- function(filename, header, ni, skip=c(0, 0), verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } .msg(verbose, "Reading intensity values from ", sQuote(filename), " ...") stopifnot(length(skip) == 2) skip <- skip*header$size f <- file(filename, open="rb") on.exit(close(f)) ## header$ni should contain the number of intensity values ## because the format specification uses int16 for header$ni it is limited to ## 32767 intensity values. ## We use the size of the t2m file divided by 4 to find the correct number to ## circumvent this size limit. ## Thanks to Ken Frankel for reporting this problem. i <- vector(mode=header$what, length=ni*header$nx*header$ny) dim(i) <- c(ni, header$nx, header$ny) for (y in 1:header$ny) { for (x in 1:header$nx) { ## CAUTION: seek on Windows is possibly buggy; see ?seek for details. ## If there are any bug reports on Windows we maybe have to ignore "skip" ## on Windows (which would disable the mass range/memory saving feature ## completely). seek(f, where=seek(f)+skip[1]) i[, x, y] <- readBin(f, what=header$what, n=ni, size=header$size, signed=header$signed, endian=header$endian) seek(f, where=seek(f)+skip[2]) } } i } ## Analyze 7.5 t2m file .readAnalyzeMass <- function(filename, header, verbose=FALSE) { if (!file.exists(filename)) { stop(sQuote(filename), " isn't readable.") } .msg(verbose, "Reading mass values from ", sQuote(filename), " ...") n <- file.info(filename)$size/4 f <- file(filename, open="rb") on.exit(close(f)) readBin(f, what="double", n=n, size=4, signed=TRUE, endian=header$endian) } MALDIquantForeign/R/importTab-functions.R0000644000176200001440000000532513341754500017765 0ustar liggesusers## Copyright 2012-2014 Sebastian Gibb ## ## ## This file is part of MALDIquantForeign for R and related languages. ## ## MALDIquantForeign is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation, either version 3 of the License, or ## (at your option) any later version. ## ## MALDIquantForeign is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with MALDIquantForeign. If not, see .importTab <- function(file, centroided=FALSE, massRange=c(0L, Inf), minIntensity=0L, skip=0L, sep=NULL, header=NULL, comment.char="#", encoding="unknown", verbose=FALSE, ...) { text <- readLines(file, encoding=encoding) text <- tail(text, length(text) - skip) text <- text[!startsWith(trimws(text), comment.char)] if (is.null(sep)) { sep <- .autoSep(text) } if (is.null(header)) { header <- .autoHeader(text, sep=sep) } ## load ms file s <- read.table(text=text, header=header, sep=sep, skip=skip, comment.char=comment.char, stringsAsFactors=FALSE, ...) list(.createMassObject(mass=s[, 1L], intensity=s[, 2L], metaData=list(file=file), centroided=centroided, massRange=massRange, minIntensity=minIntensity, verbose=verbose)) } .importCsv <- function(file, centroided=FALSE, massRange=c(0L, Inf), minIntensity=0L, skip=0L, sep=NULL, header=NULL, comment.char="#", encoding="unknown", verbose=FALSE, ...) { .importTab(file=file, centroided=centroided, massRange=massRange, minIntensity=minIntensity, skip=skip, sep=sep, header=header, comment.char=comment.char, encoding=encoding, verbose=verbose, ...) } .autoHeader <- function(text, sep="\t") { l <- gsub(pattern='[\\\\"]*', replacement="", x=text) l <- strsplit(l, split=sep)[[1L]][1L] !is.numeric(type.convert(l, as.is=TRUE)) } .autoSep <- function(text, sep=c(",", ";", "\t", " ")) { pattern <- paste0(".+", sep, ".+") i <- vapply(pattern, function(x) { g <- gregexpr(pattern=x, text=text)[[1L]] all(g > 0L) & length(g) == 1L }, logical(1L)) if (any(i)) { sep[which(i)[1L]] ## return only first match } else { sep[1L] } } MALDIquantForeign/vignettes/0000755000176200001440000000000013424407626015503 5ustar liggesusersMALDIquantForeign/vignettes/bibliography.bib0000644000176200001440000000250213211235236020621 0ustar liggesusers@MANUAL{RPROJECT, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2014}, url = {http://www.R-project.org/}, } @ARTICLE{MALDIquant, title = {{MALDI}quant: a versatile {R} package for the analysis of mass spectrometry data}, author = {Sebastian Gibb and Korbinian Strimmer}, volume = {28}, number = {17}, pages = {2270-2271}, year = {2012}, doi = {10.1093/bioinformatics/bts447}, url = {http://bioinformatics.oxfordjournals.org/content/28/17/2270.abstract}, eprint = {http://bioinformatics.oxfordjournals.org/content/28/17/2270.full.pdf+html}, journal = {Bioinformatics}, publisher = {Oxford Univ Press}, } @ARTICLE{Tan2006, title={Finding regions of significance in {SELDI} measurements for identifying protein biomarkers}, author={Tan, Chuen Seng and Ploner, Alexander and Quandt, Andreas and Lehti{\"o}, Janne and Pawitan, Yudi}, volume={22}, number={12}, pages={1515--1523}, year={2006}, doi = {10.1093/bioinformatics/btl106}, url = {http://bioinformatics.oxfordjournals.org/content/22/12/1515.abstract}, eprint = {http://bioinformatics.oxfordjournals.org/content/22/12/1515.full.pdf+html}, journal={Bioinformatics}, publisher={Oxford Univ Press} } MALDIquantForeign/vignettes/MALDIquantForeign-intro.Rnw0000644000176200001440000001370413211235236022530 0ustar liggesusers%\VignetteEngine{knitr} %\VignetteIndexEntry{MALDIquantForeign: Import/Export routines for MALDIquant} %\VignetteKeywords{Bioinformatics, Proteomics, Mass Spectrometry} %\VignettePackage{MALDIquantForeign} \documentclass[12pt]{article} \usepackage{natbib} \usepackage{hyperref} \usepackage{tikz} \usepackage{bibentry} % inline bibentries \nobibliography* % no special bibliography for bibentry \newcommand{\R}{\texttt{R}} \newcommand{\CRAN}{\texttt{CRAN}} \newcommand{\Rfunction}[1]{{\texttt{#1}}} \newcommand{\Robject}[1]{{\texttt{#1}}} \newcommand{\Rpackage}[1]{{\texttt{#1}}} \newcommand{\Mq}{\Rpackage{MALDIquant}} \newcommand{\MqF}{\Rpackage{MALDIquantForeign}} \newcommand{\email}[1]{\href{mailto:#1}{\normalfont\texttt{#1}}} \title{\MqF{}: Import/Export routines for \Mq{}} \author{ Sebastian Gibb% \thanks{\email{mail@sebastiangibb.de}} } \date{\today} \begin{document} <>= library("knitr") opts_chunk$set(tidy.opts=list(width.cutoff=45), tidy=FALSE, fig.align="center", fig.height=4.25, comment=NA, prompt=TRUE) @ <>= suppressPackageStartupMessages(library("MALDIquant")) suppressPackageStartupMessages(library("MALDIquantForeign")) @ \maketitle \begin{abstract} \MqF{} provides routines for importing/exporting different file formats into/from \Mq{}.\\ This vignette describes the usage of the \MqF{} package. \end{abstract} \clearpage \tableofcontents \section*{Foreword} \MqF{} is free and open source software for the \R{} \citep{RPROJECT} environment and under active development. If you use it, please support the project by citing it in publications: \begin{quote} \bibentry{MALDIquant} \end{quote} If you have any questions, bugs, or suggestions do not hesitate to contact me (\email{mail@sebastiangibb.de}). \\ Please visit \url{http://strimmerlab.org/software/maldiquant/}. \section{Introduction} \Mq{} should be device and platform independent. That's why it has not any import/export functions. \\ \MqF{} fills this gap and provides import/export routines for various file formats: <>= supportedFileFormats() @ \section{Setup} After starting \R{} we could install \Mq{} and \MqF{} directly from \CRAN{} using \Rfunction{install.packages}: <>= install.packages(c("MALDIquant", "MALDIquantForeign")) @ Before we can use \Mq{} and \MqF{} we have to load the packages. <>= library("MALDIquant") library("MALDIquantForeign") @ \section{Import} \MqF{} provides an \Rfunction{import} function that tries to auto-detect the correct file type. Because this would never be perfect \MqF{} offers also many \Rfunction{import*} functions like \Rfunction{importBrukerFlex}, \Rfunction{importMzMl}, etc. Please see the manual page of \Rfunction{import} for a complete list (\Rfunction{?import}).\\ First we try to import some example data in Bruker Daltonics *flex-series file format using the \Rfunction{import} function. <>= ## get the example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") spectra <- import(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ Next we use the \Rfunction{importBrukerFlex} function (the result is the same as above). <>= spectra <- importBrukerFlex(file.path(exampleDirectory, "brukerflex"), verbose=FALSE) spectra[[1]] @ \MqF{} supports compressed files, too (\emph{zip}, \emph{tar.\{bz2, gz,xz\}}). <>= spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.tar.gz"), verbose=FALSE) spectra[[1]] spectra <- importCsv(file.path(exampleDirectory, "compressed", "csv.zip"), verbose=FALSE) spectra[[1]] @ Remote files are supported as well. Data are taken from \citet{Tan2006}. <>= spectra <- import(paste0("http://www.meb.ki.se/", "~yudpaw/papers/spikein_xml.zip"), centroided=FALSE, verbose=TRUE) @ If you want to read peak lists (centroided data) instead of spectra data you have to set \Rfunction{centroided=TRUE}. <>= peaks <- import(file.path(exampleDirectory, "ascii.txt"), centroided=TRUE, verbose=FALSE) peaks @ \section{Export} The export routines in \MqF{} are very similar to the import routines. Please see manual page of \Rfunction{export} for a complete list of supported export routines (\Rfunction{?export}). First we create a simple list of \Robject{MassSpectrum} objects using \Rfunction{createMassSpectrum}. <>= spectra <- list( createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=6:10)) @ Now we want to export the first spectrum into a CSV file. <>= export(spectra[[1]], file="spectrum1.csv") import("spectrum1.csv") @ Exporting every file by hand is cumbersome. We want to export the whole list of spectra. Instead of \Robject{file} we use \Robject{path} now to specify a directory. Please note that we have to add the file type/format information now (we can use the \Robject{type} argument or the corresponding \Rfunction{export*} function). If the path doesn't exists we will get an error. To force \Rfunction{export} to create/overwrite the given path, we set the argument \Robject{force=TRUE}. <>= export(spectra, type="csv", path="spectra", force=TRUE) list.files("spectra") @ \section{Analyse Mass Spectrometry Data} Please have a look at the corresponding vignette shipped with \Mq{} and the \Mq{} website: \url{http://strimmerlab.org/software/maldiquant/}. <>= vignette(topic="MALDIquant", package="MALDIquant") @ \section{Session Information} <>= toLatex(sessionInfo(), locale=FALSE) @ \bibliographystyle{apalike} \bibliography{bibliography} \end{document} MALDIquantForeign/MD50000644000176200001440000001635313425002121013771 0ustar liggesuserse0b7080dad9f5f29defdfb27fdcd5055 *DESCRIPTION 239f2ca23dfb8e6e1c412d77e5fef820 *NAMESPACE 20ff5926a3c1d925ca69a81ee184476a *NEWS 1a7732f3a9b780b00941aca4a1b4c089 *R/AllGenerics.R b09f7c3504a3dd158913ce0eda3d1085 *R/MALDIquantForeign-parallel.R 5de22a3830c2835b77386c3e075472a5 *R/analyze-functions.R d858b7dfe62579b0f8690f0f4af626d6 *R/base64encode-functions.R d0ab8613cd2a943f1f2414b66e7aca33 *R/compression-functions.R 526875cc5703cf1b87e0c1cee060b053 *R/createMassObject-functions.R caa33570ea434f608484b99772f96c49 *R/download-function.R 75906bd060dd9665beb22e9655787c51 *R/export-functions.R 65968c7c64025e4659a85b5fcafaa458 *R/export-methods.R 9aa0e5b12d4c26c1c4ed98449f83cbf8 *R/exportImzMl-methods.R a565443380a217c932f8e6ed778f1449 *R/exportMsd-methods.R 263ffe0dc55509e70e46dc1427a308b1 *R/exportMzMl-methods.R ecfcf756e38f25fa2621f612ca25b84a *R/exportTab-methods.R c78a3559e9ec87598fd7d6a7a8ddb53a *R/fileFormats.R 5df96127fe7c883d20f2d8116aca4e24 *R/filename-functions.R 62643bebde1acd81fab75bdc3bda857a *R/filename-methods.R 835269077b9e05e808e49a4c2b12c7e4 *R/ibd-functions.R 1a2acf0a6a86eefcea621b4cfd105d62 *R/import-functions.R 6182b0644c83faaf5cce1d11ad9bf7d7 *R/importAnalyze-functions.R 5c576c3d597a04222ed0ae0096e28816 *R/importAuto-functions.R 239a01312f968e4758ea4465fc608dc9 *R/importBrukerFlex-functions.R eae32ea5b9306c23238bc1b0fb49dc19 *R/importCdf-functions.R b5ef5779b408802796def7bb203860cb *R/importCiphergenXml-functions.R 532378ededc237cacf3483e2c969b75a *R/importImzMl-functions.R f226ec871d20f4a54df5fab07163b234 *R/importMsd-functions.R 0880b48b4392bf8adadddcc5315252cc *R/importMzMl-functions.R 247d4c41523ecd95c18f0d9d544ba843 *R/importMzXml-functions.R bdbd2efdd7a00ac4e6ee27dbf27ce003 *R/importTab-functions.R 35c92145f354caabe55177ea49a6000b *R/imzMl-functions.R eb4a9e6131098dc3ec0a081fad980898 *R/list.files-functions.R 4bb38e350bb16d36e38e3929821bb9a1 *R/msd-functions.R 18b7c73ebc1c6e50944830351b4f3778 *R/msg-functions.R c5f02496bba66bc2b952f99a385b3ca5 *R/mzMl-functions.R 4ce8fb9040f7188714bd3e7d37062eb6 *R/package.R 57f6c1b0c6fc40ed7f183362ada7a348 *R/parseCiphergenXml.R e93bdde9e6e0ca15c875819b73252a4d *R/parseMsd.R 2530a20477b170608bdc8adf349bd27d *R/parseMzMl.R 5ff130e9930ea8502c8c7b3e45980a73 *R/sanitize-functions.R bdbaecef5012d4164a71525922ec9d4f *R/testChecksum-functions.R 0c2ae5fafc1ae70528f0e5bb02ffac8f *R/uuid-functions.R a4b92b6f309e60be3af2363e2066f47c *R/xml-functions.R e2daadfbcdad41b9aab1abf19669c80d *build/vignette.rds 9b47d07debb7bc07b22ff5877a5ad37e *inst/doc/MALDIquantForeign-intro.R fa3507f704915074f42215d1a7acaf19 *inst/doc/MALDIquantForeign-intro.Rnw 3c596a1a7e4d975ac2a4f2e911bdef16 *inst/doc/MALDIquantForeign-intro.pdf 9274dd34d675950326a222a952309a17 *inst/exampledata/ascii.txt 85077ca13692b5a2469af51d18cffd64 *inst/exampledata/brukerflex/0_A1/1/1SLin/acqu fe054ad2e7b98bee673f9ff22d50f00c *inst/exampledata/brukerflex/0_A1/1/1SLin/fid 10e9d68aa23b1d7b85688a969be41897 *inst/exampledata/ciphergen/tiny.xml 4b725014b8cacf380e44475b95905d7d *inst/exampledata/compressed/csv.tar.gz c449fa2a93410566dba5e145ed09b0ae *inst/exampledata/compressed/csv.zip 448976240c5d1caccd3d2fe3a8c04e7e *inst/exampledata/compressed/csv1.csv.gz 4ca88a472371bd1e63d57987c06c4c43 *inst/exampledata/csv1.csv 4b2a03f6bbe5747bd50273be357533c1 *inst/exampledata/csv2.csv 90838531af29160ed4d7917edd7dbc4c *inst/exampledata/tiny.cdf 064e9a9a06250b5a29593ca23c592891 *inst/exampledata/tiny1-centroided.mzML1.1.mzML b2bc5ad00c449401ae4495677673af0a *inst/exampledata/tiny1-centroided.mzXML3.0.mzXML 4cabaefc8fe6d8f1bd0f55a9ba06e763 *inst/exampledata/tiny1-compressed.mzML1.1.mzML 09be2b7fff0d1834938d4aebaab4761c *inst/exampledata/tiny1-compressed.mzXML3.0.mzXML e06173e88f17386b359e124f8a33e758 *inst/exampledata/tiny1.msd 489b1be67d30d175969dbb66f8bcb9b7 *inst/exampledata/tiny1.mzML1.1.mzML 3b8bd26f7fc636e57388d52b3f9f3eb7 *inst/exampledata/tiny1.mzXML3.0.mzXML dcd657ee36f05b2b7be19f4db23184a4 *inst/exampledata/tiny_continuous.ibd 2decd26e6ba4ee132ab91fbe21125390 *inst/exampledata/tiny_continuous.imzML 1bcd45de54f0180c38afceb468371971 *inst/exampledata/tiny_processed.ibd ff2f70b3f12cb3cdafdcbe81b856a3ed *inst/exampledata/tiny_processed.imzML 0d2eb3838721e69a173eb3a335b65ca2 *man/MALDIquantForeign-package.Rd ae631cef5d7cf469a8466daf8aff955d *man/MALDIquantForeign-parallel.Rd 024d7fbb4524e3cf5bca1168259d04dd *man/base64-encode.Rd 192c40ad46b874a76495d207d7bb33df *man/export-methods.Rd eebb7366d857e8e6c671ea00dac91351 *man/exportImzMl-methods.Rd cacbc643ff52403dd9ee3c876451f646 *man/exportMsd-methods.Rd abed1e47845bdfacfa2de45605f5d0c7 *man/exportMzMl-methods.Rd e8e8049d009d43257a09e0a6d3db0bf1 *man/exportTab-methods.Rd 1f1d42780b962696deba1febfbd4a6b0 *man/import-functions.Rd a30aeb1d1ea9da44b587863f1f336fa6 *man/importAnalyze-functions.Rd 46b35dee48f0bd6c0325a3050598b305 *man/importBrukerFlex-functions.Rd 9dbe7ff9ed81052dcb51009e256bda5f *man/importCdf-functions.Rd ca2bc97f8e62507b06e73869484281a9 *man/importCiphergenXml-functions.Rd c98c00ed9ce51b4d547aeb39537602b8 *man/importImzMl-functions.Rd 4f3a92c3b6c6cc8f4cf791556707f0bb *man/importMsd-functions.Rd 52ad03ff09d3113b054950061511af6e *man/importMzMl-functions.Rd 4fcfe2dc744a22e2e74e1fa813006ba6 *man/importMzXml-functions.Rd a8d81064418cdcc9ae62dbd937116556 *man/importTab-functions.Rd 3e000216bd7d750bebdc62fb2a0e3156 *man/supportedFileFormats-functions.Rd f743796f136a436364c76e6b0f83d474 *tests/testthat.R b798ecbef464ea1807946fa217445894 *tests/testthat/test_compression-functions.R 0857bc348532e96bcfd91f7ae4d0475d *tests/testthat/test_createMassObject-functions.R debeabc712adc81b15966652fc9be840 *tests/testthat/test_download-functions.R e0103c88895cf5dc448e881fe14f9cbf *tests/testthat/test_exportImzMl-methods.R 208ec10c169824675066ec8cb037aa54 *tests/testthat/test_exportMsd-methods.R bda24926bda8ba196607439c40bc8a0f *tests/testthat/test_exportMzMl-methods.R bc154ef954d4012596f14aeeb9f9d90a *tests/testthat/test_exportTab-methods.R c0c445cb3dc0146a53ed5c7cb4326467 *tests/testthat/test_fileFormats.R 4c794d2aa272d40186b93e7d19ab3d25 *tests/testthat/test_filename-functions.R 2c30aa4314b05352630a6a9a74578475 *tests/testthat/test_ibd-functions.R 84ac426570d99e3a3e4639013b4ca6b7 *tests/testthat/test_importBrukerFlex-functions.R 071c254f1a0870eb09163742840ee3eb *tests/testthat/test_importCdf-functions.R 8432026fd0ec2a342cfe9c6f23dc21ca *tests/testthat/test_importCiphergenXml-functions.R 17ea5917b8dbc97de2d1214e0391acb8 *tests/testthat/test_importImzMl-functions.R 688f77adbcefb49f0910338a8fbff29e *tests/testthat/test_importMsd-functions.R de7de747a128ba1c30656b7b3d663edd *tests/testthat/test_importMzMl-functions.R 107cb57fff1e06e1619d810443734b90 *tests/testthat/test_importMzXml-functions.R 98797d012db45b0dec4176786114e1f7 *tests/testthat/test_importTab-functions.R 683c710df52b1d3218ba8e708943b15b *tests/testthat/test_list.files-functions.R 33be42ee6c030ad06a3b25898995fa63 *tests/testthat/test_msg-functions.R d84de43b77d9af0f60c8afcf3a06390d *tests/testthat/test_mzMl-functions.R 62f4062ce2e6a8e8bb3aacefded07bf0 *tests/testthat/test_sanitize-functions.R c107102debc5d24e6096c38dde9199fc *tests/testthat/test_testChecksum-functions.R 09171eb807444e4b40e76a31edec4eec *tests/testthat/test_uuid-functions.R fa3507f704915074f42215d1a7acaf19 *vignettes/MALDIquantForeign-intro.Rnw dcdcd775ae2bcfb2aea05af8e6921bef *vignettes/bibliography.bib MALDIquantForeign/build/0000755000176200001440000000000013424407626014572 5ustar liggesusersMALDIquantForeign/build/vignette.rds0000644000176200001440000000042713424407626017134 0ustar liggesusersRK0N:]AQ$oJ- 郯M%%Ϳyus_|wݑ16`|HǤ(`"ًc6y[Js@_!&^AoԀ5aUNTbȺh7pS@~Xi fVlӟA= 'w%Fz].͜MsV1jC Z3Ԫ`&Bğ ,;7K9I#Ԛ$TUI)L+[JMALDIquantForeign/DESCRIPTION0000644000176200001440000000251713425002121015164 0ustar liggesusersPackage: MALDIquantForeign Version: 0.12 Date: 2019-01-30 Title: Import/Export Routines for 'MALDIquant' Authors@R: c(person("Sebastian", "Gibb", role=c("aut", "cre"), email="mail@sebastiangibb.de", comment=c(ORCID="0000-0001-7406-4443")), person("Pietro", "Franceschi", role=c("ctb"), email="pietro.franceschi@fmach.it")) Depends: R (>= 3.2.2), methods, MALDIquant (>= 1.16.4) Imports: base64enc, digest, readBrukerFlexData (>= 1.7), readMzXmlData (>= 2.7), XML Suggests: knitr, testthat (>= 0.8), RNetCDF (>= 1.6.1) Description: Functions for reading (tab, csv, Bruker fid, Ciphergen XML, mzXML, mzML, imzML, Analyze 7.5, CDF, mMass MSD) and writing (tab, csv, mMass MSD, mzML, imzML) different file formats of mass spectrometry data into/from 'MALDIquant' objects. License: GPL (>= 3) URL: http://strimmerlab.org/software/maldiquant/ https://github.com/sgibb/MALDIquantForeign/ BugReports: https://github.com/sgibb/MALDIquantForeign/issues/ LazyLoad: yes VignetteBuilder: knitr RoxygenNote: 6.1.0 NeedsCompilation: no Packaged: 2019-01-30 20:56:54 UTC; sebastian Author: Sebastian Gibb [aut, cre] (), Pietro Franceschi [ctb] Maintainer: Sebastian Gibb Repository: CRAN Date/Publication: 2019-02-01 08:33:21 UTC MALDIquantForeign/man/0000755000176200001440000000000013253525277014251 5ustar liggesusersMALDIquantForeign/man/importBrukerFlex-functions.Rd0000644000176200001440000000232713334627733022056 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importBrukerFlex} \alias{importBrukerFlex} \title{Import Bruker Daltonics *flex files} \usage{ importBrukerFlex(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[readBrukerFlexData]{readBrukerFlexFile}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in Bruker Daltonics *flex-series file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") s <- importBrukerFlex(exampleDirectory) } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readBrukerFlexData]{readBrukerFlexFile}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importImzMl-functions.Rd0000644000176200001440000000304613334627733021034 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importImzMl} \alias{importImzMl} \title{Import imzML files} \usage{ importImzMl(path, coordinates = NULL, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{coordinates}{\code{matrix}, 2 column matrix that contains the x- and y-coordinates for spectra that should be imported. Other spectra would be ignored.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in imzML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML")) ## import only spectra for pixel 1,1 and 2,1 s <- importImzMl(file.path(exampleDirectory, "tiny_continuous.imzML"), coordinates = cbind(1:2, c(1, 1))) } \references{ \url{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}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importTab-functions.Rd0000644000176200001440000000260313334627733020510 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importTxt} \alias{importTxt} \alias{importTab} \alias{importCsv} \title{Import text files} \usage{ importTxt(path, ...) importTab(path, ...) importCsv(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[utils]{read.table}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports different text file formats into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \details{ \code{importTab}, \code{importTxt} and \code{importCsv} use \code{\link[utils]{read.table}} with different defaults. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import txt files s <- importTxt(exampleDirectory) ## import csv files s <- importCsv(exampleDirectory) } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[utils]{read.table}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportMzMl-methods.Rd0000644000176200001440000000323113334627733020321 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportMzMl,MassSpectrum-method} \alias{exportMzMl,MassSpectrum-method} \alias{exportMzMl} \alias{exportMzMl,list-method} \title{Export to mzML files} \usage{ \S4method{exportMzMl}{MassSpectrum}(x, file, force=FALSE, \ldots) \S4method{exportMzMl}{list}(x, path, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} would be exported. If \code{path} is a single filename all spectra will be exported to a single mzML file.} \item{\ldots}{arguments to be passed to internal functions.} } \description{ This function exports \code{\link[MALDIquant]{MassSpectrum-class}} objects into mzML files. } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a single spectrum exportMzMl(s[[1]], file="spectrum.mzML") ## export a list of spectra exportMzMl(s, path="spectra.mzML") } } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: \url{http://www.psidev.info/mzml} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/supportedFileFormats-functions.Rd0000644000176200001440000000335013334627733022730 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/fileFormats.R \name{supportedFileFormats} \alias{supportedFileFormats} \title{Supported file formats} \usage{ supportedFileFormats() } \value{ a \code{list} with two named elements (\code{import} and \code{export}) containing a \code{character} vector of supported file types. } \description{ This function prints all file formats supported by \code{\link{MALDIquantForeign-package}}. } \details{ \subsection{Import}{ \tabular{ll}{ txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr } } \subsection{Export}{ \tabular{ll}{ tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr } } } \examples{ library("MALDIquantForeign") supportedFileFormats() } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquantForeign]{export}}, \code{\link[MALDIquantForeign]{import}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importMzMl-functions.Rd0000644000176200001440000000224413334627733020662 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importMzMl} \alias{importMzMl} \title{Import mzML files} \usage{ importMzMl(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in mzML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importMzMl(exampleDirectory) } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{mzML} format: \url{http://www.psidev.info/mzml} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importCdf-functions.Rd0000644000176200001440000000241713334627733020501 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importCdf} \alias{importCdf} \title{Import CDF files} \usage{ importCdf(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in NetCDF file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects.\cr Please note that the \emph{RNetCDF} is needed. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import if (requireNamespace("RNetCDF", quietly=TRUE)) { s <- importCdf(exampleDirectory) } else { message("You have to install the RNetCDF package to use importCdf.") } } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importMzXml-functions.Rd0000644000176200001440000000235613334627733021056 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importMzXml} \alias{importMzXml} \title{Import mzXML files} \usage{ importMzXml(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[readMzXmlData]{readMzXmlFile}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in mzXML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importMzXml(exampleDirectory) } \references{ \url{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}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importMsd-functions.Rd0000644000176200001440000000221013334627733020517 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importMsd} \alias{importMsd} \title{Import MSD files} \usage{ importMsd(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in mMass MSD file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importMsd(exampleDirectory) } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr mMass homepage: \url{http://mmass.org/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/importAnalyze-functions.Rd0000644000176200001440000000202513334627733021403 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importAnalyze} \alias{importAnalyze} \title{Import Analyze 7.5 files} \usage{ importAnalyze(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in Analyze 7.5 file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \references{ \url{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}} } \author{ Sebastian Gibb } MALDIquantForeign/man/export-methods.Rd0000644000176200001440000000433713334627733017531 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{export,AbstractMassObject-method} \alias{export,AbstractMassObject-method} \alias{export} \alias{export,list-method} \title{Export files} \usage{ \S4method{export}{AbstractMassObject}(x, file, type="auto", force=FALSE, \ldots) \S4method{export}{list}(x, path, type, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{type}{\code{character}, file format. If \code{type} is set to \dQuote{auto} the file extension is used.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{\ldots}{arguments to be passed to specific export functions.} } \description{ This function provides a general interface to export \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}) into different file formats. } \details{ Specific export functions: \tabular{ll}{ tab \tab \code{\link[MALDIquantForeign]{exportTab}} \cr csv \tab \code{\link[MALDIquantForeign]{exportCsv}} \cr imzML \tab \code{\link[MALDIquantForeign]{exportImzMl}} \cr msd \tab \code{\link[MALDIquantForeign]{exportMsd}} \cr mzML \tab \code{\link[MALDIquantForeign]{exportMzMl}} \cr } } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a single spectrum export(s[[1]], file="spectrum.csv") ## identical to exportCsv(s[[1]], file="spectrum.csv") ## export a list of spectra export(s, path="spectra", type="csv") ## identical to exportCsv(s, path="spectra") } } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/base64-encode.Rd0000644000176200001440000000177613334627733017072 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/base64encode-functions.R \name{.base64encode} \alias{.base64encode} \title{Converts double to base64 character.} \usage{ .base64encode(x, size, endian = .Platform$endian, compressionType = c("none", "gzip")) } \arguments{ \item{x}{\code{double}, vector} \item{size}{\code{integer}, number of bytes per element in the byte stream (see \code{size} in \code{\link[base]{writeBin}}).} \item{endian}{\code{character}, the endian-ness (see \code{endian} in \code{\link[base]{writeBin}}).} \item{compressionType}{\code{character}, type of compression to use for compression of \code{x} (see \code{type} in \code{\link[base]{memCompress}}.} } \value{ Vector of type \code{character}. } \description{ This function converts a \code{double} vector to a base64 encoded \code{character} vector. } \seealso{ \code{\link[base64enc]{base64encode}} from \pkg{base64enc} package } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{internal} MALDIquantForeign/man/import-functions.Rd0000644000176200001440000001075313334627733020066 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{import} \alias{import} \title{Import files} \usage{ import(path, type = "auto", pattern, excludePattern = NULL, removeEmptySpectra = TRUE, centroided = FALSE, massRange = c(0, Inf), minIntensity = 0, mc.cores = 1L, verbose = interactive(), ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{type}{\code{character}, file format. If \code{type} is set to \dQuote{auto} MALDIquant tries to detect the correct file type automatically. It often depends on the file extension (if \code{path} is a directory the most represented file extension is used; \code{pattern} argument is ignored).} \item{pattern}{\code{character}, a regular expression to find files in a directory (see details).} \item{excludePattern}{\code{character}, a regular expression to exclude files in a directory (see details).} \item{removeEmptySpectra}{\code{logical}, should empty spectra excluded?} \item{centroided}{\code{logical}, if \code{centroided=FALSE} (default) the data are treated as not centroided and a list of \code{\link[MALDIquant]{MassSpectrum-class}} objects is returned. Use \code{centroided=TRUE} to assume centroided data and get a list of \code{\link[MALDIquant]{MassPeaks-class}} objects.} \item{massRange}{\code{double}, limits of mass import (left/minimal mass, right/maximal mass).} \item{minIntensity}{\code{double}, minimal intensity to import.} \item{mc.cores}{number of cores to use (default 1; only unix-based platforms are supported, see \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} for details).} \item{verbose}{\code{logical}, verbose output?} \item{\ldots}{arguments to be passed to specific import functions.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function provides a general interface to import different file formats into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \details{ Specific import functions: \tabular{ll}{ txt \tab \code{\link[MALDIquantForeign]{importTxt}} \cr tab \tab \code{\link[MALDIquantForeign]{importTab}} \cr csv \tab \code{\link[MALDIquantForeign]{importCsv}} \cr fid \tab \code{\link[MALDIquantForeign]{importBrukerFlex}} \cr ciphergen \tab \code{\link[MALDIquantForeign]{importCiphergenXml}} \cr mzXML \tab \code{\link[MALDIquantForeign]{importMzXml}} \cr mzML \tab \code{\link[MALDIquantForeign]{importMzMl}} \cr imzML \tab \code{\link[MALDIquantForeign]{importImzMl}} \cr analyze \tab \code{\link[MALDIquantForeign]{importAnalyze}} \cr cdf \tab \code{\link[MALDIquantForeign]{importCdf}} \cr msd \tab \code{\link[MALDIquantForeign]{importMsd}} \cr } \code{path}: In addition to the above mentioned file types the following (compressed) archives are supported, too: zip, tar, tar.gz, tar.bz2, tar.xz. The archives are uncompressed in a temporary directory. Afterwards the \code{\link[MALDIquantForeign]{import}} function is called (with \code{type="auto"}). \code{pattern}: Sometimes unusual file extensions are used (e.g. \code{"*.xml"} for mzXML files). In this case a specific \code{pattern} could be defined to import files with an unusual file extension (e.g. \code{pattern="^.*\\.xml$"} to read all \code{*.xml} files in a directory; see \code{\link[base]{regexp}} for details). \code{excludePattern}: Sometimes some files should be excluded. E.g. to ignore additional aquired Bruker LIFT spectra (MALDI-TOF/TOF; which are not support, yet) you could use \code{excludePattern="([[:digit:]\\.]+)LIFT[\\\\/]1SRef"}. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import mzXML files s <- import(exampleDirectory, type="mzXML") ## import tab delimited file with different file extension (default: *.tab) s <- import(exampleDirectory, type="tab", pattern="^.*\\\\.txt") ## import single mzML file s <- import(file.path(exampleDirectory, "tiny1.mzML1.1.mzML")) ## import gzipped csv file s <- import(file.path(exampleDirectory, "compressed", "csv1.csv.gz")) } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportMsd-methods.Rd0000644000176200001440000000411313334627733020165 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportMsd,MassSpectrum-method} \alias{exportMsd,MassSpectrum-method} \alias{exportMsd} \alias{exportMsd,list-method} \title{Export to MSD files} \usage{ \S4method{exportMsd}{MassSpectrum}(x, file, force=FALSE, peaks, \ldots) \S4method{exportMsd}{list}(x, path, force=FALSE, peaks, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{peaks}{a \code{\link[MALDIquant]{MassPeaks-class}} object or a \code{list} of \code{\link[MALDIquant]{MassPeaks-class}} objects.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{\ldots}{arguments to be passed to \code{\link[utils]{write.table}}.} } \description{ This function exports \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}) into mMass MSD files. } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) p <- list(createMassPeaks(mass=4:5, intensity=4:5, snr=1:2), createMassPeaks(mass=4:5, intensity=4:5, snr=1:2)) ## export a single spectrum exportMsd(s[[1]], file="spectrum.msd") ## export a single spectrum with corresponding peaks exportMsd(s[[1]], file="spectrum.msd", peaks=p[[1]]) ## export a list of spectra with corresponding peaks exportMsd(s, path="spectra", peaks=p, force=TRUE) } } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr mMass homepage: \url{http://mmass.org/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportTab-methods.Rd0000644000176200001440000000421013334627733020146 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportTab,AbstractMassObject-method} \alias{exportTab,AbstractMassObject-method} \alias{exportTab} \alias{exportTab,list-method} \alias{exportCsv} \alias{exportCsv,AbstractMassObject-method} \alias{exportCsv,list-method} \title{Export to text files} \usage{ \S4method{exportTab}{AbstractMassObject}(x, file, force=FALSE, \ldots) \S4method{exportTab}{list}(x, path, force=FALSE, \ldots) \S4method{exportCsv}{AbstractMassObject}(x, file, force=FALSE, \ldots) \S4method{exportCsv}{list}(x, path, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} would be exported.} \item{\ldots}{arguments to be passed to \code{\link[utils]{write.table}}.} } \description{ This function exports \code{\link[MALDIquant]{AbstractMassObject-class}} objects (e.g. \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}) into different text file formats. } \details{ \code{exportTab} and \code{exportCsv} use \code{\link[utils]{write.table}} with different defaults (\code{sep="\t"} in \code{exportTab} and \code{sep=","} in \code{exportCsv}). } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a single spectrum exportTab(s[[1]], file="spectrum.tab") ## export a list of spectra and use ; as separator exportCsv(s, path="spectra", sep=";", force=TRUE) } } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[utils]{write.table}} } \author{ Sebastian Gibb } MALDIquantForeign/man/MALDIquantForeign-parallel.Rd0000644000176200001440000000377513334627733021557 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/MALDIquantForeign-parallel.R \name{MALDIquantForeign-parallel} \alias{MALDIquantForeign-parallel} \title{Parallel Support in Package \pkg{MALDIquantForeign}} \description{ \code{\link[MALDIquantForeign]{MALDIquantForeign-package}} offers multi-core support using \code{\link[parallel]{mclapply}} and \code{\link[parallel]{mcmapply}}. This approach is limited to unix-based platforms. } \details{ Please note that not all import functions benfit from parallelisation. The current implementation is limited to run the parallelisation over different files. That's why only imports of multiple files could be run on multiple cores. E.g. a single mzML file containing 4 spectra would always be read on a single core. In contrast 4 mzML files each containing just one spectra could be read in using 4 cores. The improvement in the runtime depends on the amount of data to read, the proportion of parsing/decoding of the data, the amount of memory and the speed of the hard disk. Please note: It is possible that using parallelisation results in a worse runtime! } \examples{ ## load packages library("MALDIquant") library("MALDIquantForeign") exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## run single-core import print(system.time( s1 <- importMzMl(exampleDirectory, centroided=TRUE, verbose=FALSE) )) if(.Platform$OS.type == "unix") { ## run multi-core import ## (because the example spectra are very small (just 5 data points) the ## multi-core solution is slower on most systems) print(system.time( s2 <- importMzMl(exampleDirectory, centroided=TRUE, mc.cores=2, verbose=FALSE) )) stopifnot(all.equal(s1, s2)) } } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MALDIquant-parallel}}, \code{\link[parallel]{mclapply}}, \code{\link[parallel]{mcmapply}} } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{misc} MALDIquantForeign/man/importCiphergenXml-functions.Rd0000644000176200001440000000221513334627733022366 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importCiphergenXml} \alias{importCiphergenXml} \title{Import Ciphergen XML files} \usage{ importCiphergenXml(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[MALDIquantForeign]{import}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports files in Ciphergen XML file format into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import s <- importCiphergenXml(exampleDirectory) } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/exportImzMl-methods.Rd0000644000176200001440000000474013334627733020500 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/export-methods.R \docType{methods} \name{exportImzMl,MassSpectrum-method} \alias{exportImzMl,MassSpectrum-method} \alias{exportImzMl} \alias{exportImzMl,list-method} \title{Export to imzML files} \usage{ \S4method{exportImzMl}{MassSpectrum}(x, file, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), \ldots) \S4method{exportImzMl}{list}(x, path, force=FALSE, processed=TRUE, coordinates=NULL, pixelSize=c(100, 100), \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{force}{\code{logical}, If \code{TRUE} the \code{file} would be overwritten or \code{path} would be created.} \item{processed}{\code{logical}, If \code{TRUE} (default) the spectra will be saved in processed mode (means mass and intensity is stored for each spectra separately in contrast to continuous mode where the mass is stored only for one spectrum).} \item{coordinates}{\code{matrix}, 2 column matrix that contains the x- and y-coordinates for the spectra.} \item{pixelSize}{\code{numeric}, a vector of length 2 that contains the x and y pixel size in micrometers (default: \code{c(100, 100)}).} \item{path}{\code{character}, path to directory in which the \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} would be exported. If \code{path} is a single filename all spectra will be exported to a single imzML file.} \item{\ldots}{arguments to be passed to internal functions.} } \description{ This function exports \code{\link[MALDIquant]{MassSpectrum-class}} objects into imzML files. } \examples{ \dontrun{ library("MALDIquant") library("MALDIquantForeign") s <- list(createMassSpectrum(mass=1:5, intensity=1:5), createMassSpectrum(mass=1:5, intensity=1:5)) ## export a list of spectra exportImzMl(s, path="processed.imzML", coordinates=cbind(x=1:2, y=c(1, 1))) } } \references{ \url{http://strimmerlab.org/software/maldiquant/} Schramm T, Hester A, Klinkert I, Both J-P, Heeren RMA, Brunelle A, Laprevote O, Desbenoit N, Robbe M-F, Stoeckli M, Spengler B, Roempp A (2012)\cr imzML - A common data format for the flexible exchange and processing of mass spectrometry imaging data.\cr Journal of Proteomics 75 (16):5106-5110. \cr \url{http://dx.doi.org/10.1016/j.jprot.2012.07.026} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } \author{ Sebastian Gibb } MALDIquantForeign/man/MALDIquantForeign-package.Rd0000644000176200001440000000121213334627733021336 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/package.R \docType{package} \name{MALDIquantForeign-package} \alias{MALDIquantForeign-package} \title{Import/Export routines for \sQuote{MALDIquant}} \description{ This package reads and writes different file formats of mass spectrometry data into/from \sQuote{MALDIquant} objects. } \details{ \tabular{ll}{ Package: \tab MALDIquantForeign \cr License: \tab GPL (>= 3)\cr URL: \tab http://strimmerlab.org/software/maldiquant/\cr } } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \keyword{package}