2.1 Find metabolites in the database

from marsi.io.db import Metabolite, Reference, Database
Looking for local setup.cfg
Not available [Errno 2] No such file or directory: 'setup.cfg'
/Users/joaca/Documents/repositories/marsi/marsi/chemistry/rdkit.py:25: DeprecationWarning: The rdkit.Chem.MCS module is deprecated; please use rdkit.Chem.rdFMCS instead.
  from rdkit.Chem import AllChem, MACCSkeys, MCS
len(Database.metabolites)
---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

<ipython-input-3-c03391927b54> in <module>()
----> 1 len(Database.metabolites)


TypeError: 'result' object cannot be interpreted as an integer

Metabolites are indexed using InChI key.

For example: 1. 2-Deoxy-Glucose: PMMURAAUARKVCB-CERMHHMHSA-N-D 2. Norvaline: SNDPXSYFESPGGJ-SCSAIBSYSA-N

Metabolite.get('PMMURAAUARKVCB-CERMHHMHSA-N')
FormulaC6H12O5
InChiInChI=1S/C6H12O5/c7-2-4-6(10)3(8)1-5(9)11-4/h3-10H,1-2H2/t3-,4-,5?,6+/m1/s1
InChi KeyPMMURAAUARKVCB-CERMHHMHSA-N
Structure - Open Babel Depiction O OH OH HO OH
DBsdrugbank: DB08831
Synonyms2-Deoxy-D-arabino-hexose
Metabolite.get('SNDPXSYFESPGGJ-SCSAIBSYSA-N')
FormulaC5H11NO2
InChiInChI=1S/C5H11NO2/c1-2-3-4(6)5(7)8/h4H,2-3,6H2,1H3,(H,7,8)/t4-/m1/s1
InChi KeySNDPXSYFESPGGJ-SCSAIBSYSA-N
Structure - Open Babel Depiction CH 3 O HO NH 2
DBszinc: ZINC00391822
Synonyms

The query can also be done using identifiers from databases

References are not indexed so this can be very slow.

ref = Reference.get(accession="ZINC00391822", database="zinc")
ref.id
3004454
mets = Metabolite.from_references(references=[ref])
mets[0]
FormulaC5H11NO2
InChiInChI=1S/C5H11NO2/c1-2-3-4(6)5(7)8/h4H,2-3,6H2,1H3,(H,7,8)/t4-/m1/s1
InChi KeySNDPXSYFESPGGJ-SCSAIBSYSA-N
Structure - Open Babel Depiction CH 3 O HO NH 2
DBszinc: ZINC00391822
Synonyms