Skip to main content

Repository for tool that adds more annotations (e.g. SMILES, InChI, CAS number) to MSP files (Python version).

Project description

MSMetaEnhancer

install with bioconda docs Conda PyPI - Python Version DOI

MSMetaEnhancer is a tool used for .msp files annotation. It adds metadata like SMILES, InChI, and CAS number fetched from the following services: CIR, CTS, PubChem, IDSM, and BridgeDb. The app uses asynchronous implementation of annotation process allowing for optimal fetching speed.

If you use MSMetaEnhancer in your work, please cite the following publication:

Troják et al., (2022). MSMetaEnhancer: A Python package for mass spectra metadata annotation. Journal of Open Source Software, 7(79), 4494, https://doi.org/10.21105/joss.04494

Usage

import asyncio

from MSMetaEnhancer import Application
from MSMetaEnhancer.libs.converters.web import CTS, CIR, IDSM, PubChem, BridgeDb
from MSMetaEnhancer.libs.converters.compute import RDKit
from MSMetaEnhancer.libs.utils.ConverterBuilder import ConverterBuilder

ConverterBuilder.register([CTS, CIR, IDSM, PubChem, BridgeDb, RDKit])

app = Application()

# import your .msp file
app.load_data('sample.msp', file_format='msp')

# curate given metadata (e.g. fix CAS numbers)
app.curate_metadata()

# specify requested services (these are supported)
services = ['CTS', 'CIR', 'IDSM', 'PubChem', 'BridgeDb', 'RDKit']

# specify requested jobs
jobs = [('name', 'inchi', 'IDSM'), ('inchi', 'formula', 'IDSM'), ('inchi', 'inchikey', 'IDSM'),
        ('inchi', 'iupac_name', 'IDSM'), ('inchi', 'canonical_smiles', 'IDSM')]

# run asynchronous annotations of spectra data
asyncio.run(app.annotate_spectra(services, jobs))

# export .msp file
app.save_data('sample_out.msp', file_format='msp')

Installation

Prerequisites:

  • Python 3.9+
  • Anaconda

Install MSMetaEnhancer from Bioconda with:

# install MSMetaEnhancer in a new virtual environment to avoid dependency clashes
conda create --name MSMetaEnhancer python=3.9
conda activate MSMetaEnhancer
conda install --channel bioconda --channel conda-forge MSMetaEnhancer

Developer Documentation

Setup

Create your development environment using the provided script via conda to install all required dependencies.

Contributing

We appreciate contributions - feel free to open an issue on our repository, create your own fork, work on the problem and post a PR. Please add your contributions to the changelog and to adhere to the versioning. For more information see here.

Testing

All functionality is tested with the pytest framework.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msmetaenhancer-0.5.0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msmetaenhancer-0.5.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file msmetaenhancer-0.5.0.tar.gz.

File metadata

  • Download URL: msmetaenhancer-0.5.0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.0 Linux/6.14.0-1017-azure

File hashes

Hashes for msmetaenhancer-0.5.0.tar.gz
Algorithm Hash digest
SHA256 6bc1b0b60b5c9a70445ea392cc1083895eec45174e707c8552d6efbb5aa6a00b
MD5 6c31bbb43d64fc6dac5304c8f4f42df4
BLAKE2b-256 07367ed05d19821985e1019631119369b5b37029b47a2f7bb9ac28882aae3cfe

See more details on using hashes here.

File details

Details for the file msmetaenhancer-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: msmetaenhancer-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.11.0 Linux/6.14.0-1017-azure

File hashes

Hashes for msmetaenhancer-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f321ffc03d8247baead090b2f141b09d8d222760544ed2b678915e9e2c02db23
MD5 dbdded83a1e6266fd8906b95a5f720d0
BLAKE2b-256 fb6f8d03e2d24dff37fe06c0abcf55aa1137f9f5a20c11bdf244d20b5f262782

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page