Skip to main content

Bottom-up MS/MS interrogation-based molecular formula annotation for mass spectrometry data.

Project description

msbuddy

Maintainer PyPI docs Generic badge

.

msbuddy is in final training process and will be released soon.

.

msbuddy is developed for molecular formula annotation in mass spectrometry-based small molecule analysis.

  • msbuddy is able to provide formula annotations for:
    • metabolic features with or without MS1 isotopic pattern
    • metabolic features with or without MS/MS spectra
    • both positive and negative ionization modes
  • msbuddy enables:
    • candidate space shrinkage via bottom-up MS/MS interrogation
    • accurate formula annotation via machine learning
    • false discovery rate estimation

Python API

The entire documentation is available at msbuddy Documentation.

Installation

msbuddy is available on PyPI, you can install it via pip:

pip install msbuddy

Quick Start

As a quick start, we here load a mgf file and annotate the molecular formula for each MS/MS spectrum:

from msbuddy import Buddy

# instantiate a Buddy object
buddy = Buddy()

# load data, here we use a mgf file as an example
buddy.load_mgf('input_file.mgf')

# annotate molecular formula
buddy.annotate_formula()

# retrieve the annotation result summary
result = buddy.get_summary()

To specify the parameter settings, you can use the BuddyParamSet object:

from msbuddy import Buddy, BuddyParamSet

# instantiate a BuddyParamSet object
param = BuddyParamSet(ppm = True, ms1_tol = 5, ms2_tol = 10,
                      halogen = False, timeout_secs = 300)
                      
# instantiate a Buddy object with the specified parameter settings
buddy = Buddy(param)

MS/MS spectra can also be loaded via their USIs:

buddy.load_usi('mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00003740036')

# you can also load a list of USIs at once
buddy.load_usi(['mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00003740036',
                'mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00003740037'])

Command-line API

msbuddy can also be used as a command-line tool:

msbuddy --mgf <mgf file> --output <output folder>

or for a csv file containing USI strings (one USI per line):

msbuddy --csv <csv file> --output <output folder>

Run the following command to see the full list of options:

msbuddy --help

Documentation

Link to msbuddy Documentation

Citation

S. Xing et al. BUDDY: molecular formula discovery via bottom-up MS/MS interrogation. Nature Methods 2023. DOI: 10.1038/s41592-023-01850-x

License

This work is licensed under the MIT license.

Contact

To contribute to msbuddy, please feel free to file an issue, or submit a pull request with improvements.

You are also welcome to directly contact the maintainer Shipei Xing (philipxsp@hotmail.com).

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

msbuddy-0.1.1.tar.gz (48.7 MB view hashes)

Uploaded Source

Built Distribution

msbuddy-0.1.1-py3-none-any.whl (49.7 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