This guide provides practical examples of using 🧪 MetaboT 🍵 for common metabolomics analysis tasks.
Count features with matching annotations:
python -m app.core.main -c "How many features have the same SIRIUS/CSI:FingerID and ISDB annotation?"Query specific chemical classes:
python -m app.core.main -c "Which extracts have features annotated as aspidosperma-type alkaloids by CANOPUS with a probability score above 0.5?"Get structural annotations for a specific plant:
python -m app.core.main -c "What are the SIRIUS structural annotations for Tabernaemontana coffeoides?"Match features across ionization modes:
python -m app.core.main -c "Filter the pos ionization mode features of Melochia umbellata annotated as [M+H]+ by SIRIUS to keep the ones for which a feature in neg ionization mode is detected with the same retention time (+/- 3 seconds)"Query bioassay results:
python -m app.core.main -c "List the bioassay results at 10µg/mL against T.cruzi for lab extracts of Tabernaemontana coffeoides"Combine multiple analysis aspects:
python -m app.core.main -c "Which lab extracts from Melochia umbellata yield compounds that have a retention time of less than 2 minutes and demonstrate an inhibition percentage greater than 70% in bioassay results?"# Initialize components
from app.core.main import llm_creation
from app.core.workflow.langraph_workflow import create_workflow
# Initialize components
endpoint_url = "https://enpkg.commons-lab.org/graphdb/repositories/ENPKG"
models = llm_creation() # See app/core/main.py
# Create workflow
workflow = create_workflow(
models=models,
endpoint_url=endpoint_url,
evaluation=False,
)from app.core.workflow.langraph_workflow import process_workflow
# Process a custom query
query = "What are the chemical structure ISDB annotations for Lovoa trichilioides?"
process_workflow(workflow, query) # See app/core/workflow/langraph_workflow.py# Process multiple queries
queries = [
"Count the number of LCMS features in negative ionization mode",
"What are the mass spectrometry features detected for Rumex nepalensis?",
"What is the highest inhibition percentage for compounds from Rauvolfia vomitoria?"
]
for query in queries:
process_workflow(workflow, query)
# Process results as needed-
Query Optimization
- Be specific in your queries
- Include relevant constraints
- Consider data volume
-
Resource Management
- Close connections when done
- Monitor memory usage
- Handle large result sets appropriately
-
Error Handling
try: process_workflow(workflow, query) except Exception as e: print(f"Error processing query: {e}") # Handle error appropriately
# Filter features by retention time
query = "List LC-MS features with chemical class annotation by CANOPUS and retention time between 5-7 minutes"# Compare annotations across methods
query = "Which compounds have annotations from both ISDB and SIRIUS, and what are their molecular masses?"# Combine multiple criteria
query = "Which plant has extracts containing compounds that demonstrated inhibition rates above 50% and are above 800 Da in mass?"