CCMS-UCSD / GNPS_Workflows

Public Workflows at GNPS
https://gnps.ucsd.edu/
Other
52 stars 43 forks source link

[MZvault conversion] updates #731

Closed robinschmid closed 3 years ago

robinschmid commented 3 years ago

Done and worked on the test file.

Ideas

Currently, I only copied logging_utils.py - its a duplicate from the FBMN workflow. It would b nice if we could just move it to shared_code and then define this folder as a source folder to all the other projects / files. No idea how you do this on this scale though.

Change

library_conversion.py takes more parameters now:

Plus I added error handling to the requests:

the output is something like this - if the input SMILES is "3" (invalid):

2021-05-16 15:39:48,798 - __main__ - WARNING - Failed to get InChI from SMILES at: https://gnps-structure.ucsd.edu/inchi?smiles=3
2021-05-16 15:39:48,799 - __main__ - ERROR - 400 Client Error: BAD REQUEST for url: https://gnps-structure.ucsd.edu/inchi?smiles=3
Traceback (most recent call last):
  File "D:\git\GNPS_Workflows\library_conversion\tools\library_conversion\MyTest.py", line 21, in <module>
    inchi_convert_results.raise_for_status()
  File "C:\Program Files\Python39\lib\site-packages\requests\models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: BAD REQUEST for url: https://gnps-structure.ucsd.edu/inchi?smiles=3
mwang87 commented 3 years ago

Can you link an example test in Proteomics2 with an MSP file for the NIST format parser

robinschmid commented 3 years ago

I now also added the MZmine json format that we use for the direct submission of library entries from MZmine to GNPS, So far I have created unit tests in the workflow and added test data for each file format.

robinschmid commented 3 years ago

Fixes

Input

Tests