rformassspectrometry / MsBackendMsp

Mass Spectrometry Data Backend for MSP Files
https://rformassspectrometry.github.io/MsBackendMsp/
5 stars 3 forks source link

msLevel not read from MoNA msp #16

Open nlichti opened 9 months ago

nlichti commented 9 months ago

Hi. The if statement on line 83 of functions-msp.R (in readMsp) seems to be missing quotation marks around msLevel, so colnames(res) is compared to 2L instead of "msLevel".

Reading the following header with the "mona" mapping, my Spectra object has msLevel = 2. I've truncated the spectrum and highlighted the level. It's the first spectrum in the LC-MS export.

Name: Cefuroxime Synon: $:00in-source DB#: WA002994 InChIKey: JFPVXVDWJQMJEE-IZRZKJBUSA-N Spectrum_type: MS1 Instrument_type: LC-ESI-Q Instrument: ZQ, Waters Ion_mode: N Formula: C16H16N4O8S MW: 424 ExactMass: 424.06888447200004 Comments: "SMILES=CO/N=C(/C1=CC=CO1)\C(=O)N[C@H]2[C@@H]3N(C2=O)C(=C(CS3)COC(=O)N)C(=O)O" "cas=55268-75-2" "pubchem cid=5479529" "InChI=InChI=1S/C16H16N4O8S/c1-26-19-9(8-3-2-4-27-8)12(21)18-10-13(22)20-11(15(23)24)7(5-28-16(17)25)6-29-14(10)20/h2-4,10,14H,5-6H2,1H3,(H2,17,25)(H,18,21)(H,23,24)/b19-9-/t10-,14-/m1/s1" "computed SMILES=O=C(O)C1=C(COC(=N)O)CSC2N1C(=O)C2N=C(O)C(=NOC)C=3OC=CC3" "computed [2M+H-H2O]+=831.130398944" "computed [2M+K]+=887.2360689440001" "computed [M+H]+=425.07685447200004" "computed [2M+Na]+=871.1275389440001" "computed [2M+Cl]-=883.590768944" "computed [2M+HAc-H]-=907.1817989440001" "computed [M-H20-H]-=405.050494472" "computed [M-H]-=423.06160847200005" "computed [2M-H]-=847.130492944" "computed [M+Na]+=447.05865447200006" "computed [M+H-H2O]+=407.06151447200006" "computed [2M+NH4]+=866.1763489440001" "computed [M+Cl]-=459.521884472" "computed [M+NH4]+=442.10746447200006" "computed [M+K]+=463.16718447200003" "computed [2M+H]+=849.1457389440001" "computed [M+HAc-H]-=483.11291447200006" "accession=WA002994" "date=2016.01.19 (Created 2007.08.01, modified 2011.05.06)" "author=Nihon Waters K.K." "license=CC BY-NC" "exact mass=424.06888" "ionization=ESI" "retention time=11.420 min" "column=2.1 mm id - 3. 5{mu}m XTerra C18MS" "column temperature=35 C" "sampling cone=60 V, 90 V" "find peak=ignore rel.int. < 5" "computed spectral entropy=4.124517044473415" "computed normalized entropy=0.8310792200354279" "SPLASH=splash10-0a4i-0981100000-05f4b050fdb3869b8bd1" "submitter=submitter = Nihon Waters (Nihon Waters K.K.)" "MoNA Rating=4.444444444444445" Num Peaks: 143 100 3.103103 101 1.201201 102 1.201201 ...

jorainer commented 7 months ago

thanks @nlichti for reporting - and sorry for not coming back earlier on this!

This is now fixed with the recent PR #15