sgibb / maldiquantforeign Goto Github PK
View Code? Open in Web Editor NEWImport/Export routines for MALDIquant
Home Page: https://strimmerlab.github.io/software/maldiquant/
Import/Export routines for MALDIquant
Home Page: https://strimmerlab.github.io/software/maldiquant/
Hi, in this cvParam only the unitAccession is given, but the unitName is not given; please consider adding unitName="number of counts"
to the function in line 329 to make it valid mzML
MALDIquantForeign/R/mzMl-functions.R
Lines 326 to 329 in 4c6b47f
Hi,
Thanks for this package.
I guess that the beginning of the code L24-L35 is guessing the right parameters for read.table. But then read.table L38 is not applied to the raw file but to already processed text lines. Because skipping lines already took place, it should not be applied twice. I think that the file name actually should be given to read.table L38 instead of the text variable.
Best.
MALDIquantForeign/R/importTab-functions.R
Lines 24 to 39 in 37fbb16
install_github(username="klutometis", repo="roxygen", ref="s4")
In the .writeImzMlDocument function, .addIbdOffsets gets called without the processed argument, leading to .addIbdOffsets using always the default (=TRUE). Subsequently, a wrong imzml file is created,
which makes the exported data unusable.
Original function:
.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], ...) {
...
.writeMzMlDocument(x=.addIbdOffsets(x), file=file, id=id,
imsArgs=list(uuid=uuid, sha1=sha1, processed=processed),
...)
}
Suggested fix:
.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], ...) {
...
.writeMzMlDocument(x=.addIbdOffsets(x, processed=processed), file=file, id=id,
imsArgs=list(uuid=uuid, sha1=sha1, processed=processed),
...)
}
mzXML and mzML have a flag for centroided data.
For all other formats an argument centroided=TRUE
or a function asMassPeaks
would be fine.
exportImzMl
complains when attempting writing to an imzML file, here is a reproducible example (file attached
massPeaksList.gz ):
s <- readRDS(file = "massPeaksList.gz")
MALDIquantForeign::exportImzMl(x = s, path = "test.imzML", processed = TRUE)
Error in get(as.character(FUN), mode = "function", envir = envir) :
object 'coordinates<-' of mode 'function' was not found
packageVersion("MALDIquantForeign")
[1] ‘0.12’
The issue is resolved when explicitly loading MALDIquant
into the environment. The issue appears to be in .writeImzMlDocument
function in imzMl-functions.R
line #48 coordinates(x) <- coordinates
, the function coordinates
is called without specifying MALDIquant
package namespace.
Also the documentation of ?MALDIquantForeign::exportImzMl
says the the input should be "a MassSpectrum
object or a list of MassSpectrum
objects" but it didn't have any issues exporting a list of MassPeaks
objects (the attached file).
Since R 3.2.2 download.file
supports HTTPS, so downloader::download
is not needed anymore.
.download doesn't respect verbose=FALSE
I want to export some IMS data as imzML file with the exportImzMl function. During the process I get the following warning:
Warning message:
In .ibdOffsets(x, processed = processed, encodedLengthSize = encodedLengthSize) :
integer overflow in 'cumsum'; use 'cumsum(as.numeric(.))'
The resulting imzML file has "NA" value for most of the "external offset" entries. Additionally, even with processed=FALSE
the external offset value in mzArray is always a different value, while it should be the, if I understood it correctly.
The data set, that I want to convert, is relatively large (7953 spectra, 36713 data points each, around 3 GB object size).
I have been evaluating multiple imzML parsers (see here https://imzml.github.io/) with publicly available imzML datasets (e.g. https://metaspace2020.eu/datasets?ds=2017-06-30_07h26m26s) and experienced some issues with MALDIquantForeign.
It seems that if a common 'error' is encountered for each spectrum, then this will flood the console with one message per spectrum (which for MSI Data is a lot!) eventually leading to a system crash. The error for the dataset linked above is given below. Perhaps it would be possible to just display the warning once per dataset, rather than per spectrum?
- Warning in .createMassObject(mass = mass, intensity = intensity, metaData = m, :
- According to the metadata information the imported data are centroided, but they are treated as profile (MassSpectrum) data. Maybe you want to use 'centroided=TRUE'. See '?import' for details.
Parsing XML files takes longer than reading them. So all XML parsing import functions could benefit from parallelization.
Package in Depends field not imported from: ‘methods’
These packages needs to imported from for the case when
this namespace is loaded but not attached.
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.
testthat 0.8 comes with a new recommended structure for storing your tests. To
better meet CRAN recommended practices, testthat now recommend that you to put
your tests in tests/testthat
, instead of inst/test
(this makes it
possible for users to choose whether or not to install tests). With this
new structure, you'll need to use test_check()
instead of test_packages()
in the test file (usually tests/testthat.R
) that runs all testthat unit
tests.
Hi Sebastian,
I would like to use MALDIQuant to analyse Bruker's MALDI-FTICR data. But I don't know how do I convert the raw file to mzML file or other MALDIquantForeign supported format. Or will MALDIquantForeign support such data type?
Here I upload a compressed sample data. The acquired data is basically a folder, which contains various files in it. It can be opened with Bruker's DataAnalysis software, and can be exported to, for instance, .xml or .ascii file. But the software does not support exporting to mzML format.
Here I attached one example data, could you please help?
WT.d.zip
Thanks a lot.
Dong
It would be useful to avoid importing of some files (e.g. Bruker LIFT files or calibration runs):
Maybe an ignorePattern
argument should be added to import
.
Typical directory tree (we want only import 0_L19/1SRef/fid
and ignore all *LIFT/1SRef/fid
files):
├── 0_L19
│ │ └── 1
│ │ ├── 1247.4076.LIFT
│ │ │ └── 1SRef
│ │ │ ├── acqu
│ │ │ ├── acqus
│ │ │ ├── fid
│ │ │ └── sptype
│ │ ├── 1290.4581.LIFT
│ │ │ └── 1SRef
│ │ │ ├── acqu
│ │ │ ├── acqus
│ │ │ ├── fid
│ │ │ └── sptype
│ │ ├── 1SRef
│ │ │ ├── acqu
│ │ │ ├── acqus
│ │ │ ├── fid
│ │ │ └── sptype
│ │ ├── 2089.7704.LIFT
...
Importing CSV files with comments currently fails because .autoSep
and .autoHeader
don't know comment.char
and ignore it.
<spectrum>
tag?)Hi,
I am wondering if this check can be relaxed or changed into a warning:
if (size != 348 && size != 384) { stop(sQuote(filename), " is no ANALYZE header file.") }
I have some Analyze7.5 files that do not match this size requirement but work for example in Cardinal.
Thanks,
Melanie
We should add an argument filterEmptySpectra
(default: TRUE
) to import
to avoid problems with empty spectra in downstream analysis in MALDIquant.
Hello,
I'm puzzled as to why MALDIquant can work with R>=3.2.0 but MALDIquantForeign depends on R>=3.2.2. If this is not necessary, please amend MALDIquantForeign to depend on R>=3.2.0
many thanks,
Simon
add unpacking support forthe following file types: zip, tar, gz,bz2, xz, lzma
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.