Primitives
MassSpectrum(filename, scan_id, mz, intensity, ms_level=None, retention_time=None, ion_mobility=None, precursor_mz=None, precursor_charge=None, label=None)
Bases: MsmsSpectrum
A mass spectrum.
| PARAMETER | DESCRIPTION |
|---|---|
filename
|
The file from which the spectrum originated.
TYPE:
|
scan_id
|
The Hupo PSI standard scan identifier.
TYPE:
|
mz
|
The m/z values.
TYPE:
|
intensity
|
The intensity values.
TYPE:
|
retention_time
|
The measured retention time.
TYPE:
|
ion_mobility
|
The measured ion mobility.
TYPE:
|
precursor_mz
|
The precursor ion m/z, if applicable.
TYPE:
|
precursor_charge
|
The precursor charge, if applicable.
TYPE:
|
label
|
A label for the mass spectrum. This is typically an annotation, such as the generating peptide sequence, but is distinct from spectrum_utils' annotation.
TYPE:
|
Attributes
precursor_mass
property
The monoisotopic mass.
usi
property
The Universal Spectrum Identifier.
Methods:
intensity(values)
Set the intensity array.
mz(values)
Set the m/z array.
to_tensor()
Combine the m/z and intensity arrays into a single tensor.
| RETURNS | DESCRIPTION |
|---|---|
torch.tensor of shape (n_peaks, 2)
|
The mass spectrum information. |
Peptide(sequence, modifications=None, charge=None)
dataclass
A peptide sequence with or without modification and/or charge.
| PARAMETER | DESCRIPTION |
|---|---|
sequence
|
The bare amino acid sequence.
TYPE:
|
modifications
|
The modification at each amino acid. This should be the length of
TYPE:
|
charge
|
The charge of the peptide.
TYPE:
|
Methods:
from_massivekb(sequence, charge=None)
classmethod
Create a Peptide from MassIVE-KB annotations.
MassIVE-KB includes N-term carbamylation, NH3-loss, acetylation, as well as M oxidation, and deamidation of N and Q, in a manner that does not comply with the ProForma standard.
| PARAMETER | DESCRIPTION |
|---|---|
sequence
|
The peptide sequence from MassIVE-KB
TYPE:
|
charge
|
The charge state of the peptide.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Peptide
|
The parsed MassIVE peptide after conversion to a ProForma format. |
from_proforma(sequence)
classmethod
Create a Peptide from a ProForma 2.0 string.
| PARAMETER | DESCRIPTION |
|---|---|
sequence
|
A ProForma 2.0-compliant string.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Peptide
|
The parsed ProForma peptide. |
massivekb_to_proforma(sequence, charge=None)
classmethod
Convert a MassIVE-KB peptide sequence to ProForma.
MassIVE-KB includes N-term carbamylation, NH3-loss, acetylation, as well as M oxidation, and deamidation of N and Q, in a manner that does not comply with ProForma.
| PARAMETER | DESCRIPTION |
|---|---|
sequence
|
The peptide sequence from MassIVE-KB
TYPE:
|
charge
|
The charge state of the peptide.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The parsed MassIVE peptide after conversion to a ProForma format. |
split()
Split the modified peptide for tokenization.
Molecule(smiles, charge=None)
dataclass
A representation of a molecule.
| PARAMETER | DESCRIPTION |
|---|---|
smiles
|
A SMILES string defining the molecule.
TYPE:
|
charge
|
The charge of the molecule.
TYPE:
|
Methods:
from_selfies(selfies, charge=None)
classmethod
Create a molecule from a SELFIES string.
| PARAMETER | DESCRIPTION |
|---|---|
selfies
|
The SELFIES string defining the molecule.
TYPE:
|
charge
|
The charge of the molecule.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Molecule
|
The parsed Molecule. |
show(**kwargs)
Show the molecule in 2D.
| PARAMETER | DESCRIPTION |
|---|---|
**kwargs
|
Keyword arguments passed to
TYPE:
|
to_selfies()
Convert SMILES to a SELFIES representaion.