Skip to content

spectra-to-knowledge/miadb-visualization

Repository files navigation

MIADB-visualization

This repository provides tools and scripts designed for chemists and researchers who are new to Python scripting, specifically in the context of mass spectrometry (MS/MS) and molecular structure analysis.

The repository leverages the matchms to calculate various MS/MS similarity scores, allowing for a more effective comparison of mass spectrometry data. It also includes functionalities for visualizing these similarity scores using seaborn heatmaps.

Additionally, the repository contains a script for calculating Tanimoto coefficients between multiple molecular structures and visualizing structural similarities as a tree. Another script is included to visualize the ion distribution within complex datasets, enhancing the understanding of mass spectrometry results.

This repository was used during the MIADB update to explore the chemical diversity of Monoterpene Indole Alkaloids (MIAs). The tools and methods in this repository are applicable to a wide range of chemical and biological research involving mass spectrometry and molecular similarity analysis.

Features

  • MS/MS Similarity Calculation:
  • Heatmap Visualization:
    • Visualize MS/MS similarity scores as heatmaps using the Seaborn library.
  • Tanimoto Structural Similarity:
    • Compute Tanimoto similarity scores between molecular structures.
    • Visualize the structural similarities as a tree diagram.
  • Ion Distribution Visualization:
    • A script to visualize the repartition of ions in complex mass spectrometry datasets.

💪 Getting Started

We use uv to manage dependencies.

pip install uv
uv sync

Then, you should be able to run the different notebooks:

uv run python3 notebooks/generate_heatmap.py
# uv run python3 notebooks/generate_heatmap.py --measure-type spec2vec --model-path ../../Downloads/spec2vec_AllPositive_ratio05_filtered_201101_iter_15.model
# uv run python3 notebooks/generate_heatmap.py --measure-type ms2deepscore --model-path ../../Downloads/ms2deepscore_model.pt

⚠️ For the Spec2Vec and MS2DeepScore metrics to work, you'll need to download the models first as stated in their respective documentations.

uv run python3 notebooks/generate_tanimoto_heatmap_and_dendrogram.py
uv run python3 notebooks/generate_pie_chart.py
uv run python3 notebooks/generate_pie_chart.py --file-path src/miadbviz/data/ajmalicine-spirooxindoles-corynantheane-spirooxindoles-combined-repartition.xlsx --sheet-name ajmalicine-spiro-corynanthean-s
uv run python3 notebooks/generate_pie_chart.py --file-path src/miadbviz/data/corynanthean-spirooxindoles-best-queries-repartition.xlsx --sheet-name corynanthean-spiro-best-queries

In case you need help:

uv run python3 notebooks/generate_heatmap.py --help

About

Repository hosting the visualization part of the MIADB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages