kevinkovalchik / RawQuant

RawQuant is a Python package for extracting scan meta data and quantification values from Thermo .raw files.
MIT License
10 stars 2 forks source link

Error with RawQuant on linux #10

Open chrishuges opened 6 years ago

chrishuges commented 6 years ago

getting an error using the latest version right now on LInux

-bash-4.2$ python -m RawQuant parse -f /projects/ptx_analysis/chughes/projects-current/data-pipeline-testing/ch_16Feb2018_SP3low-SP3high-SP3Mag-TMT10_hph_6.raw parse -o 2 -mtx -mgf

File(s) to be parsed:
/projects/ptx_analysis/chughes/projects-current/data-pipeline-testing/ch_16Feb2018_SP3low-SP3high-SP3Mag-TMT10_hph_6.raw
parse

Opening /projects/ptx_analysis/chughes/projects-current/data-pipeline-testing/ch_16Feb2018_SP3low-SP3high-SP3Mag-TMT10_hph_6.raw and initializing

Data file: /projects/ptx_analysis/chughes/projects-current/data-pipeline-testing/ch_16Feb2018_SP3low-SP3high-SP3Mag-TMT10_hph_6.raw
Instrument: Orbitrap Fusion
Experiment MS order: 2

Traceback (most recent call last):
  File "/gsc/software/linux-x86_64-centos7/python-3.6.1/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/gsc/software/linux-x86_64-centos7/python-3.6.1/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/projects/ptx_analysis/chughes/software/RawQuant-master/RawQuant/__main__.py", line 715, in <module>
    data = RawQuant(msFile,disable_bar=suppress_bar)
  File "/projects/ptx_analysis/chughes/software/RawQuant-master/RawQuant/RawQuant.py", line 145, in __init__
    method = self.raw.GetInstrumentMethod(1)
System.NullReferenceException: Object reference not set to an instance of an object
  at ThermoFisher.CommonCore.RawFileReader.DeviceStorage.GetStorageNames (ThermoFisher.CommonCore.RawFileReader.IOleStorage storage, ThermoFisher.CommonCore.RawFileReader.StgType storageType) [0x00000] in <65526abcf3c8411ba1691dde8fe568e7>:0 
  at ThermoFisher.CommonCore.RawFileReader.DeviceStorage.EnumSubStgsNoRecursion (System.Collections.Generic.List`1[T] storageDescriptions) [0x00000] in <65526abcf3c8411ba1691dde8fe568e7>:0 
  at ThermoFisher.CommonCore.RawFileReader.StructWrappers.Method.GetMethodData (ThermoFisher.CommonCore.RawFileReader.Facade.Interfaces.IMemMapReader viewer, System.Int64 startPos, System.Collections.Generic.List`1[T] storageDesc) [0x00027] in <65526abcf3c8411ba1691dde8fe568e7>:0 
  at ThermoFisher.CommonCore.RawFileReader.StructWrappers.Method+<>c__DisplayClass25_0.<Load>b__1 () [0x00000] in <65526abcf3c8411ba1691dde8fe568e7>:0 
  at System.Lazy`1[T].CreateValue () [0x00081] in <135e7c260ae04ab1a5538976c2d8cf31>:0 
  at System.Lazy`1[T].LazyInitValue () [0x00080] in <135e7c260ae04ab1a5538976c2d8cf31>:0 
  at System.Lazy`1[T].get_Value () [0x0003a] in <135e7c260ae04ab1a5538976c2d8cf31>:0 
  at ThermoFisher.CommonCore.RawFileReader.StructWrappers.Method.get_StorageDescriptions () [0x00008] in <65526abcf3c8411ba1691dde8fe568e7>:0 
  at ThermoFisher.CommonCore.RawFileReader.RawFileAccessBase.GetInstrumentMethod (System.Int32 index) [0x0003b] in <65526abcf3c8411ba1691dde8fe568e7>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <135e7c260ae04ab1a5538976c2d8cf31>:0 

Not sure what is happening. Just a standard raw file.

chrishuges commented 6 years ago

Actually, this appears to be a raw file issue rather than a RawQuant issue. Odd. There is nothing special about this raw file. Will investigate further.

chrishuges commented 6 years ago

Actually this is an 0.2.3 error. If I roll back to 0.2.0 I don't have any issues with the same raw file.

chrishuges commented 6 years ago

Version 0.2.3 doesn't seem to have any issues on Windows based on further tests.

kevinkovalchik commented 6 years ago

Sorry for the slow response. I just got back from vacation. I'll look into this as soon as I can.

kevinkovalchik commented 6 years ago

Thermo provided a separate set of dlls for Linux. From my testing, the windows set seemed to work fine with mono on Linux for all the functions we are using, but this might be the cause of the error. I'll look into distributing RQ with both sets of dlls.

kevinkovalchik commented 6 years ago

The dlls targeting monomac also give this error. It seems like the GetInstrumentMethod function throws an error on mono but not windows. Currently we need GetInstrumentMethod to adjust precursor masses when there is an isolation window offset. We are planning to try to adapt the deconMSn workflow to get at precursor masses without relying on the values in the raw file, which would eliminate the need for GetInstrumentMethod. I'll post any updates here.

kevinkovalchik commented 6 years ago

In the meantime I will work on a fix to disable the offset correction on Linux systems. So long as there isn't an isolation window offset, this will fix things until we adapt DeconMSn.

kevinkovalchik commented 6 years ago

Okay, I applied a fix to the master branch which disables the isolation window offset check if it is run on a linux or mac os x platform. This is a quick fix, and you will run into problems if there is an offset. Let me know if you still have any problems with it.

chrishuges commented 6 years ago

This is ok for me now. I think this issue can be closed.