Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Todo MSP Parser #28

Open
yguitton opened this issue Oct 29, 2020 · 5 comments
Open

Todo MSP Parser #28

yguitton opened this issue Oct 29, 2020 · 5 comments
Assignees

Comments

@yguitton
Copy link
Owner

Todo: add a parser for MSP files generated by MoNa or Riken, Golm
Todo: add additional Tags in metaMS identification outputs

example Riken MSP
NAME: CITRIC ACID-TETRA-TMS; EI-B; MS
EXACTMASS: 480.1851098
FORMULA: C18H40O7Si4
SMILES: CSi(C)OC(=O)CC(CC(=O)OSi(C)C)(OSi(C)C)C(=O)OSi(C)C
ONTOLOGY: Tricarboxylic acids and derivatives
INCHIKEY: VFGAVMGYDWDESE-UHFFFAOYSA-N
RETENTIONTIME: -1
RETENTIONINDEX: 1788.907
QUANTMASS: 75
IONMODE: Positive
COLLISIONENERGY: 70eV
LICENSE: CC BY-SA
Comment:
Num Peaks: 141

@yguitton yguitton self-assigned this Oct 29, 2020
@YonghuiDong
Copy link

The peak information is misisng In your example MSP file.

In case you are interested, you can refer to the code from @yufree to read MSP files from MoNa or Riken,
https://github.com/yufree/enviGCMS/blob/c458d9458c9348fc62b31caaf1f19bbf111aff15/R/io.R#L112-L158

Yonghui Dong

@valpalgal
Copy link

I tried to read in a NIST .MSP file and got the following error:
Error in read.compound(huhn[starts[i]:ends[i]], noNumbers = noNumbers) :
No spectrum found

When I look at the MSP file though, there is a line called "Num Peaks:" that should be detected based on what I'm seeing in the read.msp function for metaMS.

@yguitton
Copy link
Owner Author

Hi @valpalgal

There are different "flavours" of NIST .msp spectra files depending on the software/lab used to generate ir. can you share on file with me?

Best

@valpalgal
Copy link

You are right, I changed the formatting of my MSP files to match more or less what I was seeing in your source code. I used text edit commands in terminal to remove the offending lines - some of the annotations for each compound were different than the NIST MSP files and the mass counts were separated by ";" though it looked like you already had code to read that type of separation.

I downloaded the Mass Spectra for Chemical Ecology (Release 6) MSP file. It has the ".mace" file suffix but it is a text file in MSP format. https://leopard.tu-braunschweig.de/receive/dbbs_mods_00078108

@valpalgal
Copy link

valpalgal commented Nov 23, 2024

Oh oops, the metaMS code actually works fine for the MACE database linked above, not for the NIST one though. An example of the NIST MSP file I used is attached.
NIST14_example.txt

I had the reverse issue with the eRah package's database import function - the MACE database won't upload without edits but the NIST database is fine. I didn't try to debug the metaMS code because the NIST file (~270,000 spectra) is so much larger than the MACE file (~500 compounds).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants