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

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, NLM, PubChem, IDSM, and BridgeDB. The app uses asynchronous implementation of annotation process allowing for optimal fetching speed.

Usage

import asyncio

from MSMetaEnhancer import Application

app = Application()

# import your .msp file
app.load_spectra('tests/test_data/sample.msp', file_format='msp')

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

# specify requested services (these are supported)
services = ['CTS', 'CIR', 'NLM', '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))

# execute without jobs parameter to run all possible jobs
asyncio.run(app.annotate_spectra(services))

# export .msp file 
app.save_spectra('tests/test_data/sample_out.msp', file_format='msp')

Installation

Prerequisites:

  • Python 3.7 or 3.8
  • Anaconda

Install MSMetaEnhancer from Bioconda with:

# install MSMetaEnhancer in a new virtual environment to avoid dependency clashes
conda create --name MSMetaEnhancer python=3.8
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.2.3.tar.gz (17.3 kB view hashes)

Uploaded Source

Built Distribution

MSMetaEnhancer-0.2.3-py3-none-any.whl (28.5 kB view hashes)

Uploaded Python 3

Supported by

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