Closed Adafede closed 3 years ago
With the more low level mzR it is possible to read the PDA data: https://gitlab.com/stanstrup-work/read_waters_pda/-/blob/master/funs.R
Wonderful! Exactly what I was looking for. Do you also read the chromatograms and not spectra which are listed as chromatogram id = ...?
I have not worked with chromatograms so dunno. But it seems to be possible now. Some hints here https://github.com/sneumann/mzR/issues/172 and https://github.com/sneumann/mzR/issues/163.
More on the status of non-MS data in MSnbase: https://github.com/lgatto/MSnbase/issues/452
You can extract chromatograms from the MSnExp
object (see ?Chromatogram
and ?Chromatograms
). There's also a readSRMData
data.
Hi again,
Sorry to insist but this time it might be clearer since I think I am missing something...
First of all, thank you @stanstrup , your trick works perfetcly for accessing PDA scans! :)
Here is my file:
https://we.tl/t-Oep8oWPl79 (sorry it's big)
It contains MS1 data, MS2 data, PDA data and an additional 1D analog signal.
3 chromatograms are encoded in the file, but I am sadly able only to access the ones linked to the MS data. What I would like is to also access the other ones. (see chromatogramList count="3"
in file)
How could I do?
What I am doing is:
msnexp <-
readMSData(
files = file,
verbose = TRUE,
centroided. = TRUE,
smoothed. = FALSE,
mode = "onDisk"
)
Then,
bpi_ms1 <- chromatogram(object = msnexp, msLevel = 1)
# works
bpi_ms2 <- chromatogram(object = msnexp, msLevel = 2)
# works
test <- chromatograms(object = msnexp)
# Error in (function (classes, fdef, mtable) :
# unable to find an inherited method for function ‘chromatograms’ for signature ‘"OnDiskMSnExp"’
Many thanks
I guess the error comes because you misspelled the function (chromatograms
and not chromatogram
).
Note that AFAIK it will not be possible to extract MS1 and MS2 chromatograms at the same time, thus chromatogram(msnexp)
will extract MS1 chromatograms (the default).
It is not a misspell... I checked both functions and chromatogram works on MS chromatograms (MS1, and MS2 separately) but chromatogramS does not work (as written
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘chromatograms’ for signature ‘"OnDiskMSnExp"
Indeed, there is not chromatograms
function for [OnDisk]MSnExp
objects. chromatograms()
and chromatogram()
are different functions altogether. The former only works for mzR
objects.
Marvelous! I got it now...
So what I did:
object <- mzR::openMSfile(file)
chromatograms <- chromatograms(object)
and got all of them 👍🏼
Hi,
Thank you for your wonderful package.
I was wondering if it would be easily implementable for your readMSData function to read not only MS data encoded in the mzML but also data coming from other detectors which is encoded almost in the same way? I know your package is MS oriented but it would be really great to access PDA spectra in the same way we access MS spectra now, or even simple chromatograms also encoded in the file.
I think this would be really great since no tool (as far as I know) does it.