GithubHelp home page GithubHelp logo

readSpectrum(...) about rawrr HOT 16 OPEN

tobiasko avatar tobiasko commented on September 27, 2024 1
readSpectrum(...)

from rawrr.

Comments (16)

tobiasko avatar tobiasko commented on September 27, 2024 1

image

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

Potentially interesting:

==== Diagnostic Data: ==== as shown in Freestyle

contains attributes like AGC Fill, HCD Energy eV, ...

==== Instrument data ==== as shown in Freestyle

contains attributes like Multiple Injection, Charge State, Ion Injection Time (ms), AGC Target, ...

The BIG question: How much scan meta data do we want to extract by default???

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

complete scan header example c&p from Freestyle:

Total Ion Current:	53435.391	
Scan Low Mass:	100	
Scan High Mass:	1335	
Scan Start Time (Min):	20.72	
Scan Number:	12939	
Base Peak Intensity:	6354.29	
Base Peak Mass:	303.27	
Scan Mode:	FTMS + c NSI Full ms2 [email protected] [100.0000-1335.0000]	
======= Instrument data =====	
	
Multiple Injection:	h 	
Multi Inject Info:	IT=55 	
AGC:	On	
Micro Scan Count:	1	
Scan Segment:	1	
Scan Event:	2	
Master Index:	0	
Charge State:	2	
Monoisotopic M/Z:	0.0000	
Ion Injection Time (ms):	55.000	
Max. Ion Time (ms):	55.00	
FT Resolution:	30000	
MS2 Isolation Width:	1.40	
MS2 Isolation Offset:	0.00	
AGC Target:	100000	
HCD Energy:	27.00	
Analyzer Temperature:	30.02	
=== Mass Calibration: ===:	
	
Conversion Parameter B:	211692985.2249	
Conversion Parameter C:	-97213762.9727	
Temperature Comp. (ppm):	-5.72	
RF Comp. (ppm):	-0.22	
Space Charge Comp. (ppm):	-0.01	
Resolution Comp. (ppm):	0.07	
Number of Lock Masses:	2	
Lock Mass #1 (m/z):	371.1010	
Lock Mass #2 (m/z):	445.1200	
Lock Mass #3 (m/z):	0.0000	
LM Search Window (ppm):	15.0	
LM Search Window (mmu):	0.0	
Number of LM Found:	0	
Last Locking (sec):	0.1	
LM m/z-Correction (ppm):	-1.20	
=== Ion Optics Settings: ===:	
	
S-Lens RF Level:	60.00	
S-Lens Voltage (V):	21.00	
Skimmer Voltage (V):	15.00	
Inject Flatapole Offset (V):	5.00	
Bent Flatapole DC (V):	2.00	
MP2 and MP3 RF (V):	633.00	
Gate Lens Voltage (V):	0.88	
C-Trap RF (V):	1010.0	
====  Diagnostic Data:  ====:	
	
Dynamic RT Shift (min):	0.00	
Intens Comp Factor:	0.5575	
Res. Dep. Intens:	1.000	
CTCD NumF:	0	
CTCD Comp:	1.739	
CTCD ScScr:	0.000	
RawOvFtT:	16263.9	
LC FWHM parameter:	15.0	
Rod:	0	
PS Inj. Time (ms):	13.595	
AGC PS Mode:	-2	
AGC PS Diag:	0	
HCD Energy eV:	31.338	
AGC Fill:	0.01	
Injection t0:	0.000	
t0 FLP:	0.00	
Access Id:	0	
Analog Input 1 (V):	0.000	
Analog Input 2 (V):	0.000	

from rawrr.

cpanse avatar cpanse commented on September 27, 2024

omit.spectrum = FALSE

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

Hi CP,

I checked the details of the current implementation. Currently, some important items are missing in the list/S3 object returned by readSpectrum(...):

*Total Ion Current
*Scan Low Mass
*Scan High Mass
*Base Peak Intensity
*Base Peak Mass

further down the list you should also see a key:value pair ======= Instrument data =====:NA, similar to Mass Calibration, Ion Optics Settings, Diagnostic Data. I could not find it.

Regarding those key:value pairs that are used by thermo to structure the list. Would it be possible to use them as branch points for nesting the list in R?

====  Diagnostic Data:  ====:: chr ""
=== Ion Optics Settings: ===:: chr ""
=== Mass Calibration: ===:: chr ""
=== Instrument data ===:: chr ""

And we should think about where to place the peak lists/attributes in the returned object!

The basic peak list is two numeric vectors:

*position (mz)
*intensity

but there should be additional vectors like:

resolution, noise, charge, background

and the peak flags. As discussed before, maybe having a dedicated object for the peak lists would help, since the vectors would need to stick to certain names, be of equal length and types. omit.spectrum = TRUE would simply not populate this peak list object slot with data.

What do you think?

 sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rawR_0.0.1

loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2   

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

After reading the S3 OOP chapter in Master Hadleys book of whisdom I realized the following: ˋreadSpectrum()ˋ is equal to one of the 3 essential functions, the ˋmyclass()ˋor helper function in case users create class instances. I would therefore rename ˋreadSpectrum()ˋ to ˋSpectrumˋ

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

Or if we incl. the package name in the object name as you suggest ˋrawRSpectrum()ˋ

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

See section 13.3.3 of Hadleys book of wisdom.

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

13.3.3 also answers your question regarding the usage of the validator. The helper function calls the low level constructor ˋnew_myclass() and the validator.

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

The final goal should be that people only interact with two well crafted objects: rawRSpectrum and rawRChromatogram

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

Paper Journal 1

from rawrr.

cpanse avatar cpanse commented on September 27, 2024

from rawrr.

cpanse avatar cpanse commented on September 27, 2024

ahh

from rawrr.

cpanse avatar cpanse commented on September 27, 2024

brain wash

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

Something I came across:

readChromatogram() returns a rawRchromatogramSet which is basically a list of rawRchromatogram objects.

readSpectrum() behaves differently:

it returns a plain list instead of a rawRspectrumSet.

Could you fix that @cpanse ???

from rawrr.

tobiasko avatar tobiasko commented on September 27, 2024

status quo: only peak flags are missing.

from rawrr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.