Skip to main content

A library for peptide fragment ion generation

Project description

pepfrag

Python package codecov

pepfrag is a library for generating possible dissociation fragment ions of peptides in tandem mass spectrometry experiments.

Table of Contents

Installation

pepfrag can be installed from PyPI.

Compatibility

pepfrag is written using Python 3 and should be compatible with most operating systems. The package has been tested on

  • Windows 10
  • MacOS 10.15
  • Ubuntu 18.04 LTS

Because pepfrag includes C/C++ extensions, installation requires the presence of a C++ 11 compatible compiler on your machine.

Instructions

  1. Install Python 3 (>= version 3.6).
  2. Install the latest version of the pepfrag library using pip:
pip install pepfrag

Usage

Peptide Construction

pepfrag provides one key public class: Peptide. This class includes public methods for computing the mono/average mass of the peptide, including any configured modifications (ModSites), and the peptide fragment ions, with configurable neutral losses.

A Peptide can be constructed from its amino acid sequence, charge state and modifications, for example:

from pepfrag import MassType, ModSite, Peptide

peptide = Peptide(
    "ABCMPK", 
    2, 
    (ModSite(15.994915, 4, "Oxidation"), ModSite(304.20536, "nterm", "iTRAQ8plex")),
    mass_type=MassType.mono
)

Peptide modifications are defined using a sequence of ModSite instances, which are namedtuples defined by the mass of the modification (float), the site of the modification (string for terminal modifications or 1-indexed integer otherwise) and the name of the modification.

The Peptide constructor has two keyword parameters:

  • mass_type:
    • Description: The type of mass to calculate.
    • Type: MassType enumeration.
    • Default: MassType.mono.
  • radical:
    • Description: Flag indicating whether radical cation fragments should be generated.
    • Type: bool.
    • Default: False.

Fragment Generation

Fragment ions can be generated using the fragment method; for efficiency when the same Peptide instance is used repeatedly, the resulting fragments are cached on the instance. This cache is invalidated if the instance attributes are changed.

The fragment method has two keyword parameters:

  • ion_types:
    • Description: The types of fragment ion species to generate. The default setup would generate precursor, immonium, b, y, a, c and z ions.
    • Type: dictionary mapping IonType enumeration instances to possible neutral loss species, represented as strings for the most common neutral losses (i.e. those configured in pepfrag, namely 'H2O', 'NH3', 'CO2' and 'CO'). For additional losses, these can be input as tuples of (name (str), mass (float)).
    • Default:
    from pepfrag import IonType
    
    DEFAULT_IONS = {
        IonType.precursor: ['H2O', 'NH3', 'CO2'],
        IonType.imm: [],
        IonType.b: ['H2O', 'NH3', 'CO'],
        IonType.y: ['NH3', 'H2O'],
        IonType.a: [],
        IonType.c: [],
        IonType.z: []
    }
    
    • Example:
    from pepfrag import IonType, Peptide
    
    peptide = Peptide('APYSMLK', 2, [])
    
    peptide.fragment(ion_types={
        IonType.b: ['NH3', ('customLoss', 17.04)]
    })
    
  • force:
    • Description: Flag indicating whether fragments should be forcibly regenerated, i.e. bypassing the cached ions.
    • Type: bool.
    • Default: False.

License

pepfrag is released under the terms of the MIT license.

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

pepfrag-0.3.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

pepfrag-0.3.0-py3.8-macosx-10.9-x86_64.egg (62.5 kB view details)

Uploaded Source

File details

Details for the file pepfrag-0.3.0.tar.gz.

File metadata

  • Download URL: pepfrag-0.3.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for pepfrag-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f1a9d985df7b7c708f711d5f651620132b544a64a0f35ea86eb66332c82ca060
MD5 365a899497e377f7c448d9ec10ca7a48
BLAKE2b-256 c55cc5033b8ffc0968b2a8a6b441bbc011090aeac0797f37be023e6422ef5b90

See more details on using hashes here.

Provenance

File details

Details for the file pepfrag-0.3.0-py3.8-macosx-10.9-x86_64.egg.

File metadata

  • Download URL: pepfrag-0.3.0-py3.8-macosx-10.9-x86_64.egg
  • Upload date:
  • Size: 62.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0

File hashes

Hashes for pepfrag-0.3.0-py3.8-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 19d664950ee6ca838502d38961ff09d0eccbcf6b48d50898170fa59cb89434d6
MD5 d2d4f52a40940b1f9ca884f0795c181e
BLAKE2b-256 f774f1a3ae9eb412385f6f79365a842b7295305ede252f5ca27df845e34f7c7d

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