MALDIquantForeign/0000755000176200001440000000000013154037240013462 5ustar liggesusersMALDIquantForeign/inst/0000755000176200001440000000000013154036204014436 5ustar liggesusersMALDIquantForeign/inst/exampledata/0000755000176200001440000000000013124015231016715 5ustar liggesusersMALDIquantForeign/inst/exampledata/tiny_continuous.ibd0000644000176200001440000000021012522426621022651 0ustar liggesusers4VxLޯ4Vx?@@@@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/tiny1-centroided.mzML1.1.mzML0000644000176200001440000000753212325512134024013 0ustar liggesusers AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/csv1.csv0000644000176200001440000000005012325512134020307 0ustar liggesusers"mass","intensity" 1,6 2,7 3,8 4,9 5,10 MALDIquantForeign/inst/exampledata/tiny1-centroided.mzXML3.0.mzXML0000644000176200001440000000316612325512134024273 0ustar liggesusers P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 1cf2b3695447d2dd698b465e27f452a80192dd62 MALDIquantForeign/inst/exampledata/tiny1.mzXML3.0.mzXML0000644000176200001440000000313412325512134022150 0ustar liggesusers P/AAAAAAAABAGAAAAAAAAEAAAAAAAAAAQBwAAAAAAABACAAAAAAAAEAgAAAAAAAAQBAAAAAAAABAIgAAAAAAAEAUAAAAAAAAQCQAAAAAAAA= 0 0 b87b09a4f34561d5572f9a6d30056106f819bc69 MALDIquantForeign/inst/exampledata/tiny1.msd0000644000176200001440000000106712522450613020502 0ustar liggesusers tiny eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== MALDIquantForeign/inst/exampledata/tiny1.mzML1.1.mzML0000644000176200001440000000673012325512134021674 0ustar liggesusers AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AADAQAAA4EAAAABBAAAQQQAAIEE= AAAAAAAA8D8AAAAAAAAAQAAAAAAAAAhAAAAAAAAAEEAAAAAAAAAUQA== AAAAAAAAJEAAAAAAAAAiQAAAAAAAACBAAAAAAAAAHEAAAAAAAAAYQA== MALDIquantForeign/inst/exampledata/tiny_processed.ibd0000644000176200001440000000026012522426621022437 0ustar liggesusers4VxLޯ4Vx?@@@@@@ @"@$@@@ @"@$@$@"@ @@@MALDIquantForeign/inst/exampledata/tiny_continuous.imzML0000644000176200001440000001235412522426621023157 0ustar liggesusers MALDIquantForeign/inst/exampledata/ascii.txt0000644000176200001440000000002512325512134020551 0ustar liggesusers1 6 2 7 3 8 4 9 5 10 MALDIquantForeign/inst/exampledata/tiny.cdf0000644000176200001440000000071412325512134020366 0ustar liggesusersCDF  scan_number point_number  scan_index4 point_count<scan_acquisition_timeD mass_valuesTintensity_values\?@? @ @ @@@@@ @"@$MALDIquantForeign/inst/exampledata/ciphergen/0000755000176200001440000000000012325512134020667 5ustar liggesusersMALDIquantForeign/inst/exampledata/ciphergen/tiny.xml0000644000176200001440000000153512325512134022400 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/0000755000176200001440000000000012325512134021074 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/0000755000176200001440000000000012325512134021554 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/0000755000176200001440000000000012325512134021714 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/0000755000176200001440000000000012325512134022642 5ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/fid0000644000176200001440000000002412325512134023323 0ustar liggesusersMALDIquantForeign/inst/exampledata/brukerflex/0_A1/1/1SLin/acqu0000644000176200001440000000071112325512134023515 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/0000755000176200001440000000000012615440505021073 5ustar liggesusersMALDIquantForeign/inst/exampledata/compressed/csv.zip0000644000176200001440000000031612325512134022406 0ustar liggesusersPK bXBv((csv1.csvUT )Q)Qux "mass","intensity" 1,6 2,7 3,8 4,9 5,10 PK bXBv((csv1.csvUT)Qux PKNjMALDIquantForeign/inst/exampledata/compressed/csv1.csv.gz0000644000176200001440000000007412325512134023100 0ustar liggesusersSM,.VQ+I+,T21212ֱ2ѱ214v(MALDIquantForeign/inst/exampledata/compressed/csv.tar.gz0000644000176200001440000000023512522426621023015 0ustar liggesusersα 0y9HMS}X:d t"| ߤ&] *pOuGu/ߴ~RO-ܶǤ%߷jKjh:7Mp38=n(MALDIquantForeign/inst/exampledata/tiny1-compressed.mzML1.1.mzML0000644000176200001440000000665412325512134024043 0ustar liggesusers eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYDjgwMDwAIgZHBkYBIBYwREAJcMDFA== eJxjYACBD/YMEOAAoTigtACUFnEAADZ/Alw= eJxjYAABFQcwxaAEpRWgtAyUlnAAACEsAds= MALDIquantForeign/inst/exampledata/tiny1-compressed.mzXML3.0.mzXML0000644000176200001440000000304412325512134024312 0ustar liggesusers eJyz/8AABg4SUJoBSstAaQ4orQClBaC0EpQWgdIqEBoA0joENg== 0 0 7e7ef0ea030f6a56d34a4ebd446e22b22844d432 MALDIquantForeign/inst/exampledata/csv2.csv0000644000176200001440000000002512325512134020312 0ustar liggesusers1;6 2;7 3;8 4;9 5;10 MALDIquantForeign/inst/exampledata/tiny_processed.imzML0000644000176200001440000001235412522426621022740 0ustar liggesusers MALDIquantForeign/inst/doc/0000755000176200001440000000000013154036204015203 5ustar liggesusersMALDIquantForeign/inst/doc/MALDIquantForeign-intro.Rnw0000644000176200001440000001370413154036204022242 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.R0000644000176200001440000000552513154036204021677 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.pdf0000644000176200001440000042264113154036204022251 0ustar liggesusers%PDF-1.5 % 33 0 obj << /Length 616 /Filter /FlateDecode >> stream xڅTMS0W(ԊvS!7$r?+ہH9۷%0gb6?P kѰE@3+bͮ.?kXmvqIH{R8)ZZ~Q?d9ZvYZYNgnwS_5qJ"/ <*J ;—"`O-\ӷB+#trŶx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pEil]yuӏNg Nnqb*gy$lK2naY95 K.^ݓa (3m!c4,SPWm{y(HόdpW'O[N_İ=6Cg΋gtV^>=۞^#Iyп\6$44Lq.FJ`Ӻ}0Yt=nzܓ}y!/DNemhժ4ݧ7{o~|5|⋾T2i*|!|%O)WG\9Cy+Gr,ǣJޱj$OͤdX?'yQBn }j%$t|vFJAB"7bk) Hk(g,"ߕQ] q-ofr&5 QvayX>Yglllf+Yc3#`o>@]55 ^~Evo~ϢXz='[+=?w /GOgZr&[ROkHd;r<!ʫA5)dʨd5"A,kn G8˰Pބ7m~Lآ؏g_j2^PR(__~ kg'dڦ(ϙʮ^@aYdƃ.Z뢭b!{n$% twNPme½l aNFYEN~ V,/S>:yl;~:oB W# Yu&?ɿųSTՋ7g?xf _O{TP$F̅Q7#YB_`]ξ?yjo,!nѯHE.z0ڜĂP{U90p؟p$דa5SYՔ_snGW.ǓjSkzӊ_d@ z8L5)cAWؗ 2v -vZvw+%2޸u%\FN /[~wK2r\- sT[b}lX:ؗ e+VgK >|X7`v`{)/+GGuf9.c_8Mkq)}9-c_8ȻXNM+{ʇoxW?5L76_6_ 7?zڴ4@'mwlv endstream endobj 135 0 obj << /Author()/Title()/Subject()/Creator(LaTeX with hyperref package)/Producer(pdfTeX-1.40.17)/Keywords() /CreationDate (D:20170906202051+02'00') /ModDate (D:20170906202051+02'00') /Trapped /False /PTEX.Fullbanner (This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) kpathsea version 6.2.2) >> endobj 127 0 obj << /Type /ObjStm /N 14 /First 105 /Length 489 /Filter /FlateDecode >> stream x}Ko0 <6ZzAڦHЃ b(QI}Hk`P p0LS@\3Ҁ";@S$ I""Dmo ī[q->3oEu*- ,%9Pzʏ7ywm8a*Pֽh 9`2Q!B={`irx&0IHQ^eHacfj}6?Oma~)/ɠy`X?W?.6z1=5C37HT|BRvTB2.LA"YFrBrkUUqE]FMia)8cˤ đšK<0yYj8rvucY6oԿ[ goEn}süV[ 6V;;PWm>V`ʹAP endstream endobj 136 0 obj << /Type /XRef /Index [0 137] /Size 137 /W [1 3 1] /Root 134 0 R /Info 135 0 R /ID [<9E4F05E0F2A3797140041870A88454F0> <9E4F05E0F2A3797140041870A88454F0>] /Length 333 /Filter /FlateDecode >> stream x7RQE@A Bx=a%N [`$D,b$lt;9ϟ'"x`@ R-!)8d!A13d {b)/L0[ʠ&>?RE-A-\9\1\TC BC4BZJyF '8\4t@B'S%i.>7  vfaT%cq{H",AaVa a2*}*򔳴򑵴XUM-^?[W}xttUgrB\ F4¥.=p^ .P endstream endobj startxref 140116 %%EOF MALDIquantForeign/tests/0000755000176200001440000000000012523634224014630 5ustar liggesusersMALDIquantForeign/tests/testthat.R0000644000176200001440000000006412523634224016613 0ustar liggesuserslibrary("testthat") test_check("MALDIquantForeign") MALDIquantForeign/tests/testthat/0000755000176200001440000000000013154037240016464 5ustar liggesusersMALDIquantForeign/tests/testthat/test_list.files-functions.R0000644000176200001440000000167112615154055023742 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.R0000644000176200001440000000506512670625352023313 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.R0000644000176200001440000002102213150576766023617 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.R0000644000176200001440000000135312523634227025171 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.R0000644000176200001440000000145112523634227024326 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.R0000644000176200001440000000037213017323667022455 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.R0000644000176200001440000000416712523634227023622 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.R0000644000176200001440000000340112601026330025062 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.R0000644000176200001440000000326612667746215023513 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])), 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.R0000644000176200001440000000543712601030514023770 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.R0000644000176200001440000000135712523634227025511 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.R0000644000176200001440000000235412670625273023276 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.R0000644000176200001440000000520012523634227023440 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")) }) 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_importMzXml-functions.R0000644000176200001440000000400512523634227024164 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.R0000644000176200001440000000616713017324140024223 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.R0000644000176200001440000001125212670625500023435 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.R0000644000176200001440000000167412523634227022641 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.R0000644000176200001440000000114612523634227023643 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.R0000644000176200001440000000551212523634227023627 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(textConnection(x[i]), sep=sep[i]), result[i]) } }) test_that("autoSep", { for (i in seq(along=x)) { expect_identical(MALDIquantForeign:::.autoSep(textConnection(x[i])), sep[i]) } }) MALDIquantForeign/tests/testthat/test_importImzMl-functions.R0000644000176200001440000000444312523634227024153 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.R0000644000176200001440000000313713146521563022425 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.R0000644000176200001440000000075612523634227022140 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.R0000644000176200001440000000030712523634227023511 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/NAMESPACE0000644000176200001440000000205712615214352014707 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/NEWS0000644000176200001440000002046313152312413014162 0ustar liggesusersRELEASE HISTORY OF THE "MALDIquantForeign" PACKAGE ================================================== 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/0000755000176200001440000000000013150603644013666 5ustar liggesusersMALDIquantForeign/R/AllGenerics.R0000644000176200001440000000420312523634201016174 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.R0000644000176200001440000000367413022357053017242 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.R0000644000176200001440000000503712523634201017341 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.R0000644000176200001440000000343112566326011017444 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.R0000644000176200001440000004216212523634201016737 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) .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000285", name="total ion current", value=totalIonCurrent(x[[i]])), file=file) if (MALDIquant::isMassSpectrum(x[[i]])) { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000128", name="profile spectrum"), file=file) } else { .writeXmlTag("cvParam", intend=4, attrs=c(cvRef="MS", accession="MS:1000127", name="centroid spectrum"), file=file) } 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")) 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=value[i])) } .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=value[i])) } .writeXmlTag("binary", intend=6, file=file) .writeCloseXmlTag("binaryDataArray", intend=5, file=file) } MALDIquantForeign/R/fileFormats.R0000644000176200001440000000777312523634201016276 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.R0000644000176200001440000000433512601026330020651 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.R0000644000176200001440000000372112523634201020260 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.R0000644000176200001440000000644212615211441021236 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.R0000644000176200001440000000575313022357041017604 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) 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.R0000644000176200001440000000535012601026330017740 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.R0000644000176200001440000001035513022357165020310 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.R0000644000176200001440000000247412601026330021321 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.R0000644000176200001440000000246513022357366020475 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.R0000644000176200001440000000245713022357016017427 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.R0000644000176200001440000000337012523634201020072 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.R0000644000176200001440000000260612601026330021632 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.R0000644000176200001440000000154612523634201016607 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.R0000644000176200001440000000267712601030514020133 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.R0000644000176200001440000000635012523634201020360 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.R0000644000176200001440000000543712601030514021013 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.R0000644000176200001440000000244013150572753017752 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.R0000644000176200001440000000445113150603562017112 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), file=file, id=id, imsArgs=list(uuid=uuid, sha1=sha1, processed=processed), ...) } MALDIquantForeign/R/sanitize-functions.R0000644000176200001440000000171413022357357017655 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.R0000644000176200001440000000436613145106237016566 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.R0000644000176200001440000000303412601030514020307 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.R0000644000176200001440000000407312523634201016765 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.R0000644000176200001440000000732112523634201016601 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.R0000644000176200001440000000307212523634201016615 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.R0000644000176200001440000003604013022356755017004 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_1_0_0} #' @examples #' #' \dontrun{ #' library("MALDIquant") #' library("MALDIquantForeign") #' #' s <- list(createMassSpectrum(mass=1:5, intensity=1:5), #' createMassSpectrum(mass=1:5, intensity=1:5)) #' #' ## export a single spectrum #' exportMzMl(s[[1]], file="spectrum.mzML") #' #' ## export a list of spectra #' 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.R0000644000176200001440000000170613022356762017447 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.R0000644000176200001440000000333612675463724015427 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.R0000644000176200001440000001056713022357301015572 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.R0000644000176200001440000004536013022357150017335 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_1_0_0\%20} #' @examples #' #' library("MALDIquant") #' library("MALDIquantForeign") #' #' ## get example directory #' exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") #' #' ## import #' s <- importMzMl(exampleDirectory) #' #' @rdname importMzMl-functions #' @export importMzMl <- function(path, ...) { 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.R0000644000176200001440000000262112601026330017765 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.R0000644000176200001440000003033213022357334015724 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_1_0_0} #' @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() } ## 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.R0000644000176200001440000000545112615212670017436 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.R0000644000176200001440000000410512523634201020156 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.R0000644000176200001440000000225613022356771017604 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.R0000644000176200001440000001122513022356663017467 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.R0000644000176200001440000000506413022357210017756 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=.autoSep(file, skip=skip), header=.autoHeader(file, sep=sep, skip=skip), verbose=FALSE, ...) { ## load ms file s <- read.table(file=file, header=header, sep=sep, skip=skip, stringsAsFactors=FALSE, ...) 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=.autoSep(file, skip=skip), header=.autoHeader(file, sep=sep, skip=skip), verbose=FALSE, ...) { .importTab(file=file, centroided=centroided, massRange=massRange, minIntensity=minIntensity, skip=skip, sep=sep, header=header, verbose=verbose, ...) } .autoHeader <- function(file, sep="\t", skip=0L) { l <- tail(readLines(file, n=skip+1L), 1L) l <- gsub(pattern='[\\\\"]*', replacement="", x=l) l <- strsplit(l, split=sep)[[1L]][1L] !is.numeric(type.convert(l, as.is=TRUE)) } .autoSep <- function(file, sep=c(",", ";", "\t", " "), skip=0L) { l <- tail(readLines(file, n=skip+1L), 1L) pattern <- paste0(".+", sep, ".+") i <- vapply(pattern, function(x) { g <- gregexpr(pattern=x, text=l)[[1L]] all(g > 0L) & length(g) == 1L }, logical(1L)) if (any(i)) { return(sep[which(i)[1L]]) ## return only first match } else { return(sep[1L]) } } MALDIquantForeign/vignettes/0000755000176200001440000000000013154036204015471 5ustar liggesusersMALDIquantForeign/vignettes/bibliography.bib0000644000176200001440000000250212330410473020620 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.Rnw0000644000176200001440000001370412347107055022536 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/MD50000644000176200001440000001624413154037240014001 0ustar liggesusers759e4f365a2e4eb8873dd5ec3854f1fa *DESCRIPTION 239f2ca23dfb8e6e1c412d77e5fef820 *NAMESPACE 7e0651d77ecb4004023d6ddb53f6c9bc *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 eeb2f53d73c54550dfe38feef6b7b4f8 *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 71f2cefaad4fcb88d6b136dad6c6bf6d *R/filename-functions.R 62643bebde1acd81fab75bdc3bda857a *R/filename-methods.R 835269077b9e05e808e49a4c2b12c7e4 *R/ibd-functions.R e5d288e6ded053a3a1dbfde848cdd61e *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 b47f5e01c2d80d4c5426a7fdb6923b49 *R/importTab-functions.R 6d0a6289f96a249f6890db871f7feaab *R/imzMl-functions.R eb4a9e6131098dc3ec0a081fad980898 *R/list.files-functions.R 4bb38e350bb16d36e38e3929821bb9a1 *R/msd-functions.R 18b7c73ebc1c6e50944830351b4f3778 *R/msg-functions.R cefb39beae915ee9da07c58ed0b645f0 *R/mzMl-functions.R 4ce8fb9040f7188714bd3e7d37062eb6 *R/package.R 57f6c1b0c6fc40ed7f183362ada7a348 *R/parseCiphergenXml.R e93bdde9e6e0ca15c875819b73252a4d *R/parseMsd.R df013e71a6039700c6956b342cba21f5 *R/parseMzMl.R 5ff130e9930ea8502c8c7b3e45980a73 *R/sanitize-functions.R bdbaecef5012d4164a71525922ec9d4f *R/testChecksum-functions.R 0c2ae5fafc1ae70528f0e5bb02ffac8f *R/uuid-functions.R a4b92b6f309e60be3af2363e2066f47c *R/xml-functions.R 8ea2ff6d03ea2e9b7ec2986b2a198591 *build/vignette.rds 9b47d07debb7bc07b22ff5877a5ad37e *inst/doc/MALDIquantForeign-intro.R fa3507f704915074f42215d1a7acaf19 *inst/doc/MALDIquantForeign-intro.Rnw 60a191ee9f663cd7e38dad0c7d3288e3 *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 25ca09f543993ec1e4a0c188b514b886 *inst/exampledata/compressed/csv.tar.gz 5e7f66c3581914b38f2510a5cb81b817 *inst/exampledata/compressed/csv.zip 84359fbba72d2e02bacaa1acee8a6e9f *inst/exampledata/compressed/csv1.csv.gz 5101c57f3848a853326e4aac514ee494 *inst/exampledata/csv1.csv 4b2a03f6bbe5747bd50273be357533c1 *inst/exampledata/csv2.csv 90838531af29160ed4d7917edd7dbc4c *inst/exampledata/tiny.cdf 064e9a9a06250b5a29593ca23c592891 *inst/exampledata/tiny1-centroided.mzML1.1.mzML b2bc5ad00c449401ae4495677673af0a *inst/exampledata/tiny1-centroided.mzXML3.0.mzXML 4cabaefc8fe6d8f1bd0f55a9ba06e763 *inst/exampledata/tiny1-compressed.mzML1.1.mzML 09be2b7fff0d1834938d4aebaab4761c *inst/exampledata/tiny1-compressed.mzXML3.0.mzXML 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 478c279b58601e1ffbb03c6d83b130ce *man/MALDIquantForeign-package.Rd 19b5dd19c7ec7c451a93c9befdea9f5c *man/MALDIquantForeign-parallel.Rd cb40d6d6ece827ec1fedd532e1b78352 *man/base64-encode.Rd ae8dce3fdd58d7dda5e6c27b0b1b23d3 *man/export-methods.Rd 0f9287859efdefb63a074cf80542c08c *man/exportImzMl-methods.Rd 55799b878b409f78851fad0d11a512dc *man/exportMsd-methods.Rd f56c1d513e41854c15a3ef430a63cd74 *man/exportMzMl-methods.Rd 5c185c7efb34e67eba73468e73a6efd9 *man/exportTab-methods.Rd f8fc4e8cfb3da889eb1ee9d12eb8b698 *man/import-functions.Rd 0eca716e8f1fa54bc56654e18433ce8d *man/importAnalyze-functions.Rd da1ecf3207168bbec3a8a507e1205d89 *man/importBrukerFlex-functions.Rd 17f31645fc006d6e30cd4cae871455e2 *man/importCdf-functions.Rd b00f6f176bf58633eec7764d10bb75d4 *man/importCiphergenXml-functions.Rd 379ae5a1d9e31d344b262a873710e2f4 *man/importImzMl-functions.Rd ab3304677533f3e15721e1da16dc809e *man/importMsd-functions.Rd f2652dd72338a1a84855432d13d4ef38 *man/importMzMl-functions.Rd d38d002b2cef25341d0f59d285a9857c *man/importMzXml-functions.Rd 6c3dcd56df7aa4c34e7a5784e0e334ab *man/importTab-functions.Rd 0e4f3d4ce513455ce9854361c82aaab2 *man/supportedFileFormats-functions.Rd f743796f136a436364c76e6b0f83d474 *tests/testthat.R b798ecbef464ea1807946fa217445894 *tests/testthat/test_compression-functions.R 0857bc348532e96bcfd91f7ae4d0475d *tests/testthat/test_createMassObject-functions.R f623ff6bf262c955dd9ba2f21852b946 *tests/testthat/test_download-functions.R 5393dee49e0b9a4a6dabd580465083de *tests/testthat/test_exportImzMl-methods.R 208ec10c169824675066ec8cb037aa54 *tests/testthat/test_exportMsd-methods.R 0b42556a51f96c78b0314e4d79ee07a8 *tests/testthat/test_exportMzMl-methods.R bc154ef954d4012596f14aeeb9f9d90a *tests/testthat/test_exportTab-methods.R c0c445cb3dc0146a53ed5c7cb4326467 *tests/testthat/test_fileFormats.R c525ed145225cdca63726e9b8386b4de *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 27116abf7060864c5613163e55cbfd1d *tests/testthat/test_importTab-functions.R 683c710df52b1d3218ba8e708943b15b *tests/testthat/test_list.files-functions.R 33be42ee6c030ad06a3b25898995fa63 *tests/testthat/test_msg-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/0000755000176200001440000000000013154036204014560 5ustar liggesusersMALDIquantForeign/build/vignette.rds0000644000176200001440000000043113154036204017115 0ustar liggesusersRMK@dckSxoJ -ld'[bor&n̼%fsBN!,b#teJKmB>ވ{ijQ#?fo඀$ YiTuRhӟ^= w%F:]6#8f9ɺOʉQ[ƛy `?t30Q'σӬ A?I>lHKKZcɤDoyL!JMALDIquantForeign/DESCRIPTION0000644000176200001440000000235513154037240015175 0ustar liggesusersPackage: MALDIquantForeign Version: 0.11 Date: 2017-09-01 Title: Import/Export Routines for 'MALDIquant' Authors@R: c(person("Sebastian", "Gibb", role=c("aut", "cre"), email="mail@sebastiangibb.de"), person("Pietro", "Franceschi", role=c("ctb"), email="pietro.franceschi@fmach.it")) Depends: R (>= 3.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: 5.0.1 NeedsCompilation: no Packaged: 2017-09-06 18:20:52 UTC; sebastian Author: Sebastian Gibb [aut, cre], Pietro Franceschi [ctb] Maintainer: Sebastian Gibb Repository: CRAN Date/Publication: 2017-09-06 18:29:52 UTC MALDIquantForeign/man/0000755000176200001440000000000012601030514014226 5ustar liggesusersMALDIquantForeign/man/importBrukerFlex-functions.Rd0000644000176200001440000000233012615213711022034 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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readBrukerFlexData]{readBrukerFlexFile}} } MALDIquantForeign/man/importImzMl-functions.Rd0000644000176200001440000000304712615213711021021 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))) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{imzML} format: \url{http://www.imzml.org/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/importTab-functions.Rd0000644000176200001440000000260412615213711020475 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/import-functions.R \name{importTxt} \alias{importCsv} \alias{importTab} \alias{importTxt} \title{Import text files} \usage{ importTxt(path, ...) importTab(path, ...) importCsv(path, ...) } \arguments{ \item{path}{\code{character}, path to directory or file which should be read in.} \item{\ldots}{arguments to be passed to \code{\link[utils]{read.table}}.} } \value{ a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects (depending on the \code{centroided} argument). } \description{ This function imports different text file formats into \code{\link[MALDIquant]{MassSpectrum-class}} or \code{\link[MALDIquant]{MassPeaks-class}} objects. } \details{ \code{importTab}, \code{importTxt} and \code{importCsv} use \code{\link[utils]{read.table}} with different defaults. } \examples{ library("MALDIquant") library("MALDIquantForeign") ## get example directory exampleDirectory <- system.file("exampledata", package="MALDIquantForeign") ## import txt files s <- importTxt(exampleDirectory) ## import csv files s <- importCsv(exampleDirectory) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[utils]{read.table}} } MALDIquantForeign/man/exportMzMl-methods.Rd0000644000176200001440000000324012615213711020305 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} \alias{exportMzMl,MassSpectrum-method} \alias{exportMzMl,list-method} \title{Export to mzML files} \usage{ \S4method{exportMzMl}{MassSpectrum}(x, file, force=FALSE, \ldots) \S4method{exportMzMl}{list}(x, path, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{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") } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr HUPO Proteomics Standards Inititative mzML 1.1.0 Specification: \url{http://www.psidev.info/mzml_1_0_0} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/supportedFileFormats-functions.Rd0000644000176200001440000000335112615213711022715 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() } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquantForeign]{export}}, \code{\link[MALDIquantForeign]{import}} } MALDIquantForeign/man/importMzMl-functions.Rd0000644000176200001440000000225712615213711020652 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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{mzML} format: \url{http://www.psidev.info/mzml_1_0_0\%20} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/importCdf-functions.Rd0000644000176200001440000000242012615213711020457 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.") } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/importMzXml-functions.Rd0000644000176200001440000000235712615213711021043 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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr Definition of \code{mzXML} format: \url{http://tools.proteomecenter.org/mzXMLschema.php} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[readMzXmlData]{readMzXmlFile}} } MALDIquantForeign/man/importMsd-functions.Rd0000644000176200001440000000221112615213711020504 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) } \author{ Sebastian Gibb } \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}} } MALDIquantForeign/man/importAnalyze-functions.Rd0000644000176200001440000000202612615213711021370 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. } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} \cr \url{http://www.grahamwideman.com/gw/brain/analyze/formatdoc.htm}, \url{http://eeg.sourceforge.net/ANALYZE75.pdf} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/export-methods.Rd0000644000176200001440000000434012615213711017507 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} \alias{export,AbstractMassObject-method} \alias{export,list-method} \title{Export files} \usage{ \S4method{export}{AbstractMassObject}(x, file, type="auto", force=FALSE, \ldots) \S4method{export}{list}(x, path, type, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{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") } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/base64-encode.Rd0000644000176200001440000000177712615213711017057 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. } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \seealso{ \code{\link[base64enc]{base64encode}} from \pkg{base64enc} package } \keyword{internal} MALDIquantForeign/man/import-functions.Rd0000644000176200001440000001075212615213711020051 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")) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} \code{\link[MALDIquantForeign]{MALDIquantForeign-parallel}} } MALDIquantForeign/man/exportMsd-methods.Rd0000644000176200001440000000411412615213711020152 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} \alias{exportMsd,MassSpectrum-method} \alias{exportMsd,list-method} \title{Export to MSD files} \usage{ \S4method{exportMsd}{MassSpectrum}(x, file, force=FALSE, peaks, \ldots) \S4method{exportMsd}{list}(x, path, force=FALSE, peaks, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{MassSpectrum-class}} object or a \code{list} of \code{\link[MALDIquant]{MassSpectrum-class}} objects.} \item{file}{\code{character}, file name.} \item{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) } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/}, \cr mMass homepage: \url{http://mmass.org/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/exportTab-methods.Rd0000644000176200001440000000421112615213711020133 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{exportCsv} \alias{exportCsv,AbstractMassObject-method} \alias{exportCsv,list-method} \alias{exportTab} \alias{exportTab,AbstractMassObject-method} \alias{exportTab,list-method} \title{Export to text files} \usage{ \S4method{exportTab}{AbstractMassObject}(x, file, force=FALSE, \ldots) \S4method{exportTab}{list}(x, path, force=FALSE, \ldots) \S4method{exportCsv}{AbstractMassObject}(x, file, force=FALSE, \ldots) \S4method{exportCsv}{list}(x, path, force=FALSE, \ldots) } \arguments{ \item{x}{a \code{\link[MALDIquant]{AbstractMassObject-class}} object or a \code{list} of \code{\link[MALDIquant]{AbstractMassObject-class}} objects.} \item{file}{\code{character}, file name.} \item{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) } } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassPeaks-class}}, \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[utils]{write.table}} } MALDIquantForeign/man/MALDIquantForeign-parallel.Rd0000644000176200001440000000377612615213711021544 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)) } } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MALDIquant-parallel}}, \code{\link[parallel]{mclapply}}, \code{\link[parallel]{mcmapply}} } \keyword{misc} MALDIquantForeign/man/importCiphergenXml-functions.Rd0000644000176200001440000000221612615213711022353 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) } \author{ Sebastian Gibb } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}}, \code{\link[MALDIquant]{MassPeaks-class}} } MALDIquantForeign/man/exportImzMl-methods.Rd0000644000176200001440000000474112615213711020465 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} \alias{exportImzMl,MassSpectrum-method} \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))) } } \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} } \seealso{ \code{\link[MALDIquant]{MassSpectrum-class}} } MALDIquantForeign/man/MALDIquantForeign-package.Rd0000644000176200001440000000121312675463733021344 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 } } \author{ Sebastian Gibb \email{mail@sebastiangibb.de} } \references{ \url{http://strimmerlab.org/software/maldiquant/} } \keyword{package}