fgcz / rawDiag

Brings Orbitrap mass spectrometry data to life; multi-platform, fast and colorful R package
https://bioconductor.org/packages/rawDiag
36 stars 11 forks source link

Add Signal to Noise data to ReadScan #52

Closed David-Degnan closed 5 years ago

David-Degnan commented 5 years ago

Hello! Thank you for developing this useful package. Is there any way to add the signal to noise info to the object returned by ReadScans? This is a value that Thermo stores in the .raw file for every peak, besides the m/z and intensity. I believe that it can be obtained from one of the ThermoFisher.CommonCore DLLs already utilized by rawDiag. Thanks!

tobiasko commented 5 years ago

Hi David,

to my knowledge S/N is not something that gets written into the raw file, but is rather estimated for each peak by an offline algorithm that examines the local surrounding. Where does your info come from that it is written into the file?

Best, Tobi

David-Degnan commented 5 years ago

Thanks for the reply, Tobi!

You are correct. We need the noise or background information stored for each peak.

David-Degnan commented 5 years ago

Hello Tobi,

It seems I may have been unclear. We would still like to add signal/background information to the object returned by ReadScans. We believe this value is stored in one of the ThermoFisher DLLs, likely ThermoFisher.CommonCore.RawFileReader.dll. Here's a reference: https://github.com/PNNL-Comp-Mass-Spec/Thermo-Raw-File-Reader/blob/master/XRawFileIO.cs#L2508

Thank you!

tobiasko commented 5 years ago

Hi David,

in general DLLs do not store any values:

https://support.microsoft.com/en-us/help/815065/what-is-a-dll

In short, DLLs are code modules. The code line you linked above:

var data = mXRawFile.GetCentroidStream(scan, false);

references the method GetCentroidStream and to my knowledge it returns a set of position and intensity values in array format. Position is equivalent to m/z and intensity is the abs. abundance aka the signal. Noise is not stored in a raw file can can be estimated by analysing the local/global environment of any signal.

@cpanse Is this correct?

Best, Tobi

tobiasko commented 5 years ago

btw: I guess the only person that really KNOWs what is inside raw files is jim.Shofstahl@thermofisher.com I could also be that the .NET assemblies do not make it accessible. :-(

David-Degnan commented 5 years ago

Hello Tobi,

The GetCentroidStream returns an array of position, intensity, resolutions, baselines, noises, and charges. We would like the noises added to ReadScans. https://github.com/PNNL-Comp-Mass-Spec/Thermo-Raw-File-Reader/blob/master/XRawFileIO.cs#L2520

Thank you!

-David