Neutral losses are specified by their molecular formula. Neutral losses are specified by their delta mass.
Also slight changes to the FragmentAnnotation interface to follow the PSI peak interpretation specification in development for the PSI spectral library format. This also changes the designation of the peak charges in the plot a bit.
I'm still thinking a bit about the interface and underlying code.
TODO:
[X] Update and add unit tests.
[X] Write documentation.
Example:
import matplotlib.pyplot as plt
import pandas as pd
import spectrum_utils.plot as sup
import spectrum_utils.spectrum as sus
peaks = pd.read_csv('https://metabolomics-usi.ucsd.edu/csv/'
'?usi=mzspec%3AMassIVE%3ATASK-f4b86b150a164ee4a440b661e97a7193-spectra'
'%3Ascan%3A471429%3ATSMGGTQQQFVEGVR%2F2')
spectrum = sus.MsmsSpectrum(
'mzspec:MassIVE:TASK-f4b86b150a164ee4a440b661e97a7193-spectra:scan:471429',
812.8890, 2, peaks['mz'].values, peaks['intensity'].values,
peptide='TSMGGTQQQFVEGVR')
spectrum.annotate_peptide_fragments(0.05, 'Da', ion_types='aby',
neutral_losses={'NH3': -17.026549,
'H2O': -18.010565})
fig, ax = plt.subplots(figsize=(12, 6))
sup.spectrum(spectrum, ax=ax)
plt.savefig('neutral_loss.png', dpi=300, bbox_inches='tight')
plt.close()
Fixes #16.
Neutral losses are specified by their molecular formula.Neutral losses are specified by their delta mass.Also slight changes to the
FragmentAnnotation
interface to follow the PSI peak interpretation specification in development for the PSI spectral library format.This also changes the designation of the peak charges in the plot a bit.I'm still thinking a bit about the interface and underlying code.
TODO:
Example:
Plot: