lipyd package

Submodules

lipyd.common module

lipyd.common.addToList(lst, toadd)[source]
lipyd.common.delEmpty(lst)[source]
lipyd.common.flatList(lst)[source]
lipyd.common.guess_ionmode(*args)[source]
lipyd.common.iterator_insert(full_length, insert)[source]

Yields indices from two iterators. At the index insert it inserts a None instead of the second index.

E.g. if full_length = 3 and insert = 1 it yields:
(0, 0), (1, None), (2, 1)

If insert is None or greater or equal than full_length, it yields always tuples of the same indices.

lipyd.common.random_string(length=10)[source]
lipyd.common.to_float(num)[source]

Extracts float from string, or returns numpy.nan.

lipyd.common.to_int(num)[source]

Extracts int from string.

lipyd.common.uniqList(seq)[source]
lipyd.common.uniqOrdList(seq, idfun=None)[source]
lipyd.common.warn_with_traceback(message, category, filename, lineno, file=None, line=None)[source]

Prints warnings with traceback. From https://stackoverflow.com/a/22376126/854988

lipyd.feature module

class lipyd.feature.FeatureAnalyzer(name, samples, method, **variables)[source]

Bases: object

run()[source]

Applies the method for each feature and returns an array of the results.

class lipyd.feature.PeakSize(samples, protein_samples, threshold=2.0, name='peaksize')[source]

Bases: lipyd.feature.FeatureAnalyzer

peak_size(intensities, protein_samples, **kwargs)[source]
class lipyd.feature.Slope(samples, protein_profile, protein_samples, highest_samples, name='slope')[source]

Bases: lipyd.feature.FeatureAnalyzer

slope(intensities, protein_profile, protein_samples, highest_samples)[source]

lipyd.formula module

class lipyd.formula.Formula(formula=None, charge=0, isotope=0, z=1, sign=None, tolerance=0.01, attrs=None, **kwargs)[source]

Bases: lipyd.mass.MassBase, lipyd.mz.Mz

add(formula)[source]
as_mass()[source]
bind(other, loss='H2O')[source]
getname()[source]
reset_atoms()[source]
split(product1, add='H2O')[source]
sub(formula)[source]
update()[source]
update_mz(mz=None, z=1, sign=None, tolerance=0.01, overwrite=False)[source]
class lipyd.formula.Mass(formula_mass=None, charge=0, isotope=0, **kwargs)[source]

Bases: lipyd.formula.Formula

bind(other, loss='H2O')[source]
lipyd.formula.formula2atoms(formula)[source]

Converts chemical formula string to dict of atom counts.

Parameters:formula (str) – Chemical formula

lipyd.fragdb module

class lipyd.fragdb.FragmentAnnotation(mz, name, fragtype, chaintype, c, u, charge)

Bases: tuple

c

Alias for field number 4

chaintype

Alias for field number 3

charge

Alias for field number 6

fragtype

Alias for field number 2

mz

Alias for field number 0

name

Alias for field number 1

u

Alias for field number 5

class lipyd.fragdb.FragmentAnnotator(mzs, ionmode, precursor=None, tolerance=None)[source]

Bases: object

annotate(mz)[source]

Annotates the fragments in MS2 scan with possible identities taken from the fragment database.

reload()[source]
class lipyd.fragdb.FragmentDatabaseAggregator(ionmode='pos', tolerance=50, files=None, include=None, exclude=None, fa_default=None, sph_default=None, fal_default=None, build=True)[source]

Bases: object

add_constraints(cls)[source]
build()[source]

Builds the fragment list.

Reads files and auto-generates programmatically calculated homolog series.

by_name(name)[source]

Returns fragment data by its name. None if the name not in the database.

Parameters:name (str) – The full name of a fragment, e.g. PE [P+E] (140.0118).
default_args = {'FA': 'fa_default', 'FAL': 'fal_default', 'Sph': 'sph_default'}
generate_series()[source]

Generates homologous series fragments.

get_constraints(fragtype)[source]
get_default_file()[source]

Returns the file name of the default fragment lists.

These are stored in the pfragmentsfile and nfragmentsfile settings for positive and negative ion modes, respectively. The fragment list files should have at least 4 columns: * m/z as float * formula – either formula or m/z should be provided, mass calculation from formula has priority over the mass in first column * human readable name * type: e.g. [M+H]+; importantly, for neutral losses this value must start with NL * headgroups (lipid classes), e.g.`PC;SM`

See the built in fragment lists for examples.

get_series_args(cls)[source]

Provides a dict of arguments for fragment homolog series.

Parameters:cls (class) – Fragment homolog series class e.g. fragment.FA_mH – fatty acid minus hydrogen.
lookup(mz, nl=False, tolerance=None)[source]

Searches for fragments in the database matching the mz within the actual range of tolerance. To change the tolerance set the tolerance attribute to the desired ppm value.

Parameters:nl (bool) – The m/z is a neutral loss.
lookup_nl(mz, precursor, tolerance=None)[source]

Searches for neutral loss fragments in the database matching the m/z within the actual range of tolerance.

mz_by_name(name)[source]

Returns the m/z of a fragment by its name. None if the name not in the database.

Parameters:name (str) – The full name of a fragment, e.g. PE [P+E] (140.0118).
read_file(fname=None)[source]

Reads a list of MS2 fragments from a file. Returns list of fragments.

If no filename provided the default fragment lists will be read. The fragment list files should have at least 4 columns: * m/z as float * formula – either formula or m/z should be provided, mass calculation from formula has priority over the mass in first column * human readable name * type: e.g. [M+H]+; importantly, for neutral losses this value must start with NL * headgroups (lipid classes), e.g.`PC;SM`

See the built in fragment lists for examples.

read_files()[source]

Returns the list of fragments read from all files.

reload()[source]
set_filenames()[source]

Sets the files attribute to be a list of filenames. If no files argument provided the built in default fragment list files will be used.

set_series()[source]

Selects the homolog series to be generated and their parameters. See details in docs of exclude and include arguments for __init__().

lipyd.fragdb.by_name(name, ionmode)[source]

Returns fragment data by its name. None if name not in the database.

lipyd.fragdb.constraints(fragtype, ionmode)[source]

Returns the constraints for a given fragment type.

lipyd.fragdb.get_db(ionmode, **kwargs)[source]

Returns fragment database for the ion mode requested. Creates a database with the keyword arguments provided if no database has been initialized yet.

lipyd.fragdb.init_db(ionmode, **kwargs)[source]

Creates a fragment database.

lipyd.fragdb.lookup(mz, ionmode, nl=False, tolerance=None)[source]

Looks up an m/z in the fragment database, returns all fragment identities within range of tolerance.

Parameters:
  • mz (float) – Measured MS2 fragment m/z value.
  • ionmode (str) – MS ion mode; pos or neg.
  • nl (bool) – Look up charged ion or neutral loss m/z.
lipyd.fragdb.lookup_neg(mz, tolerance=None)[source]
lipyd.fragdb.lookup_neg_nl(mz, precursor)[source]
lipyd.fragdb.lookup_nl(mz, precursor, ionmode, tolerance=None)[source]

Looks up an MS2 neutral loss in the fragment database.

lipyd.fragdb.lookup_pos(mz, tolerance=None)[source]
lipyd.fragdb.lookup_pos_nl(mz, precursor, tolerance=None)[source]
lipyd.fragdb.mz_by_name(name, ionmode)[source]

Returns the m/z of a fragment by its name. None if name not in the database.

lipyd.fragment module

Classes representing fragment ions in MS2 spectra.

class lipyd.fragment.AdductCalculator[source]

Bases: object

Deprecated. To be removed soon.

add(formula)[source]
add_atoms(elem, num)[source]
formula2counts(formula)[source]
init_counts()[source]
remove(formula)[source]
class lipyd.fragment.ChainFragParam(plus, minus, charge, name, chaintype, constraints)

Bases: tuple

chaintype

Alias for field number 4

charge

Alias for field number 2

constraints

Alias for field number 5

minus

Alias for field number 1

name

Alias for field number 3

plus

Alias for field number 0

class lipyd.fragment.FA(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FA'))
ionmode = 'neg'
name = 'FA-'
class lipyd.fragment.FAFragSeries(typ, charge, cmin=2, unsatmin=0, cmax=36, unsatmax=6, minus=[], plus=[], **kwargs)[source]

Bases: object

iterfraglines()[source]
itermass()[source]
class lipyd.fragment.FAL_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)
ionmode = 'neg'
name = 'FAL-H'
class lipyd.fragment.FA_m3H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA-3H'
class lipyd.fragment.FA_mCO_m3H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA-CO-3H'
class lipyd.fragment.FA_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA-H'
class lipyd.fragment.FA_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA-H2O'
class lipyd.fragment.FA_mH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA-H2O-H'
class lipyd.fragment.FA_mH2O_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'FA-H2O-OH'
class lipyd.fragment.FA_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'FA-OH'
class lipyd.fragment.FA_mO_pNH2(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA-O+NH2'
class lipyd.fragment.FA_pC2H2_pNH2(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA+C2H2+NH2'
class lipyd.fragment.FA_pC2H2_pNH2_pO(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA+C2H2+NH2+O'
class lipyd.fragment.FA_pC2H3_pNH2_m2H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA+C2H3+NH2-2H'
class lipyd.fragment.FA_pC2_pNH2(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'), FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='FA'))
ionmode = 'neg'
name = 'FA+C2+NH2'
class lipyd.fragment.FA_pC2_pNH2_mO(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph='t', oh=0, chaintype='FA'), FragConstraint(hg=None, family='SL', sub=None, sph='DH', oh=0, chaintype='FA'), FragConstraint(hg=None, family='SL', sub=None, sph='d', oh=0, chaintype='FA'))
ionmode = 'neg'
name = 'FA+C2+NH2-O'
class lipyd.fragment.FA_pC2_pNH2_pO(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA+C2+NH2+O'
class lipyd.fragment.FA_pC2_pN_mO(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA+C2+N-O'
class lipyd.fragment.FA_pC3H2_pNH2(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph='t', oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA+C3H2+NH2'
class lipyd.fragment.FA_pGlycerol_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='BMP', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='DAG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PE', family=None, sub=('Lyso',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PC', family=None, sub=('Lyso',), sph=None, oh=0, chaintype='FA'))
ionmode = 'pos'
name = 'FA+Glycerol-OH'
class lipyd.fragment.FA_pN(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA+N'
class lipyd.fragment.FA_pNH2_mH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'FA+NH2-H2O-H'
class lipyd.fragment.FA_pNH2_mO(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='FA'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='FA'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='Cer', family=None, sub=('PE',), sph=None, oh=0, chaintype='FA'))
ionmode = 'pos'
name = 'FA+NH2-O'
class lipyd.fragment.FA_pNH_pC2H2_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'FA+NH+C2H2-OH'
class lipyd.fragment.FA_pO_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAOH'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)
ionmode = 'neg'
name = 'FA+O-H'
class lipyd.fragment.FattyFragment(head='', minus='', charge=0, name='UnknownFattyFragment%s', attrs=None, ionmode=None, **kwargs)[source]

Bases: lipyd.metabolite.AbstractSubstituent

Represents a fragment ion derived from a moiety with variable length aliphatic chain.

charge_str()[source]
cu_str()[source]
get_name()[source]
iterfraglines()[source]
class lipyd.fragment.FattyFragmentFactory[source]

Bases: object

docs = {'FAL_mH': '\n 18:1 = 267.2693393\n ', 'FA_mH': '\n 227 at C14:0 FA, 281 at C18:1\n ', 'FA_mH2O_mH': '\n 209 at C14:0 FA, 263 at C18:1\n ', 'FA_mO_pC2H2NH2': '\n https://metlin.scripps.edu/metabo_info.php?molid=6214\n [Cer-FA(C8:0)]- 168.1382904 C8H14O1N1-\n ', 'FA_mO_pNH2': '\n 226 at C14:0 FA, 280 at C18:1\n ', 'LysoPA': '\n from Characterization of Phospholipid\n Molecular Species by Means of HPLC-Tandem Mass Spectrometry:\n [lyso PA(18:1,-)]- 435.2 C21H40O7P-\n \n from massbank.jp:\n https://massbank.eu/MassBank/jsp/RecordDisplay.jsp?id=UT002963&dsn=CHUBU\n [lyso PS(18:0,-)]- 437.2668152129 -358 C21H42O7P-\n \n Frega 2007 Fig 15a\n ', 'LysoPAAlkyl': '\n from Characterization of Phospholipid\n Molecular Species by Means of HPLC-Tandem Mass Spectrometry:\n [lyso PA(18:1,-)]- 435.2 C21H40O7P-\n ', 'LysoPA_mH2O': '\n from massbank.eu:\n https://massbank.eu/MassBank/jsp/RecordDisplay.jsp?id=UT002963&dsn=CHUBU\n [lyso PS(18:0,-)-H2O]- 419.2562505266 -610 C21H40O6P-\n \n Frega 2007 Fig 15a\n ', 'LysoPC': '\n from massbank.jp:\n [lyso PC(18:0,-)]- 508.340314507 -373 C25H51NO7P-\n ', 'LysoPCAlkyl': '\n from massbank.jp:\n [lyso PC(alkenyl-18:0,-)]- 492.3453998849 -436 C25H51NO6P-\n \n from massbank.jp:\n [lyso PC(alkyl-18:0,-)]- 494.3610499491 -143 C25H53NO6P-\n ', 'LysoPE': '\n from massbank.jp:\n [lyso PE(18:0,-)]- 480.3090143786 -476 C23H47NO7P-\n ', 'LysoPEAlkyl': '\n from massbank.jp:\n [lyso PE(alkenyl-18:0,-)]- 464.3140997565 -417 C23H47NO6P-\n ', 'LysoPG': '\n from massbank:\n [lyso PG(18:0,-)]- 511.3035946497 -495 C24H48O9P-\n ', 'LysoPGAlkyl': '\n from massbank:\n [lyso PG(18:0,-)]- 511.3035946497 -495 C24H48O9P-\n ', 'LysoPI': '\n from massbank:\n [lyso PI(-,18:0)]- 599.3196386444 -432 C27H52O12P-\n ', 'LysoPIAlkyl': '\n from massbank.jp:3\n [lyso PI(alkyl-16:1,-)-H2O]- 537.2828592076 -228 C25H46O10P-\n \n from this, derived 18:0-:\n [lyso PI(alkyl-18:0,-)]- 585.3403740858 -228 C27H54O11P-\n '}
param_neg = {'FA': ChainFragParam(plus='O2', minus='', charge=-1, name='FA%s-', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FA'))), 'FAL_mH': ChainFragParam(plus='OH', minus='', charge=-1, name='FAL%s-H', chaintype='FAL', constraints=(FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)), 'FA_m3H': ChainFragParam(plus='O2', minus='H3', charge=-1, name='FA%s-3H', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'FA_mCO_m3H': ChainFragParam(plus='O', minus='CH3', charge=-1, name='FA%s-CO-3H', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'FA_mH': ChainFragParam(plus='O2', minus='H', charge=-1, name='FA%s-H', chaintype='FA', constraints=(FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_mH2O': ChainFragParam(plus='O', minus='H2', charge=-1, name='FA%s-H2O', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'),)), 'FA_mH2O_mH': ChainFragParam(plus='O', minus='H3', charge=-1, name='FA%s-H2O-H', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_mO_pNH2': ChainFragParam(plus='NO', minus='', charge=-1, name='FA%s-O+NH2', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_pC2H2_pNH2': ChainFragParam(plus='C2NH4O2', minus='', charge=-1, name='FA%s+C2H2+NH2', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_pC2H2_pNH2_pO': ChainFragParam(plus='C2NH4O3', minus='', charge=-1, name='FA%s+C2H2+NH2+O', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'FA_pC2H3_pNH2_m2H': ChainFragParam(plus='C2NO2', minus='', charge=-1, name='FA%s+C2H3+NH2-2H', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_pC2_pNH2': ChainFragParam(plus='C2NH2O2', minus='', charge=-1, name='FA%s+C2+NH2', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'), FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='FA'))), 'FA_pC2_pNH2_mO': ChainFragParam(plus='C2NH2O', minus='', charge=-1, name='FA%s+C2+NH2-O', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph='t', oh=0, chaintype='FA'), FragConstraint(hg=None, family='SL', sub=None, sph='DH', oh=0, chaintype='FA'), FragConstraint(hg=None, family='SL', sub=None, sph='d', oh=0, chaintype='FA'))), 'FA_pC2_pNH2_pO': ChainFragParam(plus='C2NH2O3', minus='', charge=-1, name='FA%s+C2+NH2+O', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'FA_pC2_pN_mO': ChainFragParam(plus='C2NO', minus='', charge=-1, name='FA%s+C2+N-O', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'FA_pC3H2_pNH2': ChainFragParam(plus='O2NC3H4', minus='', charge=-1, name='FA%s+C3H2+NH2', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph='t', oh=0, chaintype='FA'),)), 'FA_pN': ChainFragParam(plus='NO2', minus='', charge=-1, name='FA%s+N', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'FA_pNH2_mH2O_mH': ChainFragParam(plus='ONH', minus='', charge=-1, name='FA%s+NH2-H2O-H', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_pO_mH': ChainFragParam(plus='O3', minus='H', charge=-1, name='FA%s+O-H', chaintype='FAOH', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=('2OH',), chaintype='FAOH'),)), 'LysoPA': ChainFragParam(plus='C3H6O7P', minus='', charge=-1, name='LysoPA%s', chaintype='FA', constraints=(FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PS', family=None, sub=None, sph=None, oh=0, chaintype='FA'))), 'LysoPAAlkyl': ChainFragParam(plus='C3H8O6P', minus='', charge=-1, name='LysoPAAlkyl%s', chaintype='FAL', constraints=(FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FAL'), FragConstraint(hg='PS', family=None, sub=None, sph=None, oh=0, chaintype='FAL'))), 'LysoPA_mH2O': ChainFragParam(plus='C3H4O6P', minus='', charge=-1, name='LysoPA%s-H2O', chaintype='FA', constraints=(FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PS', family=None, sub=None, sph=None, oh=0, chaintype='FA'))), 'LysoPC': ChainFragParam(plus='C7H15O7NP', minus='', charge=-1, name='LysoPC%s', chaintype='FA', constraints=(FragConstraint(hg='PC', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'LysoPCAlkyl': ChainFragParam(plus='C7H17O6NP', minus='', charge=-1, name='LysoPCAlkyl%s', chaintype='FAL', constraints=(FragConstraint(hg='PC', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)), 'LysoPE': ChainFragParam(plus='C5H9O7NH2P', minus='', charge=-1, name='LysoPE%s', chaintype='FA', constraints=(FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'LysoPEAlkyl': ChainFragParam(plus='C5H11O6NH2P', minus='', charge=-1, name='LysoPEAlkyl%s', chaintype='FAL', constraints=(FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)), 'LysoPEAlkyl_mH2O': ChainFragParam(plus='C5H9O5NH2P', minus='', charge=-1, name='LysoPEAlkyl%s-H2O', chaintype='FAL', constraints=(FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)), 'LysoPG': ChainFragParam(plus='C6H12O9P', minus='', charge=-1, name='LysoPG%s', chaintype='FA', constraints=(FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='BMP', family=None, sub=None, sph=None, oh=0, chaintype='FAL'))), 'LysoPGAlkyl': ChainFragParam(plus='C6H14O8P', minus='', charge=-1, name='LysoPGAlkyl%s', chaintype='FAL', constraints=(FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)), 'LysoPG_mH2O': ChainFragParam(plus='C6H10O8P', minus='', charge=-1, name='LysoPG%s-H2O', chaintype='FA', constraints=(FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='BMP', family=None, sub=None, sph=None, oh=0, chaintype='FAL'))), 'LysoPI': ChainFragParam(plus='C9H16O12P', minus='', charge=-1, name='LysoPI%s', chaintype='FA', constraints=(FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'LysoPIAlkyl': ChainFragParam(plus='C9H18O11P', minus='', charge=-1, name='LysoPIAlkyl%s', chaintype='FAL', constraints=(FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)), 'LysoPI_mH2O': ChainFragParam(plus='C9H14O11P', minus='', charge=-1, name='LysoPI%s-H2O', chaintype='FA', constraints=(FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'Sph_mC2H3_mNH2_mOH': ChainFragParam(plus='O', minus='C2H3', charge=-1, name='Sph%s-C2H3-NH2-OH', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)), 'Sph_mC2H4_m3H': ChainFragParam(plus='NO2', minus='C2H4', charge=-1, name='Sph%s-C2H4-3H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'),)), 'Sph_mC2H4_mNH2_m2H': ChainFragParam(plus='O2', minus='C2H5', charge=-1, name='Sph%s-C2H4-NH2-2H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'),)), 'Sph_mC2H4_mNH2_mH2O': ChainFragParam(plus='O', minus='C2H5', charge=-1, name='Sph%s-C2H4-NH2-H2O', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'))), 'Sph_mCH2_m3H': ChainFragParam(plus='NO2', minus='CH2', charge=-1, name='Sph%s-CH2-3H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)), 'Sph_mCH2_mH2O_mH': ChainFragParam(plus='NO', minus='CH2', charge=-1, name='Sph%s-CH2-H2O-H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'))), 'Sph_mCH2_mNH2_m4H': ChainFragParam(plus='O2', minus='CH5', charge=-1, name='Sph%s-CH2-NH2-4H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'),)), 'Sph_mCH2_mOH': ChainFragParam(plus='NO', minus='C', charge=-1, name='Sph%s-CH2-OH', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'),)), 'Sph_mH_N': ChainFragParam(plus='NH2O2', minus='', charge=-1, name='Sph%s-H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'),)), 'Sph_mNH2_m3H': ChainFragParam(plus='O2', minus='H3', charge=-1, name='Sph%s-NH2-3H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)), 'Sph_mNH2_mOH': ChainFragParam(plus='O', minus='H3', charge=-1, name='Sph%s-NH2-OH', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'))), 'Sph_pC12O10H18_pSO3': ChainFragParam(plus='C12O15H18S', minus='', charge=-1, name='Sph%s+C12O10H18+SO3', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_pC12O10H18_pSO3_pCO_pH2O': ChainFragParam(plus='C13O17H20S', minus='', charge=-1, name='Sph%s+C12O10H18+SO3+CO+H2O', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_pC12O10H18_pSO3_pH2O': ChainFragParam(plus='C12O16H20S', minus='', charge=-1, name='Sph%s+C12O10H18+SO3+H2O', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_pC2_pOH': ChainFragParam(plus='C2NH4O3', minus='', charge=-1, name='Sph%s+C2+OH', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)), 'Sph_pC6O5H8_pSO3': ChainFragParam(plus='C6O10H8S', minus='', charge=-1, name='Sph%s+C6O5H8+SO3', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_pC6O5H8_pSO3_pCO_pH2O': ChainFragParam(plus='C7O12H10S', minus='', charge=-1, name='Sph%s+C6O5H8+SO3+CO+H2O', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_pC6O5H8_pSO3_pH2O': ChainFragParam(plus='C6O11H10S', minus='', charge=-1, name='Sph%s+C6O5H8+SO3+H2O', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_pO': ChainFragParam(plus='NH2O3', minus='', charge=-1, name='Sph%s+O', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)), 'Sph_pPCh_mCH3': ChainFragParam(plus='N2H12O5PC4', minus='', charge=-1, name='Sph%s+PCh-CH3', chaintype='Sph', constraints=(FragConstraint(hg='SM', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),))}
param_pos = {'FA_mH2O_mOH': ChainFragParam(plus='', minus='H3', charge=1, name='FA%s-H2O-OH', chaintype='FA', constraints=(FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_mOH': ChainFragParam(plus='O', minus='H', charge=1, name='FA%s-OH', chaintype='FA', constraints=(FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'FA_pGlycerol_mOH': ChainFragParam(plus='C3H5O3', minus='', charge=1, name='FA%s+Glycerol-OH', chaintype='FA', constraints=(FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='BMP', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='DAG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PE', family=None, sub=('Lyso',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PC', family=None, sub=('Lyso',), sph=None, oh=0, chaintype='FA'))), 'FA_pNH2_mO': ChainFragParam(plus='ONH2', minus='', charge=1, name='FA%s+NH2-O', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='FA'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='FA'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='Cer', family=None, sub=('PE',), sph=None, oh=0, chaintype='FA'))), 'FA_pNH_pC2H2_mOH': ChainFragParam(plus='ONC2H2', minus='', charge=1, name='FA%s+NH+C2H2-OH', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)), 'NLFA': ChainFragParam(plus='O2', minus='', charge=0, name='NL FA%s', chaintype='FA', constraints=(FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'NLFA_m2xH2O': ChainFragParam(plus='', minus='H4', charge=0, name='NL FA%s-2xH2O', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'),)), 'NLFA_mH2O': ChainFragParam(plus='O', minus='H2', charge=0, name='NL FA%s-H2O', chaintype='FA', constraints=(FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PC', family=None, sub='Lyso', sph=None, oh=0, chaintype='FA'))), 'NLFA_pNH3': ChainFragParam(plus='O2NH3', minus='', charge=0, name='NL FA%s+NH3', chaintype='FA', constraints=(FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)), 'NLFA_pOH': ChainFragParam(plus='O3H', minus='', charge=0, name='NL FA%s+OH', chaintype='FA', constraints=(FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)), 'Sph_m2xH2O_mH': ChainFragParam(plus='N', minus='H2', charge=1, name='Sph%s-2xH2O-H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'))), 'Sph_m2xH2O_p2xCH3_pH': ChainFragParam(plus='NC2H4', minus='', charge=1, name='Sph%s-2xH2O+2xCH3+H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_m2xH2O_pCH3': ChainFragParam(plus='NCH2', minus='', charge=1, name='Sph%s-2xH2O+CH3', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M1',), sph=None, oh=0, chaintype='Sph'))), 'Sph_m2xH2O_pH': ChainFragParam(plus='N', minus='', charge=1, name='Sph%s-2xH2O+H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='SM', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'))), 'Sph_mC2H2_mO_mH2O_mNH': ChainFragParam(plus='', minus='C2H2', charge=1, name='Sph%s-C2H2-O-H2O-NH', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'),)), 'Sph_mC_m2xH2O': ChainFragParam(plus='N', minus='CH2', charge=1, name='Sph%s-C-2xH2O', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))), 'Sph_mC_mH2O_mH': ChainFragParam(plus='NO', minus='C', charge=1, name='Sph%s-C-H2O-H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))), 'Sph_mC_mO_mH2O_mH': ChainFragParam(plus='N', minus='C', charge=1, name='Sph%s-C-O-H2O-H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))), 'Sph_mC_mO_mH2O_mNH': ChainFragParam(plus='', minus='C', charge=1, name='Sph%s-C-O-H2O-NH', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))), 'Sph_mH2O_mH': ChainFragParam(plus='NO', minus='', charge=1, name='Sph%s-H2O-H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'))), 'Sph_mH2O_p2xCH3_pH': ChainFragParam(plus='H2NOC2H4', minus='', charge=1, name='Sph%s-H2O+2xCH3+H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'),)), 'Sph_mH2O_pCH3': ChainFragParam(plus='H2NOCH2', minus='', charge=1, name='Sph%s-H2O+CH3', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=('M',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'))), 'Sph_mH2O_pH': ChainFragParam(plus='NOH2', minus='', charge=1, name='Sph%s-H2O+H', chaintype='Sph', constraints=(FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'))), 'Sph_mH_P': ChainFragParam(plus='NH2O2', minus='', charge=1, name='Sph%s-H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'))), 'Sph_mNH2_mH2O_m2H': ChainFragParam(plus='O', minus='H3', charge=1, name='Sph%s-NH2-H2O-2H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'),)), 'Sph_mO_mH2O_pCH3_pH': ChainFragParam(plus='NCH4', minus='', charge=1, name='Sph%s-O-H2O+CH3+H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M1',), sph=None, oh=0, chaintype='Sph'))), 'Sph_mO_pH': ChainFragParam(plus='NOH4', minus='', charge=1, name='Sph%s-O+H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'),)), 'Sph_pH': ChainFragParam(plus='NH4O2', minus='', charge=1, name='Sph%s+H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='SM', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'))), 'Sph_pH2O_mH': ChainFragParam(plus='NH4O3', minus='', charge=1, name='Sph%s+H2O-H', chaintype='Sph', constraints=(FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph')))}
class lipyd.fragment.FattyFragmentOld(charge, c=3, unsat=0, minus=None, plus=None, isotope=0, name=None, hg=None)[source]

Bases: lipyd.mass.MassBase, lipyd.fragment.AdductCalculator

adduct_str()[source]
charge_str()[source]
get_fragline()[source]
set_name(name)[source]
class lipyd.fragment.FragConstraint(hg, family, sub, sph, oh, chaintype)

Bases: tuple

chaintype

Alias for field number 5

family

Alias for field number 1

hg

Alias for field number 0

oh

Alias for field number 4

sph

Alias for field number 3

sub

Alias for field number 2

class lipyd.fragment.LysoPA(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PS', family=None, sub=None, sph=None, oh=0, chaintype='FA'))
ionmode = 'neg'
name = 'LysoPA'
class lipyd.fragment.LysoPAAlkyl(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FAL'), FragConstraint(hg='PS', family=None, sub=None, sph=None, oh=0, chaintype='FAL'))
ionmode = 'neg'
name = 'LysoPAAlkyl'
class lipyd.fragment.LysoPA_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PA', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PS', family=None, sub=None, sph=None, oh=0, chaintype='FA'))
ionmode = 'neg'
name = 'LysoPA-H2O'
class lipyd.fragment.LysoPC(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PC', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'LysoPC'
class lipyd.fragment.LysoPCAlkyl(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg='PC', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)
ionmode = 'neg'
name = 'LysoPCAlkyl'
class lipyd.fragment.LysoPE(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'LysoPE'
class lipyd.fragment.LysoPEAlkyl(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)
ionmode = 'neg'
name = 'LysoPEAlkyl'
class lipyd.fragment.LysoPEAlkyl_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg='PE', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)
ionmode = 'neg'
name = 'LysoPEAlkyl-H2O'
class lipyd.fragment.LysoPG(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='BMP', family=None, sub=None, sph=None, oh=0, chaintype='FAL'))
ionmode = 'neg'
name = 'LysoPG'
class lipyd.fragment.LysoPGAlkyl(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)
ionmode = 'neg'
name = 'LysoPGAlkyl'
class lipyd.fragment.LysoPG_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PG', family=None, sub=None, sph=None, oh=0, chaintype='FA'), FragConstraint(hg='BMP', family=None, sub=None, sph=None, oh=0, chaintype='FAL'))
ionmode = 'neg'
name = 'LysoPG-H2O'
class lipyd.fragment.LysoPI(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'LysoPI'
class lipyd.fragment.LysoPIAlkyl(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FAL'
constraints = (FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FAL'),)
ionmode = 'neg'
name = 'LysoPIAlkyl'
class lipyd.fragment.LysoPI_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='PI', family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'neg'
name = 'LysoPI-H2O'
class lipyd.fragment.NLFA(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'NL FA'
class lipyd.fragment.NLFA_m2xH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'NL FA-2xH2O'
class lipyd.fragment.NLFA_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='FA'), FragConstraint(hg='PC', family=None, sub='Lyso', sph=None, oh=0, chaintype='FA'))
ionmode = 'pos'
name = 'NL FA-H2O'
class lipyd.fragment.NLFA_pNH3(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family='SL', sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'NL FA+NH3'
class lipyd.fragment.NLFA_pOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'FA'
constraints = (FragConstraint(hg=None, family=None, sub=None, sph=None, oh=0, chaintype='FA'),)
ionmode = 'pos'
name = 'NL FA+OH'
class lipyd.fragment.Sph_m2xH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-2xH2O-H'
class lipyd.fragment.Sph_m2xH2O_p2xCH3_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'pos'
name = 'Sph-2xH2O+2xCH3+H'
class lipyd.fragment.Sph_m2xH2O_pCH3(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M1',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-2xH2O+CH3'
class lipyd.fragment.Sph_m2xH2O_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='SM', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-2xH2O+H'
class lipyd.fragment.Sph_mC2H2_mO_mH2O_mNH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'),)
ionmode = 'pos'
name = 'Sph-C2H2-O-H2O-NH'
class lipyd.fragment.Sph_mC2H3_mNH2_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-C2H3-NH2-OH'
class lipyd.fragment.Sph_mC2H4_m3H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-C2H4-3H'
class lipyd.fragment.Sph_mC2H4_mNH2_m2H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-C2H4-NH2-2H'
class lipyd.fragment.Sph_mC2H4_mNH2_mH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'neg'
name = 'Sph-C2H4-NH2-H2O'
class lipyd.fragment.Sph_mCH2_m3H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-CH2-3H'
class lipyd.fragment.Sph_mCH2_mH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'))
ionmode = 'neg'
name = 'Sph-CH2-H2O-H'
class lipyd.fragment.Sph_mCH2_mNH2_m4H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-CH2-NH2-4H'
class lipyd.fragment.Sph_mCH2_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-CH2-OH'
class lipyd.fragment.Sph_mC_m2xH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-C-2xH2O'
class lipyd.fragment.Sph_mC_mH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-C-H2O-H'
class lipyd.fragment.Sph_mC_mO_mH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-C-O-H2O-H'
class lipyd.fragment.Sph_mC_mO_mH2O_mNH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-C-O-H2O-NH'
class lipyd.fragment.Sph_mH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-H2O-H'
class lipyd.fragment.Sph_mH2O_p2xCH3_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'pos'
name = 'Sph-H2O+2xCH3+H'
class lipyd.fragment.Sph_mH2O_pCH3(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=('M',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-H2O+CH3'
class lipyd.fragment.Sph_mH2O_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('1P',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-H2O+H'
class lipyd.fragment.Sph_mH_N(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-H'
class lipyd.fragment.Sph_mH_P(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-H'
class lipyd.fragment.Sph_mNH2_m3H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph-NH2-3H'
class lipyd.fragment.Sph_mNH2_mH2O_m2H(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='k', oh=0, chaintype='Sph'),)
ionmode = 'pos'
name = 'Sph-NH2-H2O-2H'
class lipyd.fragment.Sph_mNH2_mOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph='d', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph='DH', oh=0, chaintype='Sph'))
ionmode = 'neg'
name = 'Sph-NH2-OH'
class lipyd.fragment.Sph_mO_mH2O_pCH3_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=('M2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Sph', family=None, sub=('M1',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph-O-H2O+CH3+H'
class lipyd.fragment.Sph_mO_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='d', oh=0, chaintype='Sph'),)
ionmode = 'pos'
name = 'Sph-O+H'
class lipyd.fragment.Sph_pC12O10H18_pSO3(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C12O10H18+SO3'
class lipyd.fragment.Sph_pC12O10H18_pSO3_pCO_pH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C12O10H18+SO3+CO+H2O'
class lipyd.fragment.Sph_pC12O10H18_pSO3_pH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C12O10H18+SO3+H2O'
class lipyd.fragment.Sph_pC2_pOH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C2+OH'
class lipyd.fragment.Sph_pC6O5H8_pSO3(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C6O5H8+SO3'
class lipyd.fragment.Sph_pC6O5H8_pSO3_pCO_pH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C6O5H8+SO3+CO+H2O'
class lipyd.fragment.Sph_pC6O5H8_pSO3_pH2O(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+C6O5H8+SO3+H2O'
class lipyd.fragment.Sph_pH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='SM', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex2',), sph=None, oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('SHex2',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph+H'
class lipyd.fragment.Sph_pH2O_mH(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Sph', family=None, sub=None, sph='t', oh=0, chaintype='Sph'), FragConstraint(hg='Cer', family=None, sub=('Hex',), sph=None, oh=0, chaintype='Sph'))
ionmode = 'pos'
name = 'Sph+H2O-H'
class lipyd.fragment.Sph_pO(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='Cer', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+O'
class lipyd.fragment.Sph_pPCh_mCH3(**kwargs)

Bases: lipyd.fragment.FattyFragment

chaintype = 'Sph'
constraints = (FragConstraint(hg='SM', family=None, sub=None, sph=None, oh=0, chaintype='Sph'),)
ionmode = 'neg'
name = 'Sph+PCh-CH3'

lipyd.lipid module

class lipyd.lipid.AbstractCeramide(core='', sph_args=None, fa_args=None, o='H', lyso=False, fa_hydroxy=False, lcb_type='d', name='Cer', hg=None, getname=None, **kwargs)[source]

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.AbstractGlycerol(sn1='H', sn2='H', sn3='H', charge=None, pcharge=0, ncharge=0, hg=None, name='Glycerol', typ='G', **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetabolite

class lipyd.lipid.AbstractGlycerolipid(headgroup='H', phospho=True, lyso=False, ether=False, fa_args=None, name='GL', getname=None, hg=None, typ=None, sn3_fa=False, lyso_sn1_fa=True, sn2_fa_args=None, sn3_fa_args=None, sn1_ether=False, sn2_ether=False, sn3_ether=False, **kwargs)[source]

Bases: lipyd.lipid.AbstractGlycerol

class lipyd.lipid.AbstractSphingolipid(core='', o='H', n='H', sph=None, sph_args=None, charge=None, pcharge=None, ncharge=None, lcb_type='d', name='Sphingolipid', subtype=(), hg=None, getname=None, **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetabolite

class lipyd.lipid.BMP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.CeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideD1OAcyl(fa_args_1o={'c': (4, 24), 'u': (0, 9)}, **kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideDPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideDPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideDihydro1OAcyl(fa_args_1o={'c': (4, 24), 'u': (0, 9)}, **kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideDihydroPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideDihydroPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideT1OAcyl(fa_args_1o={'c': (4, 24), 'u': (0, 9)}, **kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideTPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.CeramideTPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.DGCC(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.DGDG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.DGTA(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.DGTS(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.DiacylGlycerol(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.DihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.DihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.DihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.DimethylSphingosineD(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.DimethylSphingosineDihydro(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.DimethylSphingosineT(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.EtherBMP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPA(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPC(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPE(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPGP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPI(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPIP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPIP2(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPIP3(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.EtherPS(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.FattyAcid(c=None, u=None, fa_counts=None, getname=None, sub=(), **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetabolite

class lipyd.lipid.GlycerolipidFactory(fa1_args=None, fa2_args=None, double_ester=True, ether_ester=True, lyso_ester=True, lyso_ether=True, **kwargs)[source]

Bases: object

static gl_class_name(faa)[source]
static gpl_class_name(name, lyso, ether)[source]
class lipyd.lipid.HexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideD1OAcyl(fa_args_1o={'c': (4, 24), 'u': (0, 9)}, **kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideDPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideDPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideDihydro1OAcyl(fa_args_1o={'c': (4, 24), 'u': (0, 9)}, **kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideDihydroPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideDihydroPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideT1OAcyl(fa_args_1o={'c': (4, 24), 'u': (0, 9)}, **kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideTPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylCeramideTPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoCeramideDPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoCeramideDihydroPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoCeramideTPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSphingomyelinD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSphingomyelinDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSphingomyelinT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSulfoDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSulfoDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSulfoDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSulfoHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSulfoHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylLysoSulfoHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSphingomyelinD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSphingomyelinDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSphingomyelinT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSulfoDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSulfoDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSulfoDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSulfoHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSulfoHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.HydroxyacylSulfoHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoBMP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoCeramideDPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoCeramideDihydroPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoCeramideTPE(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoDGCC(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoDGDG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoDGTA(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoDGTS(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoEtherBMP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPA(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPC(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPE(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPGP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPI(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPIP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPIP2(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPIP3(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoEtherPS(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoMGDG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPA(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPC(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPE(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPGP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPI(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPIP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPIP2(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPIP3(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoPS(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoSQDG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.LysoSphingomyelinD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSphingomyelinDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSphingomyelinT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSulfoDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSulfoDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSulfoDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSulfoHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSulfoHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.LysoSulfoHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.MGDG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.MethylSphingosineD(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.MethylSphingosineDihydro(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.MethylSphingosineT(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.MonoacylGlycerol(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.MonoalkylDiacylGlycerol(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.MonoalkylGlycerol(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.MonoalkylMonoacylGlycerol(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PA(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PC(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PE(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PGP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PI(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PIP(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PIP2(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PIP3(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.PS(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.Phosphatidylethanolamine(**kwargs)[source]

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.RetinoicAcid(c=None, u=None, fa_counts=None, getname=None, sub=(), **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetabolite

class lipyd.lipid.Retinol(c=None, u=None, fa_counts=None, getname=None, sub=(), **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetabolite

class lipyd.lipid.SQDG(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.SphingolipidFactory(fa_args_1o=None, **kwargs)[source]

Bases: object

class_name(name, subtype, lcb, hydroxyacyl, o, nacyl)[source]
lcb_name = {'DH': 'Dihydro', 'd': 'D', 'k': 'Keto', 't': 'T'}
post_subclass_name = {'1P': 'Phosphate', 'PC': 'PC', 'PE': 'PE', 'PI': 'PI'}
pre_subclass_name = {'Hex': 'Hexosyl', 'Hex2': 'Dihexosyl', 'M1': 'Methyl', 'M2': 'Dimethyl', 'M3': 'Trimethyl', 'SHex': 'SulfoHexosyl', 'SHex2': 'SulfoDihexosyl'}
class lipyd.lipid.SphingomyelinD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SphingomyelinDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SphingomyelinT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SphingosineD(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineDPC(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineDPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineDihydro(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineDihydroPC(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineDihydroPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineKeto(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineT(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineTPC(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SphingosineTPhosphate(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.SulfoDihexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SulfoDihexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SulfoDihexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SulfoHexosylCeramideD(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SulfoHexosylCeramideDihydro(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.SulfoHexosylCeramideT(**kwargs)

Bases: lipyd.lipid.AbstractCeramide

class lipyd.lipid.TriacylGlycerol(**kwargs)

Bases: lipyd.lipid.AbstractGlycerolipid

class lipyd.lipid.TrimethylSphingosineD(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.TrimethylSphingosineDihydro(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

class lipyd.lipid.TrimethylSphingosineT(**kwargs)

Bases: lipyd.lipid.AbstractSphingolipid

lipyd.lipproc module

class lipyd.lipproc.Chain[source]

Bases: lipyd.lipproc.ChainBase

isomer_str()[source]
class lipyd.lipproc.ChainAttr(sph, ether, oh)

Bases: tuple

ether

Alias for field number 1

oh

Alias for field number 2

sph

Alias for field number 0

class lipyd.lipproc.ChainSummary[source]

Bases: lipyd.lipproc.Chain

class lipyd.lipproc.Headgroup(main, sub)

Bases: tuple

main

Alias for field number 0

sub

Alias for field number 1

class lipyd.lipproc.LipidLabel(db_id, db, names, formula)

Bases: tuple

db

Alias for field number 1

db_id

Alias for field number 0

formula

Alias for field number 3

names

Alias for field number 2

class lipyd.lipproc.LipidRecord[source]

Bases: lipyd.lipproc.LipidRecordBase

full_str()[source]
subclass_str()[source]
summary_str()[source]
lipyd.lipproc.charge_str(charge)[source]
lipyd.lipproc.collapse_attrs(chains)[source]

Combine the attributes of arbitrary number of chains.

lipyd.lipproc.combine_attrs(a1, a2)[source]

Combines the attributes of 2 chains.

lipyd.lipproc.cu_str(c, u)[source]
lipyd.lipproc.empty_chain()[source]

Returns an empty Chain object which might serve as a dummy object.

lipyd.lipproc.empty_chainsum()[source]

Returns an empty ChainSummary object.

lipyd.lipproc.full_str(hg, chains, iso=False)[source]

From a Headgroup and a tuple of Chain objects returns a

lipyd.lipproc.get_attributes(hg, chainsum=None)[source]

Processes a Headgroup and a summary Chain object and returns the name pre- and postfix string elements.

lipyd.lipproc.match_constraint(rec, constr)[source]

Matches an MS2 fragment constraint (fragment.FragConstraint) against a lipid record lipproc.LipidRecord.

Returns the indices of the chains as integers in a set.

The default attribute values of the FragConstraint object always correspond to bypass all filters here. Defining a specific value may limit the records complying with the constraint.

Parameters:
lipyd.lipproc.match_constraints(rec, constraints)[source]

Matches all fragment constraints in the iterable constraints against all chains in MS1 record rec.

Returns a boolean (wether the fragment can possibly origin from the molecular species in the record) and a tuple of chain positions which can be the source of the fragment if the fragment is from an aliphatic chain moiety.

Parameters:
  • rec (LipidRecord) – An MS1 database record object.
  • constraints (iterable) – A number of fragment.FragConstraint objects.
lipyd.lipproc.str2hg(hgstr)[source]

From a headgroup string representation creates a Headgroup object.

lipyd.lipproc.subclass_str(hg, chainsum=None)[source]

From Headgroup and summary Chain object creates a subclass level headgroup string.

lipyd.lipproc.sum_chains(chains)[source]

From a list of chains creates a summary Chain object.

lipyd.lipproc.summary_str(hg, chainsum)[source]

Creates a summary string representation from the headgroup name and a summary Chain object.

lipyd.log module

class lipyd.log.Logger(fname, verbosity=0, logdir=None)[source]

Bases: object

close_logfile()[source]
flush()[source]
get_logdir(dirname=None)[source]
msg(msg='', level=0)[source]
open_logfile()[source]
strftime(format[, tuple]) → string

Convert a time tuple to a string according to a format specification. See the library reference manual for formatting codes. When the time tuple is not present, current time as returned by localtime() is used.

Commonly used format codes:

%Y Year with century as a decimal number. %m Month as a decimal number [01,12]. %d Day of the month as a decimal number [01,31]. %H Hour (24-hour clock) as a decimal number [00,23]. %M Minute as a decimal number [00,59]. %S Second as a decimal number [00,61]. %z Time zone offset from UTC. %a Locale’s abbreviated weekday name. %A Locale’s full weekday name. %b Locale’s abbreviated month name. %B Locale’s full month name. %c Locale’s appropriate date and time representation. %I Hour (12-hour clock) as a decimal number [01,12]. %p Locale’s equivalent of either AM or PM.

Other codes may be available on your platform. See documentation for the C library strftime function.

classmethod timestamp()[source]

lipyd.lookup module

lipyd.lookup.find(a, m, t=20)[source]

Finds closest value based on a reference value in a one dimensional sorted numpy array of floats. Returns the array index closest value or None if nothing found in the range of tolerance. If the array contains contains more identical elements only the index of the first is returned. To lookup all values in a certain range see lookup.findall().

Parameters:
  • a (numpy.array) – Sorted one dimensional float array (-slice).
  • m (float) – Value to lookup.
  • t (float) – Range of tolerance (highest accepted difference) in ppm.
lipyd.lookup.findall(a, m, t=20)[source]

Finds all values within a given range of tolerance around a reference value in a one dimensional sorted numpy array (-slice) of floats. Returns list of array indices.

Parameters:
  • a (numpy.array) – Sorted one dimensional float array.
  • m (float) – Value to lookup.
  • t (float) – Range of tolerance (highest accepted difference) in ppm.
lipyd.lookup.match(observed, theoretical, tolerance=20)[source]
lipyd.lookup.ppm_tolerance(ppm, m)[source]

Converts ppm value to plus/minus range.

Parameters:
  • ppm (int) – Tolerance in ppm.
  • m (float) – The m/z value.

lipyd.mass module

class lipyd.mass.MassBase(formula_mass=None, charge=0, isotope=0, **kwargs)[source]

Bases: object

calc_mass()[source]
formula_from_dict(atoms)[source]
has_formula()[source]
has_mass()[source]
reload()[source]
lipyd.mass.calculate(formula)[source]

Evaluates a string as formula.

Parameters:formula (str) – Expression as a string e.g. HCH3CHOHCOOH - water + electron.
Mass as float.
lipyd.mass.e = 0.00054857990924

Mass of an electron

lipyd.mass.electron = 0.00054857990924

Mass of an electron

lipyd.mass.expr(formula)

Synonym of calculate().

lipyd.mass.first_isotope_mass(elem)[source]
lipyd.mass.getFreqIso()[source]

Obtains isotope abundances from CIAAW webpage. Stores the result in freqIso attribute of the module.

lipyd.mass.getMassFirstIso()[source]

Obtains the masses of the most abundant isotope for each element. The result stored in the massFirstIso module attribute.

lipyd.mass.getMassMonoIso()[source]

Obtains monoisotopic masses from CIAAW webpage. Stores the result in massMonoIso module level variable.

lipyd.mass.getMasses(url)[source]

Downloads an HTML table from CIAAW webpage and extracts the atomic mass or weight information.

lipyd.mass.getWeightStd()[source]

Obtains atomic waights from CIAAW webpage. Stores the result in weightStd attribute of the module.

lipyd.mass.get_mass(elem)[source]

Returns exact mass of the highest abundant isotope of an element.

lipyd.mass.get_weight(elem)[source]
lipyd.mass.isotope_mass(elem, iso)[source]
lipyd.mass.n = 1.00866491588

Mass of a neutron

lipyd.mass.neutron = 1.00866491588

Mass of a neutron

lipyd.mass.p = 1.00727646677

Mass of a proton

lipyd.mass.proton = 1.00727646677

Mass of a proton

lipyd.mass.urlAbundances = 'http://www.ciaaw.org/isotopic-abundances.htm'

URL for isotopic abundances

lipyd.mass.urlMasses = 'http://www.ciaaw.org/atomic-masses.htm'

URL for atomic masses

lipyd.mass.urlWeights = 'http://www.ciaaw.org/atomic-weights.htm'

URL for atomic weights

lipyd.metabolite module

class lipyd.metabolite.AbstractMetabolite(core=0.0, charge=0, isotope=0, name='Unknown', hg=None, getname=<function AbstractMetabolite.<lambda>>, subs=None, sum_only=False, **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetaboliteComponent

static get_substituent(sub)[source]

Creates a Formula object if the substituent is not already an instance of Formula or Substituent.

has_variable_aliphatic_chain(sub)[source]

Tells if the substituent really has more than one possible chain length or unsaturation variation.

iterlines()[source]

Iterates standard lines.

itersubs()[source]

Iterates all combinations of all substituents. Yields tuples of substituents.

itersum()[source]

Iterates by considering only the sum of chain lengths and unsaturations.

subsproduct()[source]

Iterates instances and substituents in parallel. Yields tuples of two elements. First element is a tuple of all molecule parts (substituents). Second element is the actual instance, i.e. the whole molecule.

class lipyd.metabolite.AbstractMetaboliteComponent(core=0.0, charge=0, isotope=0, name='Unknown', getname=<function AbstractMetaboliteComponent.<lambda>>, **kwargs)[source]

Bases: lipyd.formula.Formula

class lipyd.metabolite.AbstractSubstituent(cores=0.0, c=(14, 20), u=(0, 1), counts=None, charges=0, isotopes=0, names='Unknown', chain_attr=None, chain_type=None, getname=<function AbstractSubstituent.<lambda>>, c_u_diff=<function AbstractSubstituent.<lambda>>, prefix='', even=False, valence=1, **kwargs)[source]

Bases: lipyd.metabolite.AbstractMetaboliteComponent

get_chain()[source]
get_prefix()[source]
set_attr(val, name)[source]
set_chlens(c)[source]
set_unsats(u)[source]
update_core(i=0)[source]

lipyd.mgf module

class lipyd.mgf.MgfReader(fname, label=None, charge=1, rt_tolerance=1.0, drift=1.0, tolerance=None)[source]

Bases: object

get_file()[source]

Returns the file pointer, opens the file if necessary.

get_scan(i)[source]

Reads MS2 fragment peaks from one scan.

Returns m/z’s and intensities in 2 columns array.

get_scans(mz, rt=None)[source]

Looks up all scans for one precursor mass and RT, yields 2 column arrays of MS2 m/z’s and intensities and delta RTs.

Calls get_scan for all indices returned by lookup.

i_by_id(scan_id)[source]

Returns the row number for one scan ID.

index()[source]

Indexing offsets in one MS2 MGF file.

Columns:
– pepmass – intensity – retention time – scan num – offset in file – fraction num
lookup(mz, rt=None, tolerance=None)[source]

Looks up an MS1 m/z and returns the indices of MS2 scans in the MGF file.

Returns 2 numpy arrays of the same length: first one with the indices, second one with the RT differences.

lookup_scan_ids(mz, rt=None, tolerance=None)[source]

Same as lookup but returns scan ids instead of indices.

precursor_by_id(scan_id)[source]

Returns the precursor ion mass by scan ID.

reln = re.compile('^([A-Z]+).*=([\\d\\.]+)[\\s]?([\\d\\.]*)["]?$')
reload()[source]
scan_by_id(scan_id)[source]

Retrieves a scan by its ID as used in the MGF file. Scan ID is an integer number, the number of the scan in the sequence of the whole experiment.

Returns the scan as 2 columns array by get_scan or None if the scan ID could not be found.

stRbe = 'BE'
stRch = 'CH'
stRcharge = 'CHARGE'
stRempty = ''
stRen = 'EN'
stRpepmass = 'PEPMASS'
stRrtinseconds = 'RTINSECONDS'
stRtitle = 'TITLE'

lipyd.moldb module

class lipyd.moldb.LipidMaps(extract_file=True)[source]

Bases: lipyd.sdf.SdfReader

class lipyd.moldb.MoleculeDatabaseAggregator(resources=None, tolerance=None, fa_args=None, sph_args=None, build=True, verbose=False)[source]

Bases: object

add_metabolite_series(cls, fa_args=None, sph_args=None, sum_only=True, **kwargs)[source]

Adds metabolites of a single class generated along a defined range of homolog series.

adduct_lookup(mz, adducts=None, ionmode=None, charge=None, adduct_constraints=True, tolerance=None)[source]

Does a series of lookups in the database assuming various adducts. Calculates the exact mass for the m/z for each possible adduct and searches these exact masses in the database.

Returns a dict of tuples with 3-3 numpy arrays. Keys of the dict are adduct types. The arrays are exact masses, database record details and accuracies (ppm).

adduct_lookup_many(mzs, adducts=None, ionmode=None, charge=None, adduct_constraints=True, tolerance=None)[source]

Performs the lookup on a vector of m/z values. Calls the adduct_lookup method on all m/z’s.

Returns array of dicts with lookup results.

auto_fattyacids(**kwargs)[source]

Autogenerates all fatty acids from classes listed in lipid.fattyacids.

Parameters:**kwargs

Arguments for fatty acid classes: c, u, fa_counts, etc.

auto_glycerolipids(**kwargs)[source]

Autogenerates all glycerolipids from classes listed in lipid.glycerolipids.

Parameters:**kwargs

Arguments for glycerolipid classes (fa_args, sn2_fa_args, etc).

auto_glycerophospholipids(**kwargs)[source]

Autogenerates all glycerophospholipids from classes listed in lipid.glycerophospholipids.

Parameters:**kwargs

Arguments for glycerophospholipid classes (fa_args, sn2_fa_args, etc).

auto_metabolites(fa_args=None, sph_args=None, sum_only=True, classes=None, **kwargs)[source]
auto_misc(**kwargs)[source]

Autogenerates all miscellanous classes listed in lipid.misc.

Parameters:**kwargs

Arguments for misc classes.

auto_sphingolipids(**kwargs)[source]

Autogenerates all sphingolipids from classes listed in lipid.sphingolipids.

Parameters:**kwargs

Arguments for sphingolipid classes (fa_args, sph_args, etc).

build()[source]

Executes the workflow of the entire database building process.

First loads the third party databases (SwissLipids and LipidMaps), then autogenerates glycerophospholipid, glycerolipid and sphingolipid series. At the end all data merged into common masses and data arrays and sorted by increasing mass. At this point the instance is able to do lookups.

export_db(fname='molecule_database.tsv')[source]
export_db_lipidblast(fname='molecule_database.csv')[source]
static get_url(db_id)[source]
ilookup(m, tolerance=None)[source]
init_rebuild()[source]

Creates an empty list where this object collects the masses and molecule annotations. This needs to be done before (re)building the database in order to start from an empty array.

load_databases()[source]

Loads all databases and generates main array.

lookup(m, tolerance=None)[source]
lookup_accuracy(m, tolerance=None)[source]

Performs a lookup and adds accuracy information to the result.

mass_data_arrays()[source]
static records_string(records, adducts=None, databases=None, show_ppm=False, show_adduct=False, show_db=False)[source]
reload(children=False)[source]
sort()[source]

Sorts the masses and data arrays by increasing mass in order to make fast lookups possible.

class lipyd.moldb.Reader[source]

Bases: object

iterrows()[source]
reload(children=False)[source]
class lipyd.moldb.SwissLipids(levels={'Species'}, silent=False, nameproc_args=None, branched=False, exact_mass_formula_fallback=True)[source]

Bases: lipyd.moldb.Reader

static add_annotations(mol, record, exact_mass_formula_fallback=True)[source]
close_gzfile()[source]
close_plainfile()[source]
export_names(proc)[source]
get_hg(hg, sub=())[source]
get_hg_obmol(hg, sub=())[source]
get_isomer(name)[source]
get_isomer_obmol(name)[source]
get_obmol(name, index='')[source]
get_record(name, index='')[source]
get_species(name)[source]
get_species_obmol(name)[source]
get_subspec(name)[source]
get_subspec_obmol(name)[source]
init_name_processor()[source]

Creates a LipidNameProcessor instance to process lipid names at indexing.

iterfile()[source]
itermol(obmol=False)[source]

Iterates the database either by yielding pybel.Molecule objects with extra attributes or dummy objects with the same attributes containing the various IDs and structure representations (see code of add_annotation) for details.

Parameters:obmol (bool) – Yield pybel.Molecule objects. By default simple dummy objects produced.
load()[source]
make_index()[source]
static names(line)[source]
set_levels(levels)[source]

Sets the levels to be processed. Levels in SwissLipids are Species, Molecular subspecies, Structural subspecies and Isomeric subspecies.

Parameters:levels (set) – A set of one or more of the levels above.
static to_obmol(record)[source]
lipyd.moldb.adduct_lookup(mz, ionmode, adduct_constraints=True, tolerance=None)[source]

Does a series of lookups in the database assuming various adducts. Calculates the exact mass for the m/z for each possible adduct and searches these exact masses in the database.

Returns a dict of tuples with 3-3 numpy arrays. Keys of the dict are adduct types. The arrays are exact masses, database record details and accuracies (ppm).

lipyd.moldb.adduct_lookup_many(mzs, adducts=None, ionmode=None, charge=None, adduct_constraints=True, tolerance=None)[source]

Performs the lookup on a vector of m/z values. Calls the adduct_lookup method on all m/z’s.

Returns array of dicts with lookup results.

lipyd.moldb.get_db()[source]

Returns the module’s default database. Initializes the database with default paremeters if no database yet available.

lipyd.moldb.init_db(**kwargs)[source]

Initializes a database.

Parameters:**kwargs

Arguments for :py:class:.MoleculeDatabaseAggregator class.

lipyd.moldb.lookup(m, tolerance=None)[source]
lipyd.moldb.possible_classes(mz, ionmode, adduct_constraints=True, main_only=True, tolerance=None)[source]

For a m/z returns a set of possible classes.

Parameters:main_only (bool) – Return only the set of main classes or subclasses.
lipyd.moldb.records_string(records, adducts=None, databases=None, show_ppm=False, show_adduct=False, show_db=False)[source]

lipyd.ms2 module

class lipyd.ms2.AbstractMS2Identifier(record, scan, adduct=None, missing_chains=None, explicit_and_implicit=False, must_have_chains=True, chain_comb_args={}, missing_chain_args={})[source]

Bases: object

check_lyso(score_threshold=5)[source]

Checks whether the this mass has been identified in the database as a lyso species and calls the corresponding lyso identification method.

Returns True if the score from the lyso is larger than score_threshold.

class_methods = {}
confirm_chains_explicit()[source]
confirm_chains_implicit()[source]
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

confirm_subclass()[source]
identify()[source]
matching_chain_combinations(chain_param1, chain_param2, score_method=<function AbstractMS2Identifier.<lambda>>)[source]
percent_score()[source]

Returns the score as a percentage of the maximum possible score.

Zero maximum score means something is wrong, then it returns 200.

subclass_methods = {}
class lipyd.ms2.BMP_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.PG_Negative

Examines if a negative mode MS2 spectrum is Bismonoacylglycerophosphate. The result will be the same as for PG, as in negative mode we do not know a way to distinguish these species.

Specimen:

  • GM2A - 799.54
  • BPIFB2 - 773.5258 (might be BMP)

Principle:

  • The most abundant fragment is a fatty acid [M-H]- ion.
  • The 152.9958 glycerophosphate fragment must be present.
  • If Lyso-PG fragment present with carbon count complementing the [M-H]- fatty acid score is higher.
  • Presence of 171.0064 headgroup fragment adds to the score.
class lipyd.ms2.BMP_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Bismonoacylglycerophosphate.

Specimen:

  • BPIFB2 + 792.57

Principle:

  • A glycerol+fatty acid fragment can be found among the 3 highest?
  • The PG headgroup neutral loss (189.0402) is among the fragments?
  • If so, does it have a lower intensity than half of the fatty acid+glycerol fragment?
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.Cer_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a ceramide. Identifies ceramide varieties including sphingomyeline, ceramide-1-phosphare, ceramide-phosphoethanolamine, OH-acyl-ceramide, hexosyl and dihexosyl-ceramides, and d, t and DH long chain base varieties.

Specimen:

  • in vivo SEC14L1 583, 554, 580 (formiate adduct)
  • in vivo STARD11 583, 554 (formiate adduct)
  • standards

Specimen:

  • standards

Specimen:

  • standards
cer()[source]
cer1p()[source]
class_methods = {'Cer': 'cer', 'SM': 'sm'}
confirm_chains_explicit()[source]
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

fatty_acyl(fa)[source]
hex2cer()[source]
hexcer()[source]
pe_cer()[source]
shex2cer()[source]
shexcer()[source]
sm()[source]
sphingosine_base(sph)[source]
sphingosine_d()[source]
sphingosine_d_dh()[source]
sphingosine_dh()[source]
sphingosine_t()[source]
subclass_methods = {'1P': 'cer1p', 'Hex': 'hexcer'}
class lipyd.ms2.Cer_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a ceramide. Identifies ceramide varieties including sphingomyeline, ceramide-1-phosphare, ceramide-phosphoethanolamine, OH-acyl-ceramide, hexosyl and dihexosyl-ceramides, and d, t and DH long chain base varieties.

Specimen:

  • Sphingolipid standards scans
  • SEC14L1 + 538.52
  • STARD11 + 538.526

Principle:

  • A sphingosine backbone with two H2O loss must be among the 10 most abundant fragments.
  • Fatty acid [M+H]+ or [M-O]+ fragments or neutral losses complementing the one above increase the score.
  • Sphingosine backbone fragments with same carbon count and unsaturation with the one with 2 water loss but [Sph-C-2(H2O)]+ or [Sph-H2O]+ add to the score.
  • The score increases if the following choline fragments can not be found: 58.0651, 104.1070, 124.9998 and 184.0733.
  • The presence of the following fragments increase the score: 60.0444, 70.0651, 82.0651, 96.0808, 107.0730, 121.0886, 135.1042 and 149.1199.

Specimen:

  • Standards 180626 m/z 568.56 scan 2367

Principle:

  • Same pattern as at dCer but from the sphingosine derived fragments it becomes clear if it has no unsaturation.

Specimen:

  • Standards 180628 m/z 584.56 scan 2070

Principle:

  • Has Sph+H2O-H fragment which does not occur at dCer.
  • Sph-H2O-H and Sph-H are much higher abundant than at dCer.
  • Strong fragment at 60.044 which is missing at dCer.
  • H2O and 2xH2O neutral losses are much higher than at dCer.

Specimen:

  • Standards 180615 m/z 584.22 scan 2421

Principle:

  • Same as other ceramides. It’s d and DH forms are isobaric with tCer but d and t are clearly distinguishable so this does not cause confusion.

Specimen:

  • in vivo GLTPD1 + 728.59

Principle:

  • A shpingosine backbone with 2 H2O loss must be among the 3 highest intensity fragments.
  • Presence of any of the following fragments increases the score: 82.0651, 115.9875. 107.0729, 135.1043, 149.1199.

Specimen:

  • in vivo GLTP + 810.68

Principle:

  • Hexose fragments 198.0740, 180.0634 and 162.0528 must present. These are neutral losses of hexose, hexose-H2O and hexose+H2O

Specimen:

  • in vivo GLTP + 826.67
  • in vitro GLTP + 826.67, 800.66,

Principle:

  • Hexose fragments 198.0740, 180.0634 and 162.0528 must present. These are neutral losses of hexose, hexose-H2O and hexose+H2O

Specimen:

  • in vivo GLTP + 988.73

Principle:

  • Loss of double hexose with our without extra water or water loss are the characteristic fragments of this class.

Specimen:

  • in vitro 890.64

Specimen:

  • in vivo GLTPD1 + 703.57
  • in vitro GLTPD1 + 813.68

Principle:

  • The following choline fragments must be present: 60.0808, 86.0964, 104.1069, 124.9998 and 184.0733. The last one is the most intensive.
  • If 58.0651 can be found it adds to the score.
  • dSM and DHSM are not distinguishable in our settings. Maybe the [Sph-2xH2O+H]+ ion (264 @ 18:1) presents more often at d and only eventually at DH.

We do not have this in standards or in screens so we can not test this. Based on Amiar 2016 and Narayanaswamy 2014.

Principle:

  • Neutral loss of 141.0191 must be present.
  • 142.0264 phospho-ethanolamine fragment and neutral loss of phospho-ethanolamine+water might be present.
  • Sph-2xH2O fragment increases the score.
cer()[source]
cer1p()[source]
class_methods = {'SM': 'sm', 'Sph': 'sph'}
confirm_chains_explicit()[source]

Most of the time we don’t really have fatty acid derived fragments from ceramides in positive mode. However certain sphingosin base derived fragments correspond to neutral losses of fatty acids as the molecule is composed of a sphingosine and a fatty acid but this is redundant. Hence we call both explicit and implicit identification as practically the it is implicit anyways.

confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

fatty_acyl(fa)[source]
hex2cer()[source]
hexcer()[source]
hexcer_chain_combination()[source]
m1()[source]
m2()[source]
m3()[source]
non_hex()[source]
pc()[source]

Lyso-SM aka Sph-PC.

Scherer 2010, Table 1.

pe_cer()[source]
shex2cer()[source]
shexcer()[source]
sm()[source]
sph()[source]
sphingosine_base(sph)[source]
sphingosine_d()[source]
sphingosine_dh()[source]
sphingosine_k()[source]
sphingosine_t()[source]
subclass_methods = {'1P': 'cer1p', 'Hex': 'hexcer', 'Hex2': 'hex2cer', 'M1': 'm1', 'M2': 'm2', 'M3': 'm3', 'PC': 'pc', 'PE': 'pe_cer', 'SHex': 'shexcer', 'SHex2': 'shex2cer', 'empty': 'cer'}
class lipyd.ms2.ChainFragment(c, u, fragtype, chaintype, i, intensity)

Bases: tuple

c

Alias for field number 0

chaintype

Alias for field number 3

fragtype

Alias for field number 2

i

Alias for field number 4

intensity

Alias for field number 5

u

Alias for field number 1

class lipyd.ms2.ChainIdentificationDetails(rank, i, fragtype)

Bases: tuple

fragtype

Alias for field number 2

i

Alias for field number 1

rank

Alias for field number 0

class lipyd.ms2.DAG_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is a DAG.

Specimen:

  • We don’t have yet.

Principle:

  • Combination of fatty acid fragments among the 10 most abundant fragments must match the expected carbon count and unsaturation.
  • If these are among the 5 highest fragments the score is higher.

(Same as in positive ionmode.)

confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.DAG_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a DAG.

Specimen:

  • in vivo: SEC14L2 + 584.52
  • in vitro: BNIP2 + 770.67

Principle:

  • Combination of fatty acid fragments among the 10 most abundant fragments must match the expected carbon count and unsaturation.
  • If these are among the 5 highest fragments the score is higher.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.FA_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is a fatty acid. Here we only check if the most abundant fragment is the fatty acid itself.

Specimen:

  • in vitro FABP1 -

Principle:

  • The most abundant fragment must be a fatty acid which matches the carbon count and the unsaturation of the whole molecule.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.FA_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a fatty acid. Here we only check if the most abundant fragment is the fatty acid itself.

Specimen:

  • Not known

Principle:

  • The most abundant fragment must be a fatty acid which matches the carbon count and the unsaturation of the whole molecule.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.GL_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Generic class for identification of glycerolipids.

confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.GL_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Generic class for identification of glycerolipids.

class_methods = {'DGCC': 'dgcc', 'DGDG': 'dgdg', 'DGTA': 'dgts', 'DGTS': 'dgts', 'MGDG': 'mgdg', 'SQDG': 'sqdg'}
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

dgcc()[source]
dgdg()[source]
dgts()[source]
mgdg()[source]
sqdg()[source]
class lipyd.ms2.LysoPC_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Lysophosphatidylcholine.

Specimen:

  • in vitro FABP1 + 522.36

Principle:

  • Choline-phosphate 184.0733, ethyl-trimethylammonium 86.0964 and neutral loss 183.0660 must be present.
  • The latter neutral loss corresponds to a fatty acid+glycerol ion.
  • The carbon count and unsaturation of this fragment should match that of the whole molecule.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.LysoPE_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Lysophosphatidylethanolamine.

Specimen:

  • in vitro FABP1 + 454.29

Principle:

  • The PE headgroup neutral loss 141.0191 has the highest intensity.
  • A fatty acid-glycerol fragment should match the carbon count and unsaturation of the whole molecule.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.MS2Feature(mz, ionmode, resources, rt, ms1_records=None, rt_range=0.5, check_rt=True)[source]

Bases: object

build_scans()[source]
static guess_resouce_type(res)[source]
identify()[source]
identity_summary(scores=True, drt=True, sample_ids=False, scan_ids=False)[source]
iterscans()[source]
main()[source]
mgf_iterscans(mgf_resource, sample_id=None)[source]
ms1_lookup()[source]
mzml_iterscans(mzml_resource, sample_id=None)[source]
scan_methods = {'mgf': 'mgf_iterscans', 'mzml': 'mzml_iterscans'}
class lipyd.ms2.MS2FeatureOld(main, protein, mode, oi, log=True)[source]

Bases: object

Provides additional, more sophisticated methods for identification of a single feature.

In the original concept all methods for identification based on MS1 and MS2 took place in class Screening(), as those could simply iterate through the arrays.

Later more complex methods became necessary, so I created this class to group them.

get_header_div()[source]
html_table()[source]
html_table_b64()[source]
identify()[source]
identify2(num=1)[source]
msg(text)[source]
print_db_species()[source]
reload(children=False)[source]
select_best_scan()[source]
sort_scans()[source]

Groups the scans in 3 groups: highest consists of those from the fractions with the highest protein level (there might be more than one the highest, because the fraction offset limits); the secondary contains scans from other protein containing fractions; while the other contains the scans from non protein containing fractions. Within the groups the scans are sorted from lowest to highest deltaRT.

class lipyd.ms2.MS2Identity[source]

Bases: lipyd.ms2.MS2IdentityBase

full_str()[source]
summary()[source]
class lipyd.ms2.MS2Scan(scan, scan_id, feature)[source]

Bases: object

This class represents one MS2 scan and provides methods for its analysis.

add_fa1(fa, hg)[source]
bmp_neg_1()[source]

Examines if a negative mode MS2 spectrum is Phosphatidylglycerol. The result will be the same as bmp_neg_1, as in negative mode we do not know a way to distinguish these species.

Specimen:

  • GM2A - 799.54
  • BPIFB2 - 773.5258 (might be BMP)

    Principle:

    • The most abundant fragment is a fatty acid [M-H]- ion.
  • The 152.9958 glycerophosphate fragment must be present. - If Lyso-PG fragment present with carbon count complementing the [M-H]- fatty acid score is higher. - Presence of 171.0064 headgroup fragment adds to the score.

bmp_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Bismonoacylglycerophosphate.

Specimen:

  • BPIFB2 + 792.57

Principle:

  • A glycerol+fatty acid fragment can be found among the 3 highest?
  • The PG headgroup neutral loss (189.0402) is among the fragments? - If so, does it have a lower intensity than half of the fatty acid+glycerol fragment?
build_fa_list(rebuild=False)[source]
Returns list with elements:
carbon count, headgroups (set or None), esther (False) or ether (True), sphingosine (True) or fatty acid (False), fragment intensity and row index
cc2int(cc)[source]

Converts carbon count and unsaturation from string format to tuple of integers. E.g. 18:1 results (18, 1).

Parameters:cc (str) – String representing carbon count and unsaturation separated by colon.
cc2str(cc)[source]

Converts carbon count and unsaturation from tuple of integers to string. E.g. (18, 1) results 18:1.

Parameters:cc (tuple) – Tuple of 2 integers representing carbon count and unsaturation.
ccs2int(ccs)[source]

Converts a string of multiple carbon counts and unsaturations to a list of tuples of integers.

Parameters:ccs (str) – Multiple carbon counts and unsaturations in string representation, e.g. 18:1/16:0.
ccs2str(ccs)[source]

Converts multiple carbon counts and unsaturations from tuples of integers format to string. E.g. [(18, 1), (18, 0)] results 18:1/18:0.

Parameters:ccs (list) – List of tuples of integers.
cer1p_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Ceramide-1-phosphate.

Specimen:

  • GLTPD1 - 616.47

Principle:

  • The most abundant fragment is 78.9591 metaphosphate.
  • If 96.9696 phosphate present adds to the score.
cer1p_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Ceramide-1-phosphate.

Specimen:

  • GLTPD1 + 728.59

Principle:

  • A shpingosine backbone with 2 H2O loss must be among the 3 highest

intensity fragments. - Presence of any of the following fragments increases the score: 82.0651, 107.0729, 135.1043, 149.1199.

cer_fa_test(frag1, frag2)[source]
cer_matching_fa(cer_fa)[source]
cer_missing_fa(cer_hg)[source]

Infers the fatty acid carbon count and unsaturation by subtracting the sphingoid backbone from the total. This works with Cer, CerP and HexCer.

cer_neg_1()[source]

Examines if a negative mode MS2 spectrum is Ceramide.

Specimen:

  • SEC14L1 - 582.509

Principle:

  • A Ceramide backbone fragment must be among the 2 most abundant.
  • Ceramide backbone fragments lighter by N or C2N but same carbon
    count and unsaturation add to the score.
cer_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Ceramide.

Specimen:

  • SEC14L1 + 538.52
  • STARD11 + 538.526

    Principle:

    • A sphingosine backbone with two H2O loss must be among the

    10 most abundant fragments. - Fatty acid [M+H]+ or [M-O]+ fragments or neutral losses complementing the one above increase the score. - Sphingosine backbone fragments with same carbon count and unsaturation with the one with 2 water loss but [Sph-C-2(H2O)]+

    or [Sph-H2O]+ add to the score.

    • The score increases if the following choline fragments

    can not be found: 58.0651, 104.1070, 124.9998 and 184.0733. - The presence of the following fragments increase the score: 60.0444, 70.0651, 82.0651, 96.0808, 107.0730, 121.0886,

    135.1042 and 149.1199.

cerp_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Ceramide-1-phosphate. Gives similar result as Sphingosine-1-phosphate.

Specimen:

  • GLTPD1 - 616.47

Principle:

  • The most abundant fragment must be 78.9591 metaphosphate.
  • Presence of 96.9696 phosphate increase the score.
cerp_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Ceramide-1-phosphate.

Specimen:

  • GLTPD1 + 728.59, 590.45, 702.58, 618.430, 616.415, 640.409

Principle:

  • A sphingosine fragment with double H2O loss must be among the three

highest abundant fragments.

dag_neg_1()[source]

Examines if a negative mode MS2 spectrum is a DAG.

Specimen:

  • We don’t have yet.

Principle:

  • Combination of fatty acid fragments among the 10 most abundant

fragments must match the expected carbon count and unsaturation. - If these are among the 5 highest fragments the score is higher.

dag_pos_1()[source]

Examines if a positive mode MS2 spectrum is a DAG.

Specimen:

  • SEC14L2 + 584.52
  • in vitro: BNIP2 + 770.67

    Principle:

    • Combination of fatty acid fragments among the 10 most abundant

    fragments must match the expected carbon count and unsaturation. - If these are among the 5 highest fragments the score is higher.

fa_among_most_abundant(fa_type, n=2, min_mass=None, sphingo=False, uns=None)[source]

Returns True if there is one of the defined type of fatty acid fragments among the given number of most abundant fragments, and it has a mass greater than the given threhold.

fa_cc_agrees_ms1(cc, hg)[source]
fa_cc_among_most_abundant(cc, hg, n=2, sphingo=False)[source]

Returns True if there is one fatty acid with the defined carbon count and unsaturation and compatible with the given headgroup among the most abundant n fragments.

fa_ccs_agree_ms1(hg, fa_type=None, head=2)[source]
fa_combinations(hg, sphingo=False, head=None, by_cc=False)[source]

Finds all combinations of 2 fatty acids which match the total carbon count and unsaturation resulted by database lookups of the MS1 precursor mass. Alternatively a carbon count and unsaturation can be provided if by_cc is set to True.

This method does the same as fa_combinations but works with a preprocessed lookup table.

Returns set of strings.

Parameters:
  • hg (str) – Short name of the headgroup, e.g. PC; or cc:unsat e.g. 32:1 if by_cc is True.
  • sphingo (bool) – Assume sphingolipid.
  • head (int) – If None the total fragment list used, if a number, only the most intensive fragments accordingly.
  • by_cc (bool) – Use the MS1 database identification to find out the possible carbon counts and unsaturations for the given headgroup, or a cc:uns provided and search combinations accordingly.
fa_combinations3(hg, head=None, expected_intensities=None)[source]

Finds all combinations of 3 fatty acids which match the total carbon count and unsaturation resulted by database lookups of the MS1 precursor mass. This can be used for example at TAG.

Parameters:
  • hg (str) – The short name of the headgroup, e.g. TAG.
  • head (int) – If None or numpy.inf all fragment ions will be considered, otherwise only the first most aboundant until the number head.
fa_combinations_old(hg, sphingo=False, head=None, by_cc=False)[source]

Finds all combinations of 2 fatty acids which match the total carbon count and unsaturation resulted by database lookups of the MS1 precursor mass. Alternatively a carbon count and unsaturation can be provided if by_cc is set to True.

Parameters:
  • hg (str) – Short name of the headgroup, e.g. PC; or cc:unsat e.g. 32:1 if by_cc is True.
  • sphingo (bool) – Assume sphingolipid.
  • head (int) – If None the total fragment list used, if a number, only the most intensive fragments accordingly.
  • by_cc (bool) – Use the MS1 database identification to find out the possible carbon counts and unsaturations for the given headgroup, or a cc:uns provided and search combinations accordingly.
fa_combinations_preprocess(regenerate=False)[source]

Generates a lookup table for all possible combinations of two fatty acids.

fa_combinations_tuples(hg, sphingo=False, head=None, by_cc=False)[source]

Finds all combinations of 2 fatty acids which match the total carbon count and unsaturation resulted by database lookups of the MS1 precursor mass. Alternatively a carbon count and unsaturation can be provided if by_cc is set to True.

Returns tuples of tuples with carbon count/unsaturation, intensities and indices.

Parameters:
  • hg (str) – Short name of the headgroup, e.g. PC; or cc:unsat e.g. 32:1 if by_cc is True.
  • sphingo (bool) – Assume sphingolipid.
  • head (int) – If None the total fragment list used, if a number, only the most intensive fragments accordingly.
  • by_cc (bool) – Use the MS1 database identification to find out the possible carbon counts and unsaturations for the given headgroup, or a cc:uns provided and search combinations accordingly.
fa_neg_1()[source]

Examines if a negative mode MS2 spectrum is a fatty acid. Here we only check if the most abundant fragment is the fatty acid itself.

Specimen:

  • in vitro FABP1 -

Principle:

  • The most abundant fragment must be a fatty acid which matches

the carbon count and the unsaturation of the whole molecule.

fa_percent_of_most_abundant(fa_type, percent=80.0, sphingo=False)[source]
fa_pos_1()[source]

Examines if a positive mode MS2 spectrum is a fatty acid. Here we only check if the most abundant fragment is the fatty acid itself.

Specimen:

  • in vitro FABP1 +

Principle:

  • The most abundant fragment must be a fatty acid which matches

the carbon count and the unsaturation of the whole molecule.

fa_type_is(i, fa_type, sphingo=False, uns=None, scan_index=True)[source]

Tells if a fatty acid fragment is a specified type. The type should be a part of the string representation of the fragment, e.g. -O] for fragments with one oxygen loss.

frag_name_present(name)[source]
full_list_str()[source]
get_by_rank(rank=1, min_mz=0.0)[source]
get_cc(fa)[source]

Extracts carbon count from any string, for example fatty acid names. Recognizes the pattern [number:number]. E.g. from Phosphatidylcholine (36:1) returns the tuple (36, 1). To convert pure cc:uns strings, use the method cc2int instead, as that one is faster.

Parameters:fa (str) – Any string containing carbon count and unsaturation.
get_fa_combinations(frag1, frag2, hg, cc, sphingo, head)[source]

Processes two fatty acid fragments to decide if their combination is valid.

get_hg(frag_name)[source]
get_intensity(mz)[source]

Returns the intensity of a fragment ion from its m/z. Value is None if m/z does not present.

get_most_abundant_fa(fa_type=None, head=1, sphingo=False)[source]

Looks up the most abundant fatty acid fragment of the given type. Returns tuple with mz, intensity, carbon count and unsaturation, index.

get_nl_intensity(nl)[source]

Returns the intensity of a fragment ion from its a neutral loss. Value is None if neutral loss does not present.

has_mz(mz)[source]

Tells if an m/z exists in this scan.

has_nl(nl)[source]

Tells if a neutral loss exists in this scan.

hexcer_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Hexosyl-Ceramide.

Specimen:

  • GLTP - 744.5627

Principle:

  • Hexose fragments 71.0115, 89.0220 and 101.0219 must present.
hexcer_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Hexosyl-Ceramide.

Specimen:

  • GLTP + 810.68

Principle:

  • Hexose fragments 198.0740, 180.0634 and 162.0528 must present.
hexceroh_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Hexosyl-Ceramide-OH (‘t’). This method is the same as hexcer_neg_1.

Specimen:

  • GLTP - 760.557

Principle:

  • Hexose fragments 71.0115, 89.0220 and 101.0219 must present.
hexceroh_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Hexosyl-Ceramide-OH (t). This method is the same as hexcer_pos_1.

Specimen:

  • GLTP + 826.67

Principle:

  • Hexose fragments 198.0740, 180.0634 and 162.0528 must present.
html_table()[source]
identities_str(num=1)[source]

Returns table of all identification attempts as string.

intensity_ratios(intensities, expected=None, logbase=1.5)[source]

Tells if the ratio of a list of intensities fits the one in expected or is even if expected is None.

Parameters:
  • intensities (list) – List of tuples, first element is the intensity, the second is an uniqe identifier of the fragments.
  • expected (list) – List with expected intensity proportions. E.g. [1, 1, 2] means the third ion is twice higher intense than the 2 others.
  • logbase (int) – The fold difference tolerance when comparing intensities. E.g. if this is 2, then an almost twice less or more intense ion will considered to have similar intensity.
is_fa(i, sphingo=False)[source]

Examines whether a fragment is fatty acid-like or not. In the labels of fatty acid fragments we always

is_pa()[source]
is_pc()[source]
is_pe()[source]
is_pg()[source]
is_ps()[source]
lysopc_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Lysophosphatidylcholine.

Specimen:

  • in vitro FABP1 + 522.36

Principle:

  • Choline-phosphate 184.0733, ethyl-triethylammonium 86.0964 and

neutral loss 183.0660 must be present. - The latter neutral loss corresponds to a fatty acid+glycerol ion.

  • The carbon count and unsaturation of this fragment should match
    that of the whole molecule.
lysope_neg_1()[source]

Examines if a negative mode MS2 spectrum is Lysophosphatidylethanolamine.

Specimen:

  • in vitro FABP1 - 464.27

Principle:

  • The most abundant fragment is a fatty acid [M-H]- ion.
  • 140.0118 PE headgroup must be present. - The carbon count and unsaturation of the highest fatty acid fragment must be the same as it is expected for the whole PE molecule. - Other headgroup ions 196.0380 and 178.0275 add to the score.
lysope_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Lysophosphatidylethanolamine.

Specimen:

  • in vitro FABP1 + 454.29

Principle:

  • The PE headgroup neutral loss 141.0191 has the highest intensity.
  • A fatty acid-glycerol fragment should match the carbon count and
    unsaturation of the whole molecule.
matching_fa_frags_of_type(hg, typ, sphingo=False, return_details=False)[source]

Returns carbon counts of those fragments which are of the given type and have complement fatty acid fragment of any type.

Details is a dict with carbon counts as keys and fragment names as values.

most_abundant_fa(fa_type, head=1, sphingo=False)[source]

Returns True if there is a fatty acid among the most abundant fragments and it is of the defined type; False if there is no fatty acid, or it is different type.

Parameters:
  • fa_type (str) – The type of the fatty acid fragment ion.
  • head (int) – The number of most abundant fragments considered.
  • sphingo (bool) – Look for a sphingolipid backbone.
most_abundant_fa_cc(fa_type=None, head=2)[source]
most_abundant_mz()[source]
most_abundant_mz_is(mz)[source]

Tells if the m/z with the highest intensity is mz.

ms1_cc(hgs)[source]

For a list of headgroups returns the possible carbon counts based on database lookups of MS1 m/z’s. Returns set of strings.

ms1_mz()[source]

Returns the MS1 m/z (which should be the precursor ion).

mz_among_most_abundant(mz, n=2)[source]

Tells if an m/z is among the most aboundant n fragments in a spectrum.

Parameters:
  • mz (float) – The m/z value.
  • n (int) – The number of most abundant fragments considered.
mz_lookup(mz)[source]

Returns the index of the closest m/z value detected in the scan if it is within the range of tolerance, otherwise None.

mz_match(mz_detected, mz)[source]
mz_most_abundant_fold(mz, fold)[source]

Tells if an m/z is the most abundant fragment and it has at least a certain fold higher intensity than any other fragment.

Parameters:
  • mz (float) – The m/z value.
  • fold (float) – The m/z must be this times higher than any other.
mz_percent_of_most_abundant(mz, percent=80.0)[source]

Tells if an m/z has at least certain percent of intensity compared to the most intensive fragment.

Parameters:
  • mz (float) – The m/z value.
  • percent (float) – The threshold in percent of the highest intensity.
nl_among_most_abundant(nl, n=2)[source]

Tells if a neutral loss corresponds to one of the most aboundant n fragments in a spectrum.

Parameters:
  • nl (float) – The mass of the neutral loss.
  • n (int) – The number of most abundant fragments considered.
nl_lookup(nl)[source]

Looks up if a neutral loss exists in this scan and returns its index.

pa_pe_ps_pg_pos(hg)[source]
pa_ps_neg(hg)[source]
pc_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Phosphatidylcholine.

Specimen:

  • BPI - 804.57

Principle:

  • 168.0431 phosphate+choline-CH3 fragment must be present.
  • The highest abundant fragment must be a fatty acid [M-H]- fragment. - Lyso-PC fragments complementing the highest [M-H]- fatty acid increase the score.
pc_pos(hg)[source]
pc_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Phosphatidylcholine.

Specimen:

  • BPI + 786.607

Principle:

  • The most abundant fragment must be choline+phosphate 184.0733.
  • The 86.0964 ethyl-triethylammonium must be present. - The most abundant fatty acid can not have the same carbon count and unsaturation as the whole molecule (then it is Lyso-PC). - Fragments 104.1069, 124.9998, 60.0808 and 58.0651 increase the score.
pe_neg_1()[source]

Examines if a negative mode MS2 spectrum is Phosphatidylethanolamine.

Specimen:

  • GM2A - 714.507

Principle:

  • The most abundant fragment is a fatty acid [M-H]- ion.
  • 140.0118 PE headgroup must be present. - Other headgroup ions 196.0380 and 178.0275 add to the score.
  • Lyso-PE and [M-H-CO2]- fatty acid fragments complementing the
    highest [M-H]- fatty acid increase the score.
pe_pc_pg_neg(hg)[source]
pe_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Phosphatidylethanolamine.

Specimen:

  • BPI + 718.536

Principle:

  • The PE headgroup neutral loss 141.0191 has the highest intensity.
  • If it is a Lyso-PE score will be zero.
pg_neg_1()[source]

Examines if a negative mode MS2 spectrum is Phosphatidylglycerol. The result will be the same as bmp_neg_1, as in negative mode we do not know a way to distinguish these species.

Specimen:

  • GM2A - 799.54
  • BPIFB2 - 773.5258 (might be BMP)

    Principle:

    • The most abundant fragment is a fatty acid [M-H]- ion.
  • The 152.9958 glycerophosphate fragment must be present. - If Lyso-PG fragment present with carbon count complementing the [M-H]- fatty acid score is higher. - Presence of 171.0064 headgroup fragment adds to the score.

pg_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Phosphatidylglycerol. At in vivo observed only in standard.

Principle:

  • The PG headgroup neutral loss (189.0402) is the fragment ion

with the highest intensity?

pi_neg_1()[source]

Examines if a negative MS2 spectrum is Phosphatidylinositol.

Specimen:

  • GM2A - 835.52

Principle:

  • Inositolphosphate-H2O fragment 241.0119, metaphosphate 78.9591 and

headgroup fragment 152.9958 must be present. - Additional headgroup fragments 96.9696, 259.0224 and 297.0381 increase the score. - Presence of Lyso-PI fragments complementing other [M-H]- fatty acid fragments increase the score.

pi_pos_1()[source]

Examines if a negative MS2 spectrum is Phosphatidylinositol.

Specimen:

  • SEC14L2 + 906.60 and 882.6

Principle:

  • Combinations of fatty acid fragments must match the expected

carbon count and unsaturation for PI. - Presence of neutral losses 259.0219 and 277.0563 adds to the score.

print_identities(fname=None)[source]

Prints identities to standard output or file.

print_scan()[source]

Prints the list of fragments as an annotated table.

ps_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Phosphatidylserine.

Specimen:

  • ORP9 - 788.54

Principle:

  • The most abundant fragment is an [M-H]- fatty acid fragment.
  • Glycerophosphate fragment 152.9958 must be present. - Metaphosphate 78.9591 increases the score.
  • Serine-H2O neutral loss 87.0320 adds to the score. - Presence of Lyso-PS and Lyso-PA fragments complementing the highest [M-H]- fatty acid fragment increase the score.
ps_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Phosphatidylserine.

Specimen:

  • BPI + 790.56

Principle:

  • PS headgroup neutral loss 185.0089 must be the highest intensity.
reload()[source]
scan_str()[source]

Returns the scan table as string.

show()[source]

Prints the scan table to standard output.

sm_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Sphingomyeline.

Specimen:

  • GLTPD1 - 745.55

Principle:

  • Must have a neutral loss of CH3+COOH (60.0211).
  • Phosphate+choline-CH3 fragment 168.0431 must be present.
sm_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Sphingomyeline.

Specimen:

  • GLTPD1 + 703.57
  • GLTPD1 + 813.68 (in vitro)

    Principle:

    • The following choline fragments must be present: 60.0808, 86.0964,

    104.1069, 124.9998 and 184.0733. The last one is the most intensive. - If 58.0651 can be found it adds to the score.

sort_by_i(return_order=False)[source]

Sorts the scan array by intensity decreasing.

sort_by_mz()[source]

Sorts the scan array by m/z increasing.

sph1p_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Spingosine-1-phosphate.

Specimen:

  • Only observed in standard.

Principle:

  • Phosphate 78.9590 must be present.
sum_cc(ccs)[source]

Adds numeric carbon counts and unsaturations. Accepts a list of tuples of integers, returns a tuple of integers.

Parameters:ccs (list) – A list with tuples of integers, e.g. [(14, 1), (16, 0)].
sum_cc2(ccs)[source]

Returns the total carbon count and unsaturation in tuple format from a list of tuples where the first element of the tuple is another tuple with the cc and uns, and the second is the intensity, which is discarded here.

Parameters:ccs (list) – List of the format described above. E.g. [((16, 0), 1000.0), ((18, 1), 722)], this results (34, 1).
sum_cc2str(ccs)[source]

Returns the total carbon count and unsaturation in string format from a list of tuples where the first element of the tuple is another tuple with the cc and uns, and the second is the intensity, which is discarded here.

Parameters:ccs (list) – List of the format described above. E.g. [((16, 0), 1000.0), ((18, 1), 722)], this results 34:1.
sum_cc_is(cc1, cc2, cc)[source]

Returns True if the sum of the 2 carbon counts and unsaturations is equal with the third one.

Parameters:
  • cc1 (tuple) – Carbon count and unsaturation 1.
  • cc2 (tuple) – Carbon count and unsaturation 2.
  • cc (str) – Expected total carbon count and unsaturation.
sum_cc_str(ccs)[source]

Returns the sum of multiple carbon counts and unsaturations. Accepts string format and results string format.

Parameters:ccs (str) – Multiple carbon counts and unsaturations in string representation, e.g. 18:1/16:0.
tag_neg_1()[source]

Examines if a negative mode MS2 spectrum is a TAG.

Specimen:

  • We don’t have yet.

Principle:

  • Combination of fatty acid fragments must match the

expected carbon count and unsaturation.

tag_pos_1()[source]

Examines if a positive mode MS2 spectrum is a TAG.

Specimen:

  • STARD11 + 818.7187

Principle:

  • Combination of fatty acid fragments must match the expected

carbon count and unsaturation.

va_pos_1()[source]

Examines if a positive MS2 spectrum is vitamin A (retinol).

Specimen:

  • RBP1 + 269.2245
  • RBP4 + 269.2245

    Principle:

    • The most abundant ion is the whole molecule m/z = 269.224.
  • Presence off 3 other ions adds to the score but not

    mandatory: 213.165, 145.1027, 157.1028.

vd_pos_1()[source]

Examines if a positive mode MS2 spectrum is a vitamin D. This method is not implemented, does nothing.

class lipyd.ms2.PA_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is Phosphatidylglycerol. The result will be the same as bmp_neg_1, as in negative mode we do not know a way to distinguish these species.

Specimen:

  • GM2A - 799.54
  • BPIFB2 - 773.5258 (might be BMP)

Principle:

  • The most abundant fragment is a fatty acid [M-H]- ion.
  • The 152.9958 glycerophosphate fragment must be present.
  • If Lyso-PG fragment present with carbon count complementing the [M-H]- fatty acid score is higher.
  • Presence of 171.0064 headgroup fragment adds to the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PA_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Phosphatidylglycerol. At in vivo observed only in standard.

Principle:

  • The PG headgroup neutral loss (189.0402) is the fragment ion with the highest intensity?
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PC_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is a Phosphatidylcholine.

Specimen:

  • BPI - 804.57 and 776.545

Principle:

  • 168.0431 phosphate+choline-CH3 fragment must be present.
  • The highest abundant fragment must be a fatty acid [M-H]- fragment.
  • Lyso-PC fragments complementing the highest [M-H]- fatty acid increase the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PC_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Phosphatidylcholine.

Specimen:

  • BPI + 786.607

Principle:

  • The most abundant fragment must be choline+phosphate 184.0733.
  • The 86.0964 ethyl-trimetylammonium must be present.
  • The most abundant fatty acid can not have the same carbon count and unsaturation as the whole molecule (then it is Lyso-PC).
  • Fragments 104.1069, 124.9998, 60.0808 and 58.0651 increase the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PE_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is Phosphatidylethanolamine.

Specimen:

  • GM2A - 714.507 and 716.523

Principle:

  • The most abundant fragment is a fatty acid [M-H]- ion.
  • 140.0118 PE headgroup must be present.
  • Other headgroup ions 196.0380 and 178.0275 add to the score.
  • Lyso-PE and [M-H-CO2]- fatty acid fragments complementing the highest [M-H]- fatty acid increase the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PE_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Phosphatidylethanolamine.

Specimen:

  • in vivo BPI + 718.536
  • Lyso-PE: in vitro FABP1 + 454.29

Principle:

  • The PE headgroup neutral loss 141.0191 has the highest intensity.
  • If it is a Lyso-PE score will be zero.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PG_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is Phosphatidylglycerol. The result will be the same as bmp_neg_1, as in negative mode we do not know a way to distinguish these species.

Specimen:

  • GM2A - 799.54
  • BPIFB2 - 773.5258 (might be BMP)

Principle:

  • The most abundant fragment is a fatty acid [M-H]- ion.
  • The 152.9958 glycerophosphate fragment must be present.
  • If Lyso-PG fragment present with carbon count complementing the [M-H]- fatty acid score is higher.
  • Presence of 171.0064 headgroup fragment adds to the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PG_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Phosphatidylglycerol. At in vivo observed only in standard.

Principle:

  • The PG headgroup neutral loss (189.0402) is the fragment ion with the highest intensity?
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PI_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative MS2 spectrum is Phosphatidylinositol.

Specimen:

  • GM2A - 835.52

Principle:

  • Inositolphosphate-H2O fragment 241.0119, metaphosphate 78.9591 and headgroup fragment 152.9958 must be present.
  • Additional headgroup fragments 96.9696, 259.0224 and 297.0381 increase the score.
  • Presence of Lyso-PI fragments complementing other [M-H]- fatty acid fragments increase the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PI_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative MS2 spectrum is Phosphatidylinositol.

Specimen:

  • SEC14L2 + 906.60 and 882.6

Principle:

  • Combinations of fatty acid fragments must match the expected carbon count and unsaturation for PI.
  • Presence of neutral losses 259.0219 and 277.0563 adds to the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PS_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is a Phosphatidylserine.

Specimen:

  • ORP9 - 788.54

Principle:

  • The most abundant fragment is an [M-H]- fatty acid fragment.
  • Glycerophosphate fragment 152.9958 must be present.
  • Metaphosphate 78.9591 increases the score.
  • Serine-H2O neutral loss 87.0320 adds to the score.
  • Presence of Lyso-PS and Lyso-PA fragments complementing the highest [M-H]- fatty acid fragment increase the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.PS_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a Phosphatidylserine.

Specimen:

  • BPI + 790.56

Principle:

  • PS headgroup neutral loss 185.0089 must be the highest intensity.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.Scan(mzs, ionmode, precursor=None, intensities=None, ms1_records=None, scan_id=None, sample_id=None, source=None, deltart=None, logger=None, verbose=False, tolerance=None, ms1_tolerance=None, rt=None)[source]

Bases: lipyd.ms2.ScanBase

adduct(adduct, reset=False)[source]

Creates a copy of the current scan assuming that the precursor is a certain adduct. The precursor will be converted to [M+H]+ or [M-H]- adduct and neutral losses will be calculated accordingly.

adduct_annot(adduct=None)[source]

Gets the annotations for a certain adduct.

adduct_chain_list(adduct=None)[source]

Gets the chain list for a certain adduct.

adduct_data(name, adduct=None)[source]
annot_by_type(i, chain_type=None, frag_type=None, adduct=None)[source]

Returns the annotations matching certain types.

build_chain_list(rebuild=False)[source]
cer1p_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Ceramide-1-phosphate.

Specimen:

  • GLTPD1 - 616.47

Principle:

  • The most abundant fragment is 78.9591 metaphosphate.
  • If 96.9696 phosphate present adds to the score.
cer_fa_test(i_fa, i_sph, adduct=None)[source]
cer_neg_1()[source]

Examines if a negative mode MS2 spectrum is Ceramide.

Specimen:

  • SEC14L1 - 582.509

Principle:

  • A Ceramide backbone fragment must be among the 2 most abundant.
  • Ceramide backbone fragments lighter by N or C2N but same carbon
    count and unsaturation add to the score.
cerp_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Ceramide-1-phosphate. Gives similar result as Sphingosine-1-phosphate.

Specimen:

  • GLTPD1 - 616.47

Principle:

  • The most abundant fragment must be 78.9591 metaphosphate.
  • Presence of 96.9696 phosphate increase the score.
cerp_pos_1()[source]

Examines if a positive mode MS2 spectrum is a Ceramide-1-phosphate.

Specimen:

  • GLTPD1 + 728.59, 590.45, 702.58, 618.430, 616.415, 640.409

Principle:

  • A sphingosine fragment with double H2O loss must be among the three

highest abundant fragments.

chain_among_most_abundant(head=1, chain_type=None, frag_type=None, c=None, u=None, min_mass=None, skip_non_chains=False, adduct=None)[source]

Returns True if the defined type of chain fragment can be found among the most abundant fragments.

chain_combinations(rec, head=None, intensity_threshold=0, expected_intensities=None, no_intensity_check=False, frag_types=None, fragment_details=None, adduct=None)[source]

Finds all combinations of chain derived fragments matching the total carbon count and unsaturation in a database record.

Yields tuple of chains (lipproc.Chain objects).

Arguments not listed here explained at frags_for_positions.

Parameters:
  • rec (lipproc.LipidRecord) – The database record to match against.
  • no_intensity_check (bool) – Completely skip checking intensity ratios.
  • intensity_threshold (float) – Only fragments with intensities above this threshold will be considered. Intensities relative to the highest, between 0 and 1.
  • frag_types (tuple) – See at frags_for_positions.
chain_fragment_type_among_most_abundant(n=2, frag_type=None, chain_type=None, c=None, u=None, adduct=None)[source]

Tells if a particular type of aliphatic chain fragment can be found among the n highest intensity fragments.

Arguments passed to chain_fragment_type_is.

chain_fragment_type_is(i, frag_type=None, chain_type=None, c=None, u=None, return_annot=False, adduct=None)[source]

Tells if an aliphatic chain fragment is a specified type. The type should be the string representation of the fragment, e.g. FA-O for fatty acid minus oxygen fragments.

Returns bool or fragment annotations if return_annot = True.

Parameters:
  • i (int) – Index of the fragment.
  • return_annot (bool) – Return iterator with the matching fragment annotations.
chain_percent_of_most_abundant(percent, frag_type=None, chain_type=None, c=None, u=None, adduct=None)[source]

Tells if a certain chain present with an abundance at least the given percent of the most abundant fragment.

Parameters:percent (float) – Percentage, between 0 and 100.
chains_of_type(chain_type=None, frag_type=None, c=None, u=None, yield_annot=False, adduct=None)[source]

Iterates chain fragments matching certain criteria. Yields fragment indices or indices with annotations.

Parameters:yield_annot (bool) – Yield tuples of indices and annotations instead of indices only.
cu_by_type(i, chain_type=None, frag_type=None, adduct=None)[source]

Returns (carbon count, unsaturation) tuples for fragment i considering only the the requested chain types and fragment types.

cu_complete(chainsum, chain=None, c=None, u=None)[source]

Returns the carbon count and unsaturation needed to complete the chain or c and u to fit the chainsum.

Returns tuple of c and u.

first_record(headgroup, sub=(), adducts=None)[source]

Returns the first MS1 database record matching headgroup and subtype.

fragment_among_most_abundant(name, n=2, adduct=None)[source]

Tells if the fragment is among the top n.

fragment_by_name(name, adduct=None)[source]

Returns the index of a fragment by its name. Returns None if the fragment does not exist in the scan. Returns False if the fragment name could not be found in the database.

The lookup still goes by m/z, the name first looked up in the fragment database and the scan searched for the corresponding m/z. The name makes if obvious if this is a charged fragment or a neutral loss, hence it is not necessary to provide this information.

Parameters:name (str) – Fragment full name as used in the database 2nd column, e.g. PE [P+E] (140.0118).
fragment_percent_of_most_abundant(name, percent=80.0, adduct=None)[source]

Tells if a fragment has at least certain percent of intensity compared to the highest peak.

fragments_by_chain_type(head=None, frag_type=None, chain_type=None, c=None, u=None, adduct=None)[source]

Collects fragments matching a particular chain type. Yields indices. Arguments passed to chain_fragment_type_is.

frags_for_positions(rec, head=None, intensity_threshold=0, frag_types=None, adduct=None)[source]

Returns the possible fragments for each positions (sn1, sn2 in glycerophospholipids, sphingosine base and N-acyl in sphingolipids, etc).

Parameters:
  • head (int) – If None or numpy.inf all fragment ions will be considered, otherwise only the first most aboundant until the number head.
  • intensity_threshold (float) – Only fragments with intensities above this threshold will be considered. Intensities relative to the highest, between 0 and 1.
  • frag_types (tuple) – Limit the query to certain fragment types in addition to built in fragment constraints and other criteria. A tuple of tuples with fragment type names can be provided each for one position with None values where default fragment types should be used. E.g. ((‘FA_mH’, ‘Lyso_PA’), None) means the chain in first position might be found as fatty acid minus hydrogen fragment or lysophosphatidic acid fragment, while the second position could be anything allowed by the built in constraints.
classmethod from_mgf(fname, scan_id, ionmode, sample_id=None, precursor=None, mgf_charge=None, **kwargs)[source]
full_list_str()[source]

Returns list of fragments as single string.

get_intensity(mz)[source]

Returns the relative intensity of a fragment ion from its m/z. Value is None if m/z does not present.

get_most_abundant_chain(head=1, frag_type=None, chain_type=None, c=None, u=None, adduct=None)[source]

Looks up the most abundant fatty acid fragment of the given type. Returns the fragment index.

get_ms1_records(hg, subtype=None, sph=None, ether=None, oh=None, databases=None)[source]

Iterates MS1 records for a given type.

Yields tuples of record, adduct type and error in ppm

get_nl_intensity(nl, adduct=None)[source]

Returns the relative intensity of a neutral loss fragment ion. Value is None if neutral loss does not present.

has_chain_combination(record, head=None, intensity_threshold=None, expected_intensities=None, no_intensity_check=False, chain_param=(), adduct=None)[source]

Tells if a certain chain combination exists in the scan.

Arguments passed to matching_chain_combinations.

has_chain_combinations(rec, adduct=None, **kwargs)[source]

Calls chain_combinations only to check if at least one conbination explicitely confirmed.

has_chain_fragment_type(chain_type=None, frag_type=None, c=None, u=None, adduct=None)[source]

Tells if at least one fragment matches certain criteria. Arguments passed to chain_fragment_type_is.

has_fragment(name, adduct=None)[source]

Tells if a fragment exists in this scan by its name.

Returns bool or None if fragment name could not be found in the database.

has_mz(mz)[source]

Tells if an m/z exists in this scan.

has_nl(nl, adduct=None)[source]

Tells if a neutral loss exists in this scan.

hexcer_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Hexosyl-Ceramide.

Specimen:

  • GLTP - 744.5627

Principle:

  • Hexose fragments 71.0115, 89.0220 and 101.0219 must present.
hexceroh_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Hexosyl-Ceramide-OH (‘t’). This method is the same as hexcer_neg_1.

Specimen:

  • GLTP - 760.557

Principle:

  • Hexose fragments 71.0115, 89.0220 and 101.0219 must present.
highest_fragment_by_chain_type(head=None, frag_type=None, chain_type=None, c=None, u=None, adduct=None)[source]

Returns the highest instensity fragment matching a particular chain type. Returns fragment index or None if no such fragment exists.

Arguments passed to chain_fragment_type_is.

html_table()[source]
identify(adducts=None)[source]
intensity_ratios(intensities, frag_indices=None, expected=None, logbase=None)[source]

Tells if the ratio of a list of intensities fits the one in expected or is more or less even if expected is None.

Parameters:
  • intensities (list) – List of intensities.
  • expected (list) – List with expected intensity proportions. E.g. [1, 1, 2] means the third ion is twice higher intense than the 2 others.
  • logbase (int) – The fold difference tolerance when comparing intensities. E.g. if this is 2, then an almost twice less or more intense ion will considered to have similar intensity.
is_chain(i, adduct=None)[source]

Examines if a fragment has an aliphatic chain.

is_chain_type(i, typ='FA', adduct=None)[source]

Checks if a fragment might origin from a certain aliphatic chain type (e.g. FA – fatty acyl, FAL – fatty alkyl, Sph – sphingosin base).

is_fa(i, adduct=None)[source]

Tells if a fragment origins from a fatty acyl moiety.

is_fal(i, adduct=None)[source]

Tells if a fragment origins from a fatty alkyl moiety.

is_sph(i, adduct=None)[source]

Tells if a fragment origins from a shpingosin backbone.

is_type(i, typ, adduct=None)[source]

Tells if a fragment is a certain type.

iterrecords(adducts=None)[source]

Iterates MS1 records. Yields tuple of adduct type and record.

classmethod match_annot(annot, frag_type=None, chain_type=None, c=None, u=None)[source]

Tests a fragment annotation against criteria of fragment type, chain type, carbon count and unsaturation.

static match_chattr(value, accepted, typ=<class 'int'>)[source]
Parameters:
  • value (int) – The actual value.
  • accepted (int,set) – A single value or a set of values to match against. Negative match is possible by providing a tuple with False as it’s first element and the set of not acceptable values as the second element.
classmethod match_chtype(value, accepted)[source]

Matches strings or strings to set of strings, optionally negative. Calls match_chattr with typ = basestring.

matching_chain_combinations(record, head=None, intensity_threshold=None, expected_intensities=None, no_intensity_check=False, chain_param=(), adduct=None)[source]

Provides a way to see if specific chain combinations exist. The database record defines the chain layout of the molecule. Further arguments are passed to chain_combinations. The chain_param tuple contains dicts to match against chain fragments. All of these dicts must match at least one fragment identification. Only combinations matching all criteria yielded.

Parameters:
  • record (lipproc.LipidRecord) – A lipid database record matching the MS1 m/z.
  • head (int) – Consider only the n most intensive fragments.
  • intensity_threshold (float) – Consider only fragments with intensity higher than threshold. Relative to highest fragment, between 0 and 1.
  • expected_intensities – See at intensity_ratios.
  • no_intensity_check (bool) – Completely skip checking intensity ratios.
  • chain_param (tuple) – Tuple of dicts. Each dict contains criteria for one chain moiety. Keys can be chain_type, frag_type, c and u. These can be single str or int values or sets of multiple values. If omitted or None any value will pass the filter. An empty tuple which is the default value will pass through everything, this is equivalent with calling chain_combinations.
method_hg = {'fa_neg_1': ('FA', ())}
missing_chain(rec, missing_position=1, head=None, intensity_threshold=0, expected_intensities=None, no_intensity_check=False, frag_types=None, adduct=None)[source]

Finds ‘’missing’’ chains i.e. which could complement the chains identified among the fragments to fit the species in the record.

Yields tuples with first element a tuple of identified chains and as second element the missing chain.

Works a similar way to chain_combinations.

Parameters:missing_position (int) – Position of the missing chain. 0, 1, 2 are sn1, sn2 and sn3 positions on glycerol, 0 and 1 are sphingosine base and N-acyl in sphingolipids, respectively. By default is 1 (sn2 or N-acyl).
most_abundant_fragment_is(name, adduct=None)[source]

Tells if the fragment name is the highest abundant. Returns None if the fragment name could not be found in the database.

most_abundant_mz()[source]

Returns the m/z of the fragment with highest intensity.

most_abundant_mz_is(mz)[source]

Tells if the m/z with the highest intensity is mz. Returns None if the fragment name could not be found in the database.

mz_among_most_abundant(mz, n=2)[source]

Tells if an m/z is among the most aboundant n fragments in a spectrum.

Parameters:
  • mz (float) – The m/z value.
  • n (int) – The number of most abundant fragments considered.
mz_lookup(mz)[source]

Returns the index of the closest m/z value detected in the scan if it is within the range of tolerance, otherwise None.

mz_match(mz_detected, mz)[source]

Tests if two m/z’s can be accepted to be equal.

mz_most_abundant_fold(mz, fold)[source]

Tells if an m/z is the most abundant fragment and it has at least a certain fold higher intensity than any other fragment.

Parameters:
  • mz (float) – The m/z value.
  • fold (float) – The m/z must be this times higher than any other.
mz_percent_of_most_abundant(mz, percent=80.0)[source]

Tells if an m/z has at least certain percent of intensity compared to the most intensive fragment.

Parameters:
  • mz (float) – The m/z value.
  • percent (float) – The threshold in percent of the highest intensity.
nl(mz, adduct=None)[source]

For m/z returns the corresponding neutral loss m/z. If precursor ion mass is unknown returns numpy.nan.

nl_among_most_abundant(nl, n=2, adduct=None)[source]

Tells if a neutral loss corresponds to one of the most aboundant n fragments in a spectrum.

Parameters:
  • nl (float) – The mass of the neutral loss.
  • n (int) – The number of most abundant fragments considered.
nl_lookup(nl, adduct=None)[source]

Looks up if a neutral loss exists in this scan and returns its index.

positions_for_frag_type(record, frag_type)[source]

Returns the possible chain positions for a record and a fragment type.

print_scan()[source]

Prints the list of fragments as an annotated table.

records_by_type(headgroup, sub=(), adducts=None)[source]

Iterates MS1 database records with a certain headgroup and subtype.

reload()[source]
scan_str()[source]

Returns the scan table as string.

show()[source]

Prints the scan table to standard output.

sm_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Sphingomyeline.

Specimen:

  • GLTPD1 - 745.55

Principle:

  • Must have a neutral loss of CH3+COOH (60.0211).
  • Phosphate+choline-CH3 fragment 168.0431 must be present.
sph1p_neg_1()[source]

Examines if a negative mode MS2 spectrum is a Spingosine-1-phosphate.

Specimen:

  • Only observed in standard.

Principle:

  • Phosphate 78.9590 must be present.
class lipyd.ms2.ScanBase(mzs, ionmode, precursor=None, intensities=None, tolerance=None, scan_id=None)[source]

Bases: object

annotate()[source]

Annotates the fragments in the scan with identities provided by the fragment database.

get_annot(precursor=None, tolerance=None)[source]

Returns array of annotations. Makes it possible to use different precursor or tolerance.

normalize_intensities()[source]

Creates a vector of normalized intensities i.e. divides intensities by their maximum.

reload()[source]
sort(isort)[source]

Applies sorted indices to the scan.

sort_intensity()[source]

Sorts the scan by intensities descending.

sort_mz()[source]

Sorts the scan by m/z values ascending.

class lipyd.ms2.ScanDetails(sample_id, scan_id, source, deltart)

Bases: tuple

deltart

Alias for field number 3

sample_id

Alias for field number 0

scan_id

Alias for field number 1

source

Alias for field number 2

class lipyd.ms2.TAG_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a negative mode MS2 spectrum is a TAG.

Specimen:

  • We don’t have yet.

Principle:

  • Combination of fatty acid fragments must match the expected carbon count and unsaturation.

(Same as in positive ionmode.)

confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.TAG_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive mode MS2 spectrum is a TAG.

Specimen:

  • STARD11 + 818.7187

Principle:

  • Combination of fatty acid fragments must match the expected carbon count and unsaturation.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.VA_Negative(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive MS2 spectrum is vitamin A (retinol).

Specimen:

  • Standards 141020 negative scan 673

Principle:

  • 3 fragments seems to always present and be among the most abundant: 79.055, 119.087 and 255.212; presence of these is the main condition.
  • We also detected 125.061 in our standards which is special because contains 2 oxygens; presence of this increase the score.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.VA_Positive(record, scan, **kwargs)[source]

Bases: lipyd.ms2.AbstractMS2Identifier

Examines if a positive MS2 spectrum is vitamin A (retinol).

Specimen:

  • in vivo RBP1 + 269.2245
  • in vivo RBP4 + 269.2245

Principle:

  • The most abundant ion is the whole molecule m/z = 269.224.
  • Presence off 3 other ions adds to the score but not mandatory: 213.165, 145.1027, 157.1028.
confirm_class()[source]

In this base class pass through everything. Most of the subclasses should override this.

class lipyd.ms2.intensity_sorted(scan)[source]

Bases: object

class lipyd.ms2.mz_sorted(scan)[source]

Bases: object

lipyd.mz module

Module for arithmetics with m/z values and adduct ions.

class lipyd.mz.Mz(mz, z=1, sign=None, tolerance=0.01)[source]

Bases: object

Represents one m/z value. Provides methods for conversion to exact mass or various adducts. Other classes representing molecular entities and masses inherit these methods from here.

add_2h()[source]
add_3h()[source]
add_ac()[source]
add_fo()[source]
add_h()[source]
add_na()[source]
add_nh4()[source]
add_oh()[source]
adduct(m)[source]
reload()[source]
remove_ac()[source]
remove_fo()[source]
remove_h()[source]
remove_na()[source]
remove_nh4()[source]
remove_oh()[source]
weight()[source]

lipyd.mzml module

class lipyd.mzml.Reader(fname)[source]

Bases: object

read_mzml()[source]

lipyd.name module

class lipyd.name.LipidNameProcessor(database='swisslipids', with_alcohols=True, with_coa=True, iso=False)[source]

Bases: object

classmethod attr_proc(match, u=None)[source]
attrs_types(cc1, chainsexp)[source]
carbon_counts(name, ccexp=2, chainsexp=None, sphingo=False, iso=False, types=None)[source]

Processes carbon and unsaturation counts from name.

Parameters:
  • name (str) – Lipid name.
  • ccexp (int) – Expected number of fatty acyl or other residues constaining aliphatic chain. E.g. for DAG this should be 2 and for TAG 3 as the latter has 3 fatty acyls.
  • chainsexp (tuple) – The type of the expected chains, e.g. (‘Sph’, ‘FA’) for one sphingosine and a fatty acyl. This matters only if the chain types can not be inferred from the processed names.
  • sphingo (bool) – Is this a sphingolipid, is the first chain a sphingosine base?
  • iso (bool) – Process conformation isomer details for example 18:2(9E,11Z).
  • types (tuple) – Explicit types for each chains.
fa_greek_cc(name)[source]
gen_fa_greek()[source]

Generates a list of greek fatty acid names with their carbon counts and unsaturations.

static get_type(i, sphingo=False, ether=False, types=None, chainsexp=None)[source]
static has_sph_prefix(match)[source]
headgroup_from_lipid_name(names, database=None)[source]

For one database record attempts to identify the lipid class by looking up keywords. Calls greek name identification, greek fatty acid names are identified as ‘FA’.

Returns tuple of lipproc.Headgroup object and expected chain types.

static is_ether(match)[source]
isomeric_carbon_counts(name, ccexp=2, sphingo=False, types=None)[source]

Calls carbon_counts with iso=True.

process(names, database=None)[source]

The main method of this class. Processes a lipid name string and returns a standard name, prefix, carbon counts and unsaturations.

Parameters:names (list) – One or more names to process. Single result will be returned and names will be attempted to be processed one after the other until processing is successful.
static process_db_keywords(kwdstr)[source]
process_fa_name(name)[source]

Identifies fatty acids based on their greek name.

read_lipid_names(add_fa=True)[source]

Reads annotations for lipid classes: - full names - short notations - database keywords (to process long names from SwissLipids and LipidMaps) - most abundant adducts

The input file is given by the lipnamesf attribute.

reload(children=False)[source]
test_branched(name)[source]

Tells if a lipid might contain branched aliphatic chains.

lipyd.plot module

class lipyd.plot.SpectrumPlot(mzs, intensities, annotations=None, xmin=None, xmax=None, title=None)[source]

Bases: object

annotate()[source]
annotate_distance(x2=0, y_pos=0, text='', raw_values=None, rotate_text=0)[source]

Annotage the distance between two peaks

Annotate the distance between two given peaks. The text can be placed with a given angle.

x1 (float):
m/z value (x-coordinate) of the left point
x2 (float):
m/z value (x-coordinate) of the right point
y_pos (Optional[float]):
Position of the label beginning (y-coordinate). The value uses the scale of the datapoints.
text (str):
Label text
raw_values (Pandas.DataFrame):
Data values, which should be annotated
rotate_text (Optional[int]):
Rotation of the label, should be 0 or 90
annotate_point(y_pos=0, text='', raw_values=None)[source]

Annotate a specific point.

Annotate a point with a label. The label will be placed vertically with an additional line.

The function uses the data values and searches for the peak of the value to be annotated. Therefore the raw_values parameter is used

x1 (float):
m/z value (x-coordinate) of the point, to be annotated
y_pos (Optional[float]):
Position of the label beginning (y-coordinate). The value uses the scale of the datapoints.
text (str):
Label text
raw_values (Pandas.DataFrame):
Data values, which should be annotated
build()[source]
figdpi = 72

int: DPI of the image output file

filetype = 'pdf'

str: Filetype of the outputfile

Tested with “pdf” and “png”

generate_massspectra_plot_automatic_labels(output_filename)[source]
generate_massspectra_two_plot_manual_annotation(input_filename2, output_filename)[source]
normalize_intensities()[source]
params = {'axes.labelsize': 10, 'axes.linewidth': 0.5, 'backend': 'pdf', 'figure.dpi': 72, 'font.family': 'serif', 'font.size': 10, 'legend.fontsize': 8, 'legend.frameon': True, 'text.latex.unicode': True, 'text.usetex': True, 'xtick.direction': 'out', 'xtick.labelsize': 8, 'xtick.major.size': 4, 'xtick.minor.size': 2, 'ytick.direction': 'out', 'ytick.labelsize': 8, 'ytick.major.size': 4, 'ytick.minor.size': 2}
reload()[source]

lipyd.progress module

class lipyd.progress.Progress(total=None, name='Progress', interval=None, percent=True, status='initializing', done=0, init=True, unit='it')[source]

Bases: object

Before I had my custom progressbar here. Now it is a wrapper around the great progressbar tqdm. Old implementation moved to OldProgress class.

get_desc()[source]

Returns a formatted string of the description, consisted of the name and the status. The name supposed something constant within the life of the progressbar, while the status is there to give information about the current stage of the task.

init_tqdm()[source]
reload()[source]
set_done(done)[source]

Sets the position of the progress bar.

set_status(status)[source]

Changes the prefix of the progressbar.

set_total(total)[source]

Changes the total value of the progress bar.

step(step=1, msg=None, status='busy', force=False)[source]

Updates the progressbar by the desired number of steps.

Parameters:step (int) – Number of steps or items.
terminate(status='finished')[source]

Terminates the progressbar and destroys the tqdm object.

class lipyd.progress.OldProgress(total=None, name='Progress', interval=3000, percent=True, status='initializing')[source]

Bases: object

in_ipython()[source]
set_done(done)[source]
set_status(status)[source]
set_total(total)[source]
step(step=1, msg=None, status='working on it', force=False)[source]
terminate(status='finished')[source]

lipyd.results module

class lipyd.results.Results[source]

Bases: object

auto_df(screen_name='E')[source]

Compiles a data frame in the same format as manual_df just from the programmatic results.

bubble_altair(classes=['I', 'II'], subtitle='', main_title='')[source]
bubble_plotly(classes=['I', 'II'], subtitle='', main_title='')[source]
static export_df(df, fname, **kwargs)[source]

Exports the results from a pandas.DataFrame to csv.

headgroups_cross_screening(label1='Screen1', label2='Screen2', idlevels={'I'}, outfile='headgroups_%s_%s.tab')[source]

Does a quick comparison at headgroup/protein level between 2 screenings.

manual_df(screen='A', only_swl_col=False)[source]

Creates a pandas dataframe from manual results.

piecharts_plotly(by_class=True, main_title='Lipid classes by protein', result_classes={'I'})[source]

Plots piecharts of detected lipids for each protein based on manually annotated results. Uses plotly, output accessible in Jupyter notebook.

read_manual()[source]

Reads adequate columns from manually annotated tables. Provides data in Screening().manual attribute.

read_manual2(fname='All_results_v04.xlsx')[source]

Reads manually annotated results from Marco’s final table.

lipyd.sample module

class lipyd.sample.FeatureAttributes(ionmode=None, attrs=None, **kwargs)[source]

Bases: lipyd.sample.FeatureBase

charges()[source]

Returns a set of ion charges observed in the sample(set).

class lipyd.sample.FeatureBase(sorter=None, **kwargs)[source]

Bases: object

feature_data(i, variables=None)[source]

For a feature returns the requested attributes.

Parameters:variables (list) – Names of the variables.
filter(idx, negative=False, propagate=True)[source]

Filters features at indices in idx.

Parameters:
  • idx (list,np.array) – A list or array of inidices along axis 0.
  • negative (bool) – Drop the features at indices instead of keeping them and removing all others.
  • propagate (bool) – Perform filtering on all object bound to the same sorter. This is to avoid propagation in loops.
filter_selection(selection, negative=False)[source]

Takes a FeatureSelection object and applies it as a filter i.e. removes features where it is False.

reload()[source]
sort_all(by=None, desc=False, resort=False, propagate=True, return_isort=False, indices=())[source]

Sorts all data arrays according to an index array or values in one of the data arrays.

Parameters:
  • by (np.ndarray,str) – Either an array of indices or the attribute name of any data array of the object.
  • propagate (bool) – Whether to propagate the sorting to bound objects. This is to avoid loops of sorting.
  • return_isort (bool) – Return the argsort vector. A vector of indices which can be used to apply the same sorting on other arrays.
threshold_filter(var, threshold, op=<built-in function gt>)[source]

Filters the features by any numeric attribute by simply applying a threshold. If the attribute does not exist silently does nothing.

Parameters:
  • var (str) – Name of the attribute.
  • threshold (float) – Value of the threshold.
  • op (operator) – The operator to use. By default operator.gt (greater than), which means the features having attribute value greatre than the threshold will be kept and all others removed.
threshold_select(var, threshold, op=<built-in function gt>)[source]

Returns boolean vector by applying an operator on a variable and a threshold.

class lipyd.sample.FeatureIdx(length)[source]

Bases: lipyd.sample.FeatureBase

acurrent(ao)[source]

For a vector of original indices ao returns a vector of corresponding current indices.

Parameters:ao (int) – Vector of original indices.
aoriginal(co)[source]

For a vector of current indices co returns a vector of corresponding original indices.

Parameters:co (int) – Vector of current indices.
convert(other)[source]

Converts from the ordering of an other FeatureIdx instance to the ordering of this one.

current(o)[source]

Tells the current index for the original index o.

Parameters:o (int) – An original index.
original(c)[source]

Tells the original index for the current index c.

Parameters:c (int) – An index in the current ordering.
register(sortable)[source]

Binds a sortable object of the same length to this one hence all sorting operations will be applied also to this object. Sortables clients assumed to share the same original indices. It means should have the same ordering at time of registration.

sort_all(by=None, origin=None)[source]

Applies custom sort to the object if by is an index array. If by is None, it sorts by the original indices, which means the restoration of the original order. It calls sort_all by the same argsort on all registered clients hence propagating the sorting. But omits the client if the sort request originates from it in order to avoid infinite sorting loops. Clients don’t propagate further the sorting request also to avoid loops. In summary, this method is called either from outside and then it applies a sorting to all object of the system (if called without by restores the original order); or called by the sort_all method of one of the clients propagating the sorting to this object and to all other clients.

unregister(id_sortable)[source]

Removes an object from the list of clients and also makes it forget about this object to be its sorter. Simply it makes the this object and the client independent.

Parameters:id_sortable (int,sortable) – Either the id of a client or the object itself.
class lipyd.sample.FeatureSelection(samples, selection)[source]

Bases: lipyd.sample.FeatureBase

negative
class lipyd.sample.Sample(mzs, ionmode=None, intensities=None, rts=None, attrs=None, feature_attrs=None, sorter=None, ms2_format='mgf', ms2_param=None, silent=False, sample_id=None, sample_id_proc=None, sample_id_proc_method=None, sample_id_proc_names=None, attr_args=None, **kwargs)[source]

Bases: lipyd.sample.FeatureBase

apply(method, name, variables=None, feature_attrs=None, **kwargs)[source]

Applies a method on each of the features and creates a new variable from the results.

Parameters:
  • method (callable) – The method to apply.
  • name (str) – The name for the new variable.
  • variables (list) – List of variables to be passed to the method.
  • feature_attrs (list) – List of variables in the FeatureAttributes object.
  • **kwargs

    Passed to method.

basic_filters(quality_min=0.2, charge=1, rt_min=1.0, intensity_min=10000.0)[source]

Performs 4 trivial filtering steps which discard a large number of features at the beginning of the analysis. It removes the features with quality lower than 0.2, non single charge, retention time lower than 1 minute or total intensity lower than 10,000. Different threshold values can be provided to this method.

charge_filter(charge=1)[source]

Keeps only the features with the preferred charge. Does not care about sign.

collect_mgf(sample_id=None, attrs=None)[source]

Collects MGF files containing the MS2 spectra.

Parameters:attrs (dict) – A dict with attributes necessary to find the appropriate MGF files.
collect_ms2(sample_id=None, attrs=None)[source]

Collects the MS2 scans belonging to this sample.

The collected resources returned as dict which can be passed to ms2.MS2Feature.

collect_mzml(attrs=None)[source]
database_lookup(database_args=None, reinit_db=False, adduct_constraints=True, charge=None, tolerance=None)[source]

Performs database lookups of all m/z’s.

Creates an array variable named records in the FeatureAttributes object (feattrs) with the records retrieved from the database.

export_table(fname, **kwargs)[source]
feature_data(i, variables=None, feature_attrs=None)[source]

For a feature returns the requested attributes.

Parameters:
  • variables (list) – Names of the variables.
  • feature_attrs (list) – Names of variables in the FeatureAttributes object.
get_database_records(i, database=None, adduct=None)[source]

Yields database records for one feature, optionally only records of certain adduct or database.

intensity_filter(threshold=10000.0)[source]

Removes the features with total intensities across samples lower than the threshold.

Works by the total_intensities attribute.

ms2_analysis(resources=None)[source]

Runs MS2 identification methods on all features.

ms2_collection_methods = {'mgf': 'collect_mgf', 'mzml': 'collect_mzml'}
ms2_identify()[source]
process(basic_filters=True, database_lookup=True, ms2_analysis=True, basic_filters_args=None, database_lookup_args=None, ms2_analysis_args=None)[source]

This method implements the workflow of processing the samples. At the moment it does trivial filtering (see basic_filters), performs database lookups (see database_lookup) and analyses the MS2 data (see ms2_analysis).

quality_filter(threshold=0.2)[source]

If the features has an attribute named quality it removes the ones with quality below the threshold.

reload()[source]
rt_filter(threshold=1.0)[source]

Removes the features with mean retention time below the threshold. Works only if the features has an attribute named rt_means.

select(method=None, variables=None, feature_atts=None, threshold=None, negative=False, op=<built-in function gt>, **kwargs)[source]

Selects a subset of the features. Returns FeatureSelection object.

If method is callable, applies it to the variables in variables and feature_attrs and selects based on threshold and negative. If method is None and a variable name provided in variables or feature_attrs then uses this variable to provide a selection.

Parameters:
  • method (callable) – Method to be applied to obtain a new variable which will be the basis of the selection.
  • variables (list,str) – Eiter a list of variables (to be passed to method) or one variable name which will be the basis of the selection.
  • feature_attrs (list,str) – Like variables but refers to variables in the FeatureAttributes object.
  • threshold (float) – A threshold value for the filter.
  • negative (bool) – Apply negative selection (selection vector is False where) method returns True.
  • op (operator) – Operator to apply between variable and threshold.
set_ms2_sources(attrs=None)[source]

Collects the MS2 scans belonging to this sample.

The collected resources will be in the ms2_source attribute.

sort_all(by='mzs', desc=False, resort=False, propagate=True, return_isort=False)[source]

Sorts all data arrays according to an index array or values in one of the data arrays.

Parameters:
  • by (np.ndarray,str) – Either an array of indices or the attribute name of any data array of the object.
  • desc (bool) – Sort descending. Applies only if by is the attribute name of a data array.
  • resort (bool) – Sort even if the object is already sorted according to the value stored in sorted_by.
  • propagate (bool) – Whether to propagate the sorting to bound objects. This is to avoid loops of sorting.
  • return_isort (bool) – Return the argsort vector. A vector of indices which can be used to apply the same sorting on other arrays.
table(variables=None, headers=None)[source]

Returns results as a header and a table as list of lists.

class lipyd.sample.SampleReader(input_type, ionmode=None, **kwargs)[source]

Bases: object

get_attributes()[source]

Returns lipyd.sample.FeatureAttributes object. This object contains variables describing series of features across all samples. E.g. Quality, significance, mean RT, centroid m/z, etc

get_samples(bind=True, sample_args=None)[source]

Yields lipyd.sample.Sample objects for each sample read.

To extract all data from PeaksReader the get_sampleset method is more convenient.

Parameters:bind (bool) – Bind samples to each other. This way they will sort together, i.e. if any of them is sorted all the others follow the same order.
get_sampleset(sampleset_args=None)[source]

Returns a SampleSet and a FeatureAttributes object.

read()[source]
reader_classes = {'peaks': <class 'lipyd.reader.peaks.PeaksReader'>}
reload()[source]
class lipyd.sample.SampleSet(mzs, ionmode=None, intensities=None, rts=None, attrs=None, feature_attrs=None, sorter=None, ms2_format='mgf', ms2_param=None, sample_ids=None, sample_id_proc=None, sample_id_proc_method=None, sample_id_proc_names=None, sample_data=None)[source]

Bases: lipyd.sample.Sample, lipyd.sampleattrs.SampleSorter

collect_ms2(attrs=None)[source]

Collects the MS2 resources for each sample a similar way as the same method does in Sample.

classmethod combine_samples(attrs, samples, **kwargs)[source]

Initializes the object by combining a series of Sample objects.

All samples must be of the same length and have the same ordering. It means the corresponding elements must belong to the same feature. The FeatureAttributes and the sorter (FeatureIdx) will be used from the first sample.

get_sample(i)[source]

Returns the i``th sample as a ``Sample object.

get_sample_attrs(i)[source]

Returns the sample attributes (dict of metadata) of the ``i``th sample in the set.

get_sample_data(**kwargs)[source]

Returns a SampleData object which stores any data about the samples.

Parameters:**kwargs (numpy.ndarray) –

One or more arrays with same their first dimension in agreement with the number of samples.

get_selection(selection)[source]

Returns a SampleSelection object which is a binary selection of some of the samples in the set.

Parameters:selection (list,numpy.ndarray) – Either a list of sample IDs to be selected or a boolean array with the length corresponding to the number of samples.
numof_samples
peak_size_filter(backg, prot, threshold=2)[source]
set_ms2_sources(attrs=None)[source]

Collects the MS2 scans for all samples.

The collected resources will be in the ms2_source attribute.

lipyd.sampleattrs module

class lipyd.sampleattrs.SECProfile(sec_path, start_volume=0.6, size=0.15, start_row=None, start_col=None, length=None, sample_id_method=None, offsets=None, samples=None, sample_data=None, sample_ids=None, sample_id_proc=None, sample_id_proc_method=None, sample_id_proc_names=None, **kwargs)[source]

Bases: lipyd.sampleattrs.SampleData

protein_containing_samples(threshold=0.33, threshold_absolute=False, manual=None, include=None, exclude=None)[source]

Returns a SampleSelection object with the protein containing fractions selected. In addition protein containing samples can be selected manually overriding the evaluation of the SEC profile. This might be useful if the peak was not clear. Additionally samples can be included or excluded, this might be useful if certain fractions are wrong and should not be considered.

read_sec(offset=None)[source]
class lipyd.sampleattrs.SampleAttrs(sample_id=None, attrs=None, proc=None, proc_method=None, proc_names=None)[source]

Bases: object

class lipyd.sampleattrs.SampleData(samples=None, sample_ids=None, sample_data=None, sample_id_proc=None, sample_id_proc_method=None, sample_id_proc_names=None, **kwargs)[source]

Bases: lipyd.sampleattrs.SampleSorter

class lipyd.sampleattrs.SampleSelection(selection, samples=None, sample_ids=None, sample_data=None, sample_id_proc=None, sample_id_proc_method=None, sample_id_proc_names=None, **kwargs)[source]

Bases: lipyd.sampleattrs.SampleData

logical_and(other)[source]

Returns a SampleSelection object with samples selected in both this object and the other.

Parameters:other (SampleSelection) – An other SampleSelection object.
logical_not()[source]

Returns the inverse of the selection.

logical_or(other)[source]

Returns a SampleSelection object with samples selected in either this object or the other.

Parameters:other (SampleSelection) – An other SampleSelection object.
sample_ids_selected()[source]

Returns a list IDs of selected samples.

class lipyd.sampleattrs.SampleSetAttrs(sample_ids=None, attrs=None, proc=None, proc_method=None, proc_names=None, length=None)[source]

Bases: object

argsort_by_sample_id(sample_ids)[source]

Returns an index array which sorts the sample attributes according to the list of sample IDs provided.

Parameters:sample_ids (list) – A list of sample IDs, e.g. [('A', 1), ('A', 2), ...].
get_sample_id(i)[source]

Returns the ID of a sample by its index.

get_sample_index(sample_id)[source]

Returns the index of a sample by its ID.

sort_by(other, return_idx=False)[source]

Sorts the sample attributes according to an other SampleSetAttrs object. The other object must have the same sample IDs.

Parameters:
  • other (SampleSetAttrs) – An other SampleSetAttrs with the same sample IDs.
  • return_idx (bool) – Return the index array corresponding to the sort.
sort_by_index(idx)[source]
sort_by_sample_id(sample_ids, return_idx=False)[source]

Sets the order of the sample attributes according to the list of sample IDs provided.

Parameters:
  • sample_ids (list) – A list of sample IDs, e.g. [('A', 1), ('A', 2), ...].
  • return_idx (bool) – Return the index array corresponding to the sort.
class lipyd.sampleattrs.SampleSorter(sample_data=None, sample_ids=None, sample_id_proc=None, sample_id_proc_method=None, sample_id_proc_names=None, sample_axis=0, attr_args=None)[source]

Bases: object

get_selection(selection=None, **kwargs)[source]

Returns a SampleSelection object with samples corresponding to the samples in this object.

Parameters:
  • selection (list,numpy.ndarray) – A list of sample IDs or a boolean array with the same length as the number of samples.
  • **kwargs

    Arguments passed to make_selection if selection not provided.

id_next(i)[source]

An index or sample ID provided it returns the ID of the sample following in the series. Returns None if the first sample is queried.

id_previous(i)[source]

An index or sample ID provided it returns the ID of the sample preceding in the series. Returns None if the first sample is queried.

index_next(i)[source]

An index or sample ID provided it returns the index of the sample following in the series. Returns None if the first sample is queried.

index_previous(i)[source]

An index or sample ID provided it returns the index of the sample preceding in the series. Returns None if the first sample is queried.

make_selection(manual=None, include=None, exclude=None, logic='AND', **kwargs)[source]

Creates a boolean array based on the filters and criteria provided. First the manual selection is evaluated, then the methods provided in **kwargs, after the samples in include added and finally those in exclude removed from the selection.

Parameters:**kwargs

Variable names and methods or boolean arrays. If boolean arrays provided these will be used to select the samples. Methods will be applied to each element of the variable in the slot to obtain a boolean array. E.g. profile = lambda x: x > 0.3 will be True for values in the profile array above 0.3.

register(s)[source]

Registers a sample.SampleSet or feature.SampleData derived object ensuring it will keep the same order of samples.

Parameters:s (SampleSet,SampleData) – A sample.SampleSet or feature.SampleData derived object.
sort(idx, _done=None)[source]

Sorts all connected objects by indices.

Parameters:
  • idx (list) – A list of indices.
  • _done (set) – As the sorting propagates across objects this set keeps track which objects have been already sorted. Should be None when called by user.
sort_by(s)[source]

Sorts the current object according to another SampleSorter derived object.

Parameters:s (SampleSorter) – A SampleSorter derived object such as sample.SampleSet, feature.SampleData etc.
sort_by_sample_ids(sample_ids)[source]

Sorts all connected objects by a list of sample IDs.

Parameters:
  • sample_ids (list) – A list of sample ids in the desired order, e.g. [('A', 1), ('A', 2), ...].
  • process (bool) – Use the sample_id_processor methods to convert the sample IDs provided.
sort_to(s)[source]

Makes sure object s has the same ordering as all in this sorter.

Parameters:s (SampleSorter) – A SampleSorter derived object such as sample.SampleSet, feature.SampleData etc.
lipyd.sampleattrs.plate_sample_id_processor()[source]

Returns a sample ID processor which makes sure samples are represented by a tuple of one uppercase letter and an integer. This is convenient if samples correspond to wells on a plate.

lipyd.sampleattrs.sample_id_processor(method=None, *args)[source]

Creates a custom sample identifier class.

Parameters:
  • method (callable) – A method which takes a single argument corresponding to the raw sample ID and returns a custom number of values.
  • *args (str) –

    Names for the attributes representing the sample ID. These should correspond to the values returned by method.

lipyd.sdf module

class lipyd.sdf.SdfReader(fp, names=None, annots=None, silent=False)[source]

Bases: object

annots_default = {'EXACT_MASS', 'FORMULA'}
static get_mol(record)[source]

Returns structure as a string in mol format.

get_obmol(name, typ, use_mol=False)[source]

Returns generator yielding pybel.Molecule instances for name.

Parameters:
  • name (str) – Molecule name or ID.
  • typ (str) – Type of the name or identifier.
  • use_mol (bool) – Process structures from mol format. By default structures are processed from InChI.
get_record(name, typ)[source]

Retrieves all records matching name.

Returns list of records or empty list if none found. Each record is a dict of processed values from the sdf file.

Parameters:
  • name (str) – Molecule name or identifier.
  • typ (str) – Type of name or identifier. These are the attribute names of the index dicts which are taken from the values in the names dict.
index()[source]
index_info()[source]

Prints number of records indexed and name of the source file.

iter_obmol()[source]

Iterates all structures in the file and yields pybel.Molecule objects.

iter_records()[source]

Iterates over all records in the sdf file.

names_default = {'CHEBI_ID': 'chebi', 'COMMON_NAME': 'commname', 'INCHI': 'inchi', 'INCHIKEY': 'inchikey', 'PUBCHEM_CID': 'pubchem', 'SYNONYMS': 'synonym', 'SYSTEMATIC_NAME': 'sysname'}
read(index_only=True, one_record=False, go_to=0)[source]

Performs all reading operations on the sdf file.

This method is able to read the entire file, scan the file and build an index of records, and retrieve one record.

Parameters:
  • index_only (bool) – Do not read the file but only build an index.
  • one_record (bool) – Read only one record.
  • go_to (int) – Go to this byte offset in the file and start reading there.
record_to_obmol(record)[source]

Processes a record to pybel.Molecule object.

record_to_obmol_mol(record)[source]
reload()[source]
write_mol(name, typ, outf=None, return_data=False)[source]

Writes a record into file in mol format.

lipyd.sec module

class lipyd.sec.Fraction(row, col, start, end, mean)

Bases: tuple

col

Alias for field number 1

end

Alias for field number 3

mean

Alias for field number 4

row

Alias for field number 0

start

Alias for field number 2

class lipyd.sec.SECReader(path)[source]

Bases: object

auto_fractions(start_volume=0.6, size=0.15, start_row='A', start_col=5, length=9)[source]

Autogenerates fraction volume boundaries according to the parameters provided.

fraction_mean(frac)[source]

Returns the mean absorbance from a fraction.

get_fraction(frac)[source]

Returns absorbances measured within a fraction.

guess_format()[source]
profile(**kwargs)[source]

Iterates fractions with their mean absorbance values.

Parameters:**kwargs

Arguments passed to auto_fractions (if necessary).

read()[source]
read_asc()[source]

Reads SEC UV absorbance profile from asc file output produced by the Unicorn software from GE Healthcare.

read_xls()[source]

Reads SEC UV absorbance profile from MS Excel XLS file output produced by ???.

reload(children=False)[source]

lipyd.session module

class lipyd.session.Session(label=None, log_verbosity=0)[source]

Bases: object

static gen_session_id(length=5)[source]
start_logger()[source]
lipyd.session.get_log()[source]
lipyd.session.get_session()[source]
lipyd.session.new_session(label=None, log_verbosity=0)[source]

lipyd.settings module

lipyd.settings.get(param)[source]
lipyd.settings.get_default(param)[source]
lipyd.settings.reset(param)[source]
lipyd.settings.reset_all()[source]
lipyd.settings.settings

alias of lipyd.settings.Settings

lipyd.settings.setup(**kwargs)[source]

lipyd.substituent module

class lipyd.substituent.DihydroSphingosine(c=None, u=None, counts=None, **kwargs)[source]

Bases: lipyd.substituent.Sphingosine

class lipyd.substituent.FattyAcyl(c=None, u=None, counts=None, **kwargs)[source]

Bases: lipyd.metabolite.AbstractSubstituent

class lipyd.substituent.FattyAlkoxy(c=(2, 36), u=(0, 10), counts=None, **kwargs)[source]

Bases: lipyd.metabolite.AbstractSubstituent

class lipyd.substituent.HydroxyFattyAcyl(c=None, u=None, counts=None, **kwargs)[source]

Bases: lipyd.metabolite.AbstractSubstituent

class lipyd.substituent.HydroxySphingosine(c=None, u=None, counts=None, **kwargs)[source]

Bases: lipyd.substituent.Sphingosine

class lipyd.substituent.Sphingosine(c=None, u=None, counts=None, lcb_type='d', **kwargs)[source]

Bases: lipyd.metabolite.AbstractSubstituent

get_prefix()[source]

Module contents