This is the Goslin reference implementation for Python 3.
The pygoslin has been developed with regard the following general issues:
- Ease the handling with lipid names for developers working on mass spectrometry-based lipidomics tools.
- Offering a tool to unify all existing dialects of lipid names.
- This project
- C++ implementation
- Goslin grammars and test files
- Java implementation
- R implementation
- Webapplication and REST API
The easiest way to install pygoslin is simply via pip:
pip3 install pygoslin
The pygoslin package uses pip to create an isolated and defined build environment. You will need Python >=3.5 to build the package.
python3-pip
cython (module for Python 3)
make (optional)
To install the package globally in your Python distribution, simply type:
[sudo] make install
or
[sudo] python setup.py install
Be sure that you have root permissions.
To run the tests, please type:
make test
or
python3 -m unittest pygoslin.tests.FattyAcidTest
python3 -m unittest pygoslin.tests.ParserTest
python3 -m unittest pygoslin.tests.SwissLipidsTest
python3 -m unittest pygoslin.tests.GoslinTest
python3 -m unittest pygoslin.tests.LipidMapsTest
python3 -m unittest pygoslin.tests.HmdbTest
The two major functions within pygoslin are the parsing and printing of lipid names. You have several options, to access these functions. This example will demonstrate both functions the easiest way. Open a Python shell and type in:
from pygoslin.parser.Parser import LipidParser
lipid_parser = LipidParser()
lipid_name = "PE 16:1-12:0"
lipid = lipid_parser.parse(lipid_name)
if lipid != None: print(lipid.get_lipid_string())
Be aware, that this method is subsequencially using all available grammars until a lipid name can be described by the first grammar. Currently, three grammars are available, namely:
Goslin
GoslinFragment
LipidMaps
SwissLipids
HMDB
To use a specific grammar / parser, you can use the following code:
# using solely the Goslin parser
from pygoslin.parser.Parser import GoslinParser
goslin_parser = GoslinParser()
lipid_name = "Cer 18:1;2/12:0"
try:
lipid = goslin_parser.parse(lipid_name)
print(lipid.get_lipid_string())
except Exception as e:
print(e)
# using solely the Goslin Fragment parser
from pygoslin.parser.Parser import GoslinFragmentParser
goslin_fragment_parser = GoslinFragmentParser()
lipid_name = "Cer 18:1;2/12:0"
try:
lipid = goslin_fragment_parser.parse(lipid_name)
print(lipid.get_lipid_string())
except Exception as e:
print(e)
# using solely the LipidMaps parser
from pygoslin.parser.Parser import LipidMapsParser
lipid_maps_parser = LipidMapsParser()
lipid_name = "Cer(d18:1/12:0)"
try:
lipid = lipid_maps_parser.parse(lipid_name)
print(lipid.get_lipid_string())
except Exception as e:
print(e)
# using solely the SwissLipids parser
from pygoslin.parser.Parser import SwissLipidsParser
swiss_lipids_parser = SwissLipidsParser()
lipid_name = "Cer(d18:1/12:0)"
try:
lipid = swiss_lipids_parser.parse(lipid_name)
print(lipid.get_lipid_string())
except Exception as e:
print(e)
# using solely the HMDB parser
from pygoslin.parser.Parser import HmdbParser
hmdb_parser = HmdbParser()
lipid_name = "Cer(d18:1/12:0)"
try:
lipid = hmdb_parser.parse(lipid_name)
print(lipid.get_lipid_string())
except Exception as e:
print(e)
To be as generic as possible, no treatment of validation of the fragment is conducted within the GoslinFragmentParser.
Lipid category | Lipid class | Abbreviation |
---|---|---|
Glycerophospholipids (GP) | Bismonoacylglycerophosphate | BMP / LBPA |
CDP-diacylglycerol | CDP-DAG | |
Dimethylphosphatidylethanolamine | DMPE | |
Monomethylphosphatidylethanolamine | MMPE | |
Phosphatidylinositol mannoside inositol phosphate | PIMIP | |
Lyso-CDP-diacylglycerol | LCDPDAG | |
Lysodimethylphosphatidylethanolamine | LDMPE | |
Lysomonomethylphosphatidylethanolamine | LMMPE | |
Lysophosphatidylinositol- mannosideinositolphosphate | LPIMIP | |
Lysophosphatidylinositol-glucosamine | LPIN | |
Lysophosphatidic acid | LPA | |
Lysophophatidylcholine | LPC | |
Ether lysophosphatidic acid | LPC O-a | |
LPC O-p | ||
Lysophosphatidylethanolamine | LPE | |
Ether lysophosphatidylethanolamine | LPE O-a | |
LPE O-p | ||
Lysophosphatidylglycerol | LPG | |
Lysophosphatidylinositol | LPI | |
Lysophosphatidylserine | LPS | |
Cardiolipin | CL | |
Glycerophosphoglycerophosphoglycerols | DLCL | |
Monolysocardiolipin | MLCL | |
Phosphatidic acid | PA | |
Phosphatidylcholine | PC | |
Ether phosphatidylcholine | PC O-a | |
PC O-p | ||
Phosphatidylethanolamine | PE | |
Ether phosphatidylethanolamine | PE O-a | |
PE O-p | ||
Phosphatidylethanol | PEt | |
Phosphatidylglycerol | PG | |
Phosphatidylinositol | PI | |
Phosphatidylinositolphosphate | PIP / PIP[3'] / PIP[4'] / PIP[5'] | |
Phosphatidylinositolbisphosphate | PIP2 / PIP2[3',4'] / PIP2[3',5'] / PIP2[4',5'] | |
Phosphatidylinositoltrisphosphate | PIP3 / PIP3[3',4',5'] | |
Phosphatidylserine | PS | |
Phosphatidylinositol mannoside | PIM / PIM1 / PIM2 / PIM3 PIM4 / PIM5 / PIM6 | |
Lysophosphatidylinositol mannoside | LPIM / LPIM1 / LPIM2 / LPIM3 LPIM4 / LPIM5 / LPIM6 | |
Phosphatidylglycerol phosphate | PGP | |
Diacylglyceropyrophosphate | PPA | |
Diacylglycosylglycerophospholipid | Glc-GP / 6-Ac-Glc-GP | |
Diacylglycerophosphonocholine | PnC | |
Diacylglycerophosphonoethanolamine | PnE | |
Diacylglycerophosphoethanolamine | PE-NMe / PE-NMe2 | |
Diacylglycerophosphomonoradylglycerol | SLBPA | |
N-acylphosphatidylethanolamine | NAPE | |
CPA | ||
Sphingolipids (SP) | Ceramide | Cer |
Ceramide phosphate | CerP | |
Ethanolaminephosphoceramide | EPC | |
Ganglioside GB3 | GB3 | |
Ganglioside GB4 | GB4 | |
Ganglioside GD3 | GD3 | |
Ganglioside GM3 | GM3 | |
Ganglioside GM4 | GM4 | |
Dihexosylceramide | Hex2Cer | |
Hexosylceramide | HexCer | |
Inositolphosphoceramide | IPC | |
Long-chain base | LCB | |
Long-chain base phosphate | LCBP | |
Lysomonohexosylceramide | LHexCer | |
Lysosphingomyelin | LSM | |
Mannosyldiinositolphosphoceramide | M(IP)2C | |
Mannosylinositolphosphoceramide | MIPC | |
Sulfatide | SHexCer | |
Sphingomyelin | SM | |
Sterol lipids (ST) | Cholesterol | Ch |
Cholesteryl ester | ChE | |
Glycerolipids (GL) | Diacylglycerol | DAG |
Digalactosyldiacylglycerol | DGDG | |
Monoacylglycerol | MAG | |
Monogalactosyldiacylglycerol | MGDG | |
Sulfoquinovosyl monoacylglycerols | SQMG | |
Sulfoquinovosyl diacylglycerol | SQDG | |
Triacylglycerol | TAG | |
Saccharo lipids (SL) | DAT | |
AC2SGL | ||
PAT16 / PAT18 | ||
Mediator (LM) | Docosanoids | 10-HDoHE |
11-HDoHE | ||
16-HDoHE | ||
8-HDoHE | ||
Maresin 1 | ||
Resolvin D1 | ||
Resolvin D2 | ||
Resolvin D3 | ||
Resolvin D5 | ||
Docosanoids | 11(12)-EET | |
11,12-DHET | ||
11-HETE | ||
12-HEPE | ||
12-HETE | ||
12-HHTrE | ||
12-OxoETE | ||
14(15)-EET | ||
14(15)-EpETE | ||
14,15-DHET | ||
15d-PGJ2 | ||
15-HEPE | ||
15-HETE} | ||
16-HETE | ||
18-HEPE | ||
5(6)-EET | ||
5,12-DiHETE | ||
5,6,15-LXA4 | ||
5,6-DiHETE | ||
5-HEPE | ||
5-HETE | ||
5-HpETE | ||
5-OxoETE | ||
8(9)-EET | ||
8,9-DHET | ||
8-HETE | ||
9-HEPE | ||
9-HETE | ||
LTB4 | ||
LTC4 | ||
LTD4 | ||
PGB2 | ||
PGD2 | ||
PGE2 | ||
PGF2alpha | ||
PGI2 | ||
TXB1 | ||
TXB2 | ||
TXB3 | ||
Octadecanoids | 12(13)-EpOME | |
13-HODE | ||
13-HOTrE | ||
9(10)-EpOME | ||
9-HODE | ||
9-HOTrE | ||
Fatty Acids and Conjugates | AA (Arachidonic acid) | |
ALA (α-Linolenic acid) | ||
DHA (Docosahexaenoic acid) | ||
EPA (Eicosapentaenoic acid) | ||
Linoleic acid | ||
Palmitic acid | ||
Tetranor-12-HETE |