Package de.isas.lipidomics.domain
Class LipidSpecies
- java.lang.Object
-
- de.isas.lipidomics.domain.LipidSpecies
-
- Direct Known Subclasses:
LipidMolecularSubspecies
public class LipidSpecies extends Object
A lipid species is the factual root of the object hierarchy. Lipid category and class are used as taxonomic roots of a lipid species. Partial structural knowledge, apart from the head group, is first encoded in the lipid species. A typical lipid species is PC 32:0 (SwissLipids SLM:000056493), where the head group is defined as PC (Glycerophosphocholines), with fatty acyl chains of unknown individual composition, but known total composition (32 carbon atoms, zero double bonds, no hydroxylations).- Author:
- nils.hoffmann
- See Also:
LipidCategory
,LipidClass
,LipidMolecularSubspecies
,LipidStructuralSubspecies
,LipidIsomericSubspecies
-
-
Field Summary
Fields Modifier and Type Field Description protected LipidSpeciesInfo
info
static LipidSpecies
NONE
-
Constructor Summary
Constructors Constructor Description LipidSpecies(HeadGroup headGroup)
Create a lipid species using the provided head group and a lipid species infoLipidSpeciesInfo.NONE
.LipidSpecies(HeadGroup headGroup, Optional<LipidSpeciesInfo> lipidSpeciesInfo)
Create a lipid species from a head group and an optionalLipidSpeciesInfo
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
buildLipidString(LipidLevel level, String headGroup, boolean isNormalized)
protected StringBuilder
buildSpeciesHeadGroupString(String headGroup, boolean normalizeHeadGroup)
ElementTable
getElements()
Returns the element count table for this lipid.Map<String,FattyAcid>
getFa()
Returns the fatty acyls registered for this lipid.LipidSpeciesInfo
getInfo()
Returns theLipidSpeciesInfo
for this lipid.LipidCategory
getLipidCategory()
LipidClass
getLipidClass()
String
getLipidString()
Returns a lipid string representation for theLipidLevel
, e.g.String
getLipidString(LipidLevel level)
Returns a lipid string representation for the givenLipidLevel
, e.g.String
getLipidString(LipidLevel level, boolean normalizeHeadGroup)
Returns a lipid string representation for the givenLipidLevel
, e.g.String
getNormalizedHeadGroup()
Returns a lipid string representation for the head group of this lipid.String
getNormalizedLipidString()
Returns a lipid string representation for the nativeLipidLevel
, e.g.boolean
isEtherLipid()
Returns true, if the head group ends with ' O' or if the lipid fa bond type is eitherLipidFaBondType.ETHER_UNSPECIFIED
,LipidFaBondType.ETHER_PLASMANYL
orLipidFaBondType.ETHER_PLASMENYL
.String
toString()
boolean
validate()
Validate this lipid against the class-specific available FA types and slots.
-
-
-
Field Detail
-
NONE
public static final LipidSpecies NONE
-
info
protected LipidSpeciesInfo info
-
-
Constructor Detail
-
LipidSpecies
public LipidSpecies(HeadGroup headGroup)
Create a lipid species using the provided head group and a lipid species infoLipidSpeciesInfo.NONE
.- Parameters:
headGroup
- the lipid species head group.
-
LipidSpecies
public LipidSpecies(HeadGroup headGroup, Optional<LipidSpeciesInfo> lipidSpeciesInfo)
Create a lipid species from a head group and an optionalLipidSpeciesInfo
. This constructor will infer the lipid class from the head group automatically. It then uses the lipid class to retrieve the category of this lipid automatically, or sets the category toLipidCategory.UNDEFINED
. The lipid species info, which contains details about the total no. of carbons in FA chains, no. of double bonds etc., is used as provided.- Parameters:
headGroup
- the lipid species head group.lipidSpeciesInfo
- the lipid species info object.
-
-
Method Detail
-
getInfo
public LipidSpeciesInfo getInfo()
Returns theLipidSpeciesInfo
for this lipid.- Returns:
- the lipid species info.
-
isEtherLipid
public boolean isEtherLipid()
Returns true, if the head group ends with ' O' or if the lipid fa bond type is eitherLipidFaBondType.ETHER_UNSPECIFIED
,LipidFaBondType.ETHER_PLASMANYL
orLipidFaBondType.ETHER_PLASMENYL
.- Returns:
- whether this is an 'ether' lipid, e.g. a unspecified ether species, a Plasmanyl or Plasmenyl species.
-
getLipidString
public String getLipidString()
Returns a lipid string representation for theLipidLevel
, e.g. Category, Species, etc, as returned bygetInfo()
. Will return the head group name if the level isLipidSpeciesInfo.NONE
.- Returns:
- the lipid name for the native level.
-
getLipidString
public String getLipidString(LipidLevel level)
Returns a lipid string representation for the givenLipidLevel
, e.g. Category, Species, etc. Please note that this method is overridden by specific implementations for molecular, structural and isomeric subspecies levels. This method does not normalize the head group.- Parameters:
level
- the lipid level to report the name of this lipid on.- Returns:
- the lipid name.
-
getLipidString
public String getLipidString(LipidLevel level, boolean normalizeHeadGroup)
Returns a lipid string representation for the givenLipidLevel
, e.g. Category, Species, etc. Please note that this method is overridden by specific implementations for molecular, structural and isomeric subspecies levels. This method normalizes the head group to the primary class-specific synonym. E.g. TG would be normalized to TAG.- Parameters:
level
- the lipid level to report the name of this lipid on.normalizeHeadGroup
- if true, use class specific synonym for headGroup, if false, use head group as parsed.- Returns:
- the lipid name.
-
buildSpeciesHeadGroupString
protected StringBuilder buildSpeciesHeadGroupString(String headGroup, boolean normalizeHeadGroup)
-
buildLipidString
protected String buildLipidString(LipidLevel level, String headGroup, boolean isNormalized) throws ConstraintViolationException
- Throws:
ConstraintViolationException
-
getNormalizedHeadGroup
public String getNormalizedHeadGroup()
Returns a lipid string representation for the head group of this lipid. This method normalizes the original head group name to the class specific primary alias, if the level and class are known. E.g. TG is normalized to TAG.- Returns:
- the normalized lipid head group.
-
getNormalizedLipidString
public String getNormalizedLipidString()
Returns a lipid string representation for the nativeLipidLevel
, e.g. Category, Species, etc, as returned bygetInfo()
of this lipid. This method normalizes the head group to the primary class-specific synonym. E.g. TG would be normalized to TAG.- Returns:
- the normalized lipid name.
-
validate
public boolean validate()
Validate this lipid against the class-specific available FA types and slots.- Returns:
- true if this lipid's FA types and their number match the class definition, false otherwise.
-
getFa
public Map<String,FattyAcid> getFa()
Returns the fatty acyls registered for this lipid.- Returns:
- the fatty acyls.
-
getElements
public ElementTable getElements()
Returns the element count table for this lipid.- Returns:
- the element count table.
-
getLipidClass
public LipidClass getLipidClass()
-
getLipidCategory
public LipidCategory getLipidCategory()
-
-