Skip to main content

Access, Deisotope, and Charge Deconvolute Mass Spectra

Project description

https://raw.githubusercontent.com/mobiusklein/ms_deisotope/master/docs/_static/logo.png

A Library for Deisotoping and Charge State Deconvolution For Mass Spectrometry

This library combines brainpy and ms_peak_picker to build a toolkit for MS and MS/MS data. The goal of these libraries is to provide pieces of the puzzle for evaluating MS data modularly. The goal of this library is to combine the modules to streamline processing raw data.

Installing

Building from source requires a version of Cython >= 0.27.0

API

Data Access

ms_deisotope can read from mzML, mzXML and MGF files directly, using the pyteomics library. On Windows, it can also use comtypes to access Thermo’s MSFileReader.dll to read RAW files and Agilent’s MassSpecDataReader.dll to read .d directories. Whenever possible, the library provides a common interface to all supported formats. With Thermo’s pure .NET library, it can use pythonnet to read Thermo RAW files on Windows and Linux (and presumably Mac, too).

from ms_deisotope import MSFileReader
from ms_deisotope.data_source import mzxml

# open a file, selecting the appropriate reader automatically
reader = MSFileReader("path/to/data.mzML")

# or specify the reader type directly
reader = mzxml.MzXMLLoader("path/to/data.mzXML")

All supported readers provide fast random access for uncompressed files, and support the Iterator interface.

# jump the iterator to the MS1 scan nearest to 30 minutes into the run
reader.start_from_scan(rt=30)

# read out the next MS1 scans and all associated MSn scans
scan_bunch = next(reader)
print(scan_bunch.precursor, len(scan_bunch.products))

Averagine

An “Averagine” model is used to describe the composition of an “average amino acid”, which can then be used to approximate the composition and isotopic abundance of a combination of specific amino acids. Given that often the only solution available is to guess at the composition of a particular m/z because there are too many possible elemental compositions, this is the only tractable solution.

This library supports arbitrary Averagine formulae, but the Senko Averagine is provided by default: {“C”: 4.9384, “H”: 7.7583, “N”: 1.3577, “O”: 1.4773, “S”: 0.0417}

from ms_deisotope import Averagine
from ms_deisotope import plot

peptide_averagine = Averagine({"C": 4.9384, "H": 7.7583, "N": 1.3577, "O": 1.4773, "S": 0.0417})

plot.draw_peaklist(peptide_averagine.isotopic_cluster(1266.321, charge=1))
ms_deisotope includes several pre-defined averagines (or “averagoses” as may be more appropriate):
  1. Senko’s peptide - ms_deisotope.peptide

  2. Native N- and O-glycan - ms_deisotope.glycan

  3. Permethylated glycan - ms_deisotope.permethylated_glycan

  4. Glycopeptide - ms_deisotope.glycopeptide

  5. Sulfated Glycosaminoglycan - ms_deisotope.heparan_sulfate

  6. Unsulfated Glycosaminoglycan - ms_deisotope.heparin

Deconvolution

The general-purpose averagine-based deconvolution procedure can be called by using the high level API function deconvolute_peaks, which takes a sequence of peaks, an averagine model, and a isotopic goodness-of-fit scorer:

import ms_deisotope

deconvoluted_peaks, _ = ms_deisotope.deconvolute_peaks(peaks, averagine=ms_deisotope.peptide,
                                                       scorer=ms_deisotope.MSDeconVFitter(10.))

The result is a deisotoped and charge state deconvoluted peak list where each peak’s neutral mass is known and the fitted charge state is recorded along with the isotopic peaks that gave rise to the fit.

Refer to the documentation for a deeper description of isotopic pattern fitting.

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

ms_deisotope-0.0.12.tar.gz (2.9 MB view details)

Uploaded Source

Built Distributions

ms_deisotope-0.0.12-cp37-cp37m-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.7m Windows x86-64

ms_deisotope-0.0.12-cp27-cp27m-win_amd64.whl (4.4 MB view details)

Uploaded CPython 2.7m Windows x86-64

File details

Details for the file ms_deisotope-0.0.12.tar.gz.

File metadata

  • Download URL: ms_deisotope-0.0.12.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.40.0 CPython/2.7.14

File hashes

Hashes for ms_deisotope-0.0.12.tar.gz
Algorithm Hash digest
SHA256 0b2ba31f98a0b4d824ded8df8998d17a65c579eee3da7da992b0c506f28843e5
MD5 5dcfc6adf991159330d04d8c55250684
BLAKE2b-256 dfce452a1fdafaa1d9f2c75ead883347daf819bfe7c72263f4566c146766e474

See more details on using hashes here.

Provenance

File details

Details for the file ms_deisotope-0.0.12-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: ms_deisotope-0.0.12-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.40.0 CPython/2.7.14

File hashes

Hashes for ms_deisotope-0.0.12-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2cf1d7f7a48c612fe24a4970ff0e16ecc52b8530b296081c2babc812d01a3c09
MD5 cbdb4924576ff8ec85523d0eca1ffdaa
BLAKE2b-256 0b7295b4cc726a82ec02daccd43bae449e331e7b3636555bdfe926744ec03d11

See more details on using hashes here.

Provenance

File details

Details for the file ms_deisotope-0.0.12-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: ms_deisotope-0.0.12-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.40.0 CPython/2.7.14

File hashes

Hashes for ms_deisotope-0.0.12-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 922a2b5f953749e3130ff371d326d250d23d6af7a940b783d5a740d092d486f1
MD5 c9c9477bd68a2af88ba17fcd2719fc74
BLAKE2b-256 a4a29ad149a08e65a563560ff083fc6af1c6c96f57b76a4c274aadb9c50017ef

See more details on using hashes here.

Provenance

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