Skip to main content
Topic: xcmsRow mzrange (Read 5128 times) previous topic - next topic

xcmsRow mzrange

Hi, I would use xcmxRow() to read a .CDF file but, instead of to read all the file I would only read the file in a particular m/z range. 

This is the classic approach:
Code: [Select]
a <- xcmsRaw(myCDF)

An "xcmsRaw" object with 3238 mass spectra

Time range: 329.8-1439.9 seconds (5.5-24 minutes)
Mass range: 50-549.4 m/z
Intensity range: 150-4750850

MSn data on  0  mass(es)
with  0  MSn spectra
Profile method: bin
Profile step: 1 m/z (500 grid points from 50 to 549 m/z)
>
> dim(a@env$profile)
[1]  500 3238

I tried this code to select a particular m/z range but it doesen't work as expected:

Code: [Select]
xs <- xcmsRaw(myCDF, profparam=list(mzrange=100:400))
An "xcmsRaw" object with 3238 mass spectra

Time range: 329.8-1439.9 seconds (5.5-24 minutes)
Mass range: 50-549.4 m/z
Intensity range: 150-4750850

MSn data on  0  mass(es)
with  0  MSn spectra
Profile method: bin
Profile step: 1 m/z (500 grid points from 50 to 549 m/z)
Profile parameters: mzrange = 100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400

>
> dim(a@env$profile)
[1]  500 3238

Unexpectedly the dimension of the resulting data matrix is the same.

Where do I wrong?

Is there another way to do this?

All the best

Re: xcmsRow mzrange

Reply #1
see
Code: [Select]
?"xcmsSet-class"
-->
Code: [Select]
profinfo:
list containing the values method - profile generation method, and step - profile m/z step size and eventual additional parameters to the profile function.

mzrange is not a valid parameter.

Code: [Select]
profinfo(a)
gives you current parameters.

I don't think there is a way to filter at the time of the file read. The file has to be read scan by scan anyway so I don't think there is much speed to gain compared to a post-read filter. If you only care about the profile matrix isn't what you want a simple row selection of a@env$profile?
Blog: stanstrup.github.io