def __init__(self, c=None, u=None, fa_counts=None, getname=None, sub=(), **kwargs): def _getname(parent, subs): """ Parameters ---------- parent : subs : Returns ------- """ return '%s(%u:%u)' % (parent.name, subs[0].c, subs[0].u) metabolite.AbstractMetabolite.__init__( self, core='OH', subs=[substituent.FattyAcyl(c=c, u=u, counts=fa_counts)], name='FA', hg=lipproc.Headgroup(main='FA', sub=()), getname=getname or _getname, **kwargs)
def __init__(self, c=None, u=None, fa_counts=None, getname=None, sub=(), **kwargs): def _getname(parent, subs): return '%s(%u:%u)' % (parent.name, subs[0].c, subs[0].u) metabolite.AbstractMetabolite.__init__( self, core='C19OH31', subs=[substituent.FattyAcyl(c=c, u=u, counts=fa_counts)], name='SE', hg=lipproc.Headgroup(main='SE', sub=()), getname=getname or _getname, **kwargs, )
def __init__(self, core='', sph_args=None, fa_args=None, o='H', lyso=False, fa_hydroxy=False, lcb_type='d', name='Cer', hg=None, getname=None, **kwargs): sph_args = sph_args or {} fa_args = fa_args or {} if lyso: fa = 'H' elif fa_hydroxy: fa = substituent.HydroxyFattyAcyl(**fa_args) else: fa = substituent.FattyAcyl(**fa_args) self.fa_hydroxy = fa_hydroxy hg = hg or lipproc.Headgroup(main='Cer') AbstractSphingolipid.__init__(self, o=o, n=fa, sph_args=sph_args, name=name, getname=getname, lcb_type=lcb_type, hg=hg, **kwargs)
def _get_substituent(self, sub, args=None): args = args or {} return (substituent.FattyAcyl( **args) if not sub else self.get_substituent(sub))
[(m.formula, m.mass) for m in halo_methanes][:3] # Do the same with all alcohols up to 1-8 carbon count with 0-2 unsaturated bonds: # In[34]: chain = metabolite.AbstractSubstituent(c=(1, 8), u=(0, 2)) alcohols = metabolite.AbstractMetabolite(subs=(chain, ('OH', ))) [(m.formula, m.mass) for m in alcohols][:3] # Make some ceramides: # In[9]: # fatty acyls of length 16, 18 or 20 and one or no unsaturation: fattyacyl = substituent.FattyAcyl(c=(16, 18, 20), u=(0, 1)) lcb = substituent.Sphingosine(c=18, u=1) ceramides = metabolite.AbstractMetabolite(core='H', subs=(lcb, fattyacyl), name='Cer') # name, formula, mass, [M+H]+, [M+NH4]+ [(cer.name, cer.formula, cer.mass, cer.add_nh4()) for cer in ceramides] # ## 4: Lipid definitions # In the `lipyd.lipid` module more than 150 lipid varieties are predefined. # In[11]: from lipyd import lipid