sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
185 stars 80 forks source link

xcmsRaw reads correct polarity of scans from Orbitrap data? #22

Closed jamesrco closed 8 years ago

jamesrco commented 8 years ago

Hi all,

I am reading in a centroided mzXML file from an Orbitrap instrument using

xfile_raw = xcmsRaw(mzXMLfiles[1])

where mzXMLfiles[1] is this file: https://github.com/vanmooylipidomics/LOBSTAHS/blob/master/Pt_H2O2_mzXML_ms1_pos/0_uM_H2O2/0uM_24h_Orbi_0468.mzXML

This is a file containing only positive-mode scans, created using MSConvert. I can verify that it contains centroided, (only) positive mode scans by opening the file in a text reader. In all scans, the value for polarity looks like the first scan, here:

<scan num="1" scanType="Full" centroided="1" msLevel="1" peaksCount="3791" polarity="+" retentionTime="PT0.149796S" lowMz="100.039772033691" highMz="1465.338989257813" basePeakMz="195.122741" basePeakIntensity="9.412663e06" totIonCurrent="1.5695206e08" msInstrumentID="1">

However, when I run:

xfile_raw@polarity

I see:

  [1] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [14] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [27] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [40] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [53] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [66] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [79] negative negative negative negative negative negative negative negative negative negative negative negative negative
 [92] negative negative negative negative negative negative negative negative negative negative negative negative negative
[105] negative negative negative negative negative negative negative negative negative negative negative negative negative
[118] negative negative negative negative negative negative negative negative negative negative negative negative negative
[131] negative negative negative negative negative negative negative negative negative negative negative negative negative
[144] negative negative negative negative negative negative negative negative negative negative negative negative negative
[157] negative negative negative negative negative negative negative negative negative negative negative negative negative
[170] negative negative negative negative negative negative negative negative negative negative negative negative negative
[183] negative negative negative negative negative negative negative negative negative negative negative negative negative
[196] negative negative negative negative negative negative negative negative negative negative negative negative negative
[209] negative negative negative negative negative negative negative negative negative negative negative negative negative
[222] negative negative negative negative negative negative negative negative negative negative negative negative negative
[235] negative negative negative negative negative negative negative negative negative negative negative negative negative
[248] negative negative negative negative negative negative negative negative negative negative negative negative negative
[261] negative negative negative negative negative negative negative negative negative negative negative negative negative
[274] negative negative negative negative negative negative negative negative negative negative negative negative negative
[287] negative negative negative negative negative negative negative negative negative negative negative negative negative
[300] negative negative negative negative negative negative negative negative negative negative negative negative negative
[313] negative negative negative negative negative negative negative negative negative negative negative negative negative
[326] negative negative negative negative negative negative negative negative negative negative negative negative negative
[339] negative negative negative negative negative negative negative negative negative negative negative negative negative
[352] negative negative negative negative negative negative negative negative negative negative negative negative negative
[365] negative negative negative negative negative negative negative negative negative negative negative negative negative
[378] negative negative negative negative negative negative negative negative negative negative negative negative negative
[391] negative negative negative negative negative negative negative negative negative negative negative negative negative
[404] negative negative negative negative negative negative negative negative negative negative negative negative negative
[417] negative negative negative negative negative negative negative negative negative negative negative negative negative
[430] negative negative negative negative negative negative negative negative negative negative negative negative negative
[443] negative negative negative negative negative negative negative negative negative negative negative negative negative
[456] negative negative negative negative negative negative negative negative negative negative negative negative negative
[469] negative negative negative negative negative negative negative negative negative negative negative negative negative
[482] negative negative negative negative negative negative negative negative negative negative negative negative negative
[495] negative negative negative negative negative negative negative negative negative negative negative negative negative
[508] negative negative negative negative negative negative negative negative negative negative negative negative negative
[521] negative negative negative negative negative negative negative negative negative negative negative negative negative
[534] negative negative negative negative negative negative negative negative negative negative negative negative negative
[547] negative negative negative negative negative negative negative negative negative negative negative negative negative
[560] negative negative negative negative negative negative negative negative negative negative negative negative negative
[573] negative negative negative negative negative negative negative negative negative negative negative negative negative
[586] negative negative negative negative negative negative negative negative negative negative negative negative negative
[599] negative negative negative
Levels: negative positive unknown

I am concerned whatever function is reading in the file is looking for 0, 1, or -1 to determine polarity, when either Thermo or MSConvert is using + and - in the files that I am working with.

Or, is there a solution I am missing?

Thanks in advance, really appreciate how responsive the xcms team is.

Jamie Collins

stanstrup commented 8 years ago

When I run it I get it as positive. So perhaps this is a bug that was already fixed. Please run:

library(mzR)
library(xcms)
sessionInfo()

I have xcms_1.45.6 and mzR_2.3.2.

jamesrco commented 8 years ago

That must have been it. I was a few xcms versions behind. Updated to latest; works like it should. Thanks!