Skip to main content

Molecular Spectrometry Adduct Calculator: Calculates m/z of potential adducts given compound m/z

Project description

Molecular Spectrometry Adduct Calculator (MSAC)

The Molecular Spectrometry Adduct Calculator (MSAC) calculates the m/z of potential adducts from given compound m/z. This can help in reading a mass spectrometry spectra. The user provides a .csv with one column containing monoisotopic masses titled 'mass'; other columns will be preserved. Optionally, the user can also supply a more targeted list of adducts to calculate: a .csv with columns 'adduct' and 'charge', where adducts are written without brackets such as M+Na or M-H.

Getting Started

These instructions will get you to run the calculator as a python package.

Prerequisites

Recommended installation is through anaconda, so dependencies are compatible with each other.

Dependencies are pandas, numpy, and molmass.

Using conda:

conda env create -f msac-env.yml
conda activate msac-env

A requirements.txt file is also available.

Installing

In your activated conda environment, install the calculator.

# clone/install
git clone https://github.com/pnnl/msac.git
pip install msac/

# direct
pip install git+https://github.com/pnnl/msac

Running the calculator

MSAC is provided with two adduct lists: a default list of 13 common adducts and an extensive list of adducts found in NIST17. To calculate the m/z for these adducts based on your input masses, pass MSAC a .csv with the compound masses in a column titled 'mass'. Other columns present in the file will be preserved.

msac input.csv

If your input file's monoisotopic mass column is not called 'mass', you can pass in the title as a string.

msac input.csv -m "Monoisotopic Mass"

You can also specify an output file name; default is {input_name}_adducts.csv.

msac input.csv -o my_output_name.csv

If you want to use your own list of adducts, create a csv with a column called 'adduct' and an column of 'charge'. Check example_data/adduct_list_full.csv for an example. The default adduct list included in the distribution is used here.

msac input.csv -f adduct_only_list.csv

If you want to include potential neutral losses, add the -n flag.

msac input.csv -n

If you're using the default adduct list or the neutral loss list with -n, you can limit the number of adducts used based on its prevalence in NIST/GNPS/MassBank. Using a value 1.0 or less will give you all adducts that cover more than the specified percent of NIST/GNPS/MassBank. Using an integer value 2+ gives that number of adducts.

msac input.csv -c 0.75 -o "75th_percentile_adducts.csv"
msac input.csv -c 5 -o "top_5_most_common_adducts.csv"

If you have a column of formulas in your input file, you can have MSAC calculate the input masses for you and/or have it output 'NaN' values when a neutral loss cannot be done due to the number of atoms in the molecule.

# have MSAC calculate the mass using --formula_col
msac input.csv -f "Formula"
# have MSAC restrict losses to those numerically possible using --restrict
msac input.csv -r "Formula"

Authors

  • Madison Blumer

License

This project is licensed under the BSD License - see the LICENSE.md file for details

Acknowledgments

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

msac-0.1.0.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

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

msac-0.1.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file msac-0.1.0.tar.gz.

File metadata

  • Download URL: msac-0.1.0.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for msac-0.1.0.tar.gz
Algorithm Hash digest
SHA256 43ac20ea6a3a48a688560c6bd5b65ae0a52ada3be8a9dcf52d30d1b9be3cfb85
MD5 711979308de941bb2145ee83c3dd2f4c
BLAKE2b-256 09b102b4916a2e049c5d754ef340662d333bf4fc335e12f83d42c593f39145ce

See more details on using hashes here.

File details

Details for the file msac-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: msac-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.1 Darwin/24.3.0

File hashes

Hashes for msac-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a80a918efec6a52e1e71b8b2ac19b3e168260a7bc2de4ea8d0671050ff20824c
MD5 63dcd4a1a4d2e5b2fcc903c09b64bfb2
BLAKE2b-256 e822d10781a5cffe319ad0b5051e3905f5b3b4130ae757ec46b3b4b5056e4077

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