Skip to main content
Topic: filter scans by collision energy (Read 4266 times) previous topic - next topic

filter scans by collision energy

Hi xcms fans!

As a long-time xcms user, I've used the software to align and compare both MS1 and MS2 data in a variety of formats.  However, recently I just acquired a large amount of data that has interleaved "regular" MS1 scans and "all-ions" MS1 scans.  These "all-ions" MS1 scans use the collision cell at various collision energies to fragment all ions that enter them, but no mass selection (e.g. with a quadrupole) is used. 

I'd like to perform xcms on the "regular" MS1 scans, i.e. those that have a collision energy of 0, and have xcms ignore the other scans (for now).  However since the "all ions" data is not really an MS2 scan I can't use the `mslevel` parameter to `xcmsSet()`.  I see that the xcmsRaw() constructor will fill in a `msnCollisionEnergy` parameter.  Is this something xcms can filter on during invocation of `xcmsSet()`?  If so, how? 

I've played around a bit with one file using `xcmsRaw()` and I don't completely understand the behavior.
Code: [Select]
one_file <- 'mzml_files/s001_m001.mzML'
xraw_msn <- xcmsRaw(one_file, includeMSn = T)
xraw_reg <- xcmsRaw(one_file)

> xraw_reg


An "xcmsRaw" object with 438 mass spectra

Time range: 3-359.3 seconds (0-6 minutes)
Mass range: 69.9971-1499.0236 m/z
Intensity range: 200-7108400

MSn data on  0  mass(es)
with  0  MSn spectra
Profile method: bin
Profile step: 1 m/z (1430 grid points from 70 to 1499 m/z)

Memory usage: 31.1 MB

> xraw_msn

An "xcmsRaw" object with 438 mass spectra

Time range: 3-359.3 seconds (0-6 minutes)
Mass range: 69.9971-1499.0236 m/z
Intensity range: 200-7108400

MSn data on  439  mass(es)
with  439  MSn spectra
Profile method: bin
Profile step: 1 m/z (1430 grid points from 70 to 1499 m/z)

Memory usage: 52.2 MB

print(xraw_msn@msnCollisionEnergy[1:10])
 [1] 20 20 20 20 20 20 20 20 20 20

print(xraw_reg@msnCollisionEnergy)
numeric(0)

print(xraw_msn@msnCollisionEnergy[1:10])
 [1] 2 2 2 2 2 2 2 2 2 2

print(xraw_reg@msnCollisionEnergy)
numeric(0)

print(xraw_msn@msnCollisionEnergy)
numeric(0)

print(xraw_reg@msnCollisionEnergy)
numeric(0)

print(xraw_msn@msnScanindex[1:10])
print(xraw_msn@scanindex[1:10])
print(xraw_reg@msnScanindex[1:10])
print(xraw_reg@scanindex[1:10])

 [1]    0  1679  2838  4726  6588  8444 10293 12153 14017 15817
 [1]    0  2912  4721  7469 10169 12866 15576 18299 20934 23643
 [1] NA NA NA NA NA NA NA NA NA NA
 [1]    0  2912  4721  7469 10169 12866 15576 18299 20934 23643



Is this telling me that by default xcms will ignore the scans with collision energy 20 and treat them as "ms2" scans even though they aren't really?  And I can read those scans with `includeMSn = T` when invoking `xcmsSet()` or `xcmsRaw()`?  How will these "msn" features be treated after peak finding and alignment across samples?

Re: filter scans by collision energy

Reply #1
It seems the "special MS1" has been saved as MSn data in the file. But you also have regular MS1 in the file. the MS1 does not have CollisionEnergy information AFAIK.
So I think you will get what you want if you just don't read the MSn data and treat them normally.
Perhaps do some EICs and compare to your vendor software to check that things are as expected.
Blog: stanstrup.github.io

Re: filter scans by collision energy

Reply #2
Hi Jan,

Thanks a lot for your reply.  After some more investigation it looks like you are right.  So for now I am set.  Thanks again.