Skip to content

sorenwacker/chebi-tools

Repository files navigation

Python package

chebi-tools

Tools to extract subgraphs from the ChEBI database and for standardization of molecular entities e.g. for applications in metabolomics.

An instance of the development version of the Metabolomics-Standardizer app is running at: https://sorenwacker-chebi-tools-app-bfu421.streamlit.app/

ChEBIDownloader

from chebi_tools import ChEBIDownloader
dl = ChEBIDownloader(what='obo')
dl.download()

WARNING:root:Downloading https://ftp.ebi.ac.uk/pub/databases/chebi/ontology/chebi_core.obo.gz to /Users/user/libChEBI
WARNING:root:Extracting: /Users/user/libChEBI/chebi_core.obo.gz to /Users/user/libChEBI/chebi_core.obo
WARNING:root:Converting: /Users/user/libChEBI/chebi_core.obo to /Users/user/libChEBI/chebi_core.parquet

ChEBIStandardizer

from chebi_tools import ChEBIStandardizer
std.process('mevalonic acid')
# >>> {'CHEBI': 'CHEBI:25350', 'REF_CHEBI': 'CHEBI:25351','REF_NAME': 'mevalonic acid', 'EXACT_MATCH': True, 'COMPOUND_ID': 25350, 'SMILES': 'CC(O)(CCO)CC([O-])=O', 'QUERY': 'mevalonate'}

std.process('mevalonate')
# >>> {'CHEBI': 'CHEBI:17710', 'REF_CHEBI': 'CHEBI:25351', 'REF_NAME': 'mevalonic acid', 'EXACT_MATCH': True, 'COMPOUND_ID': 17710, 'SMILES': 'C[C@@](O)(CCO)CC(O)=O', 'QUERY': 'mevalonic acid'}

ChEBIGraph

from chebi_tools import ChEBIStandardizer
graph.remove_unnecessary_nodes()
graph.update_df()

Mevalonic acid

a, fig = graph.get_subgraph('CHEBI:25351', show=True)
fig

image

Aspartic acid

a, fig = graph.get_subgraph('CHEBI:22660', show=True)
fig

image

About

Python tools for ChEBI database: subgraph extraction and molecular entity standardization for metabolomics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors