Python3 implementation for Goslin
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.
Related Projects
- This project
- C++ implementation
- Goslin grammars and test files
- Java implementation
- R implementation
- Webapplication and REST API
Installation
Installation via pip
The easiest way to install pygoslin is simply via pip:
pip3 install pygoslin
Regular installation: prerequisites
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.
Testing pygoslin
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
Using pygoslin
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.
Supported lipids
| 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 |
Metadata
Release files for pygoslin 2.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygoslin-2.2.5.tar.gz | 94.8 kB | Without provenance | Details for pygoslin-2.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygoslin-2.2.5-py3-none-any.whl | Python 3 | none | any | Details for pygoslin-2.2.5-py3-none-any.whl |
Total release size: 245.5 kB
Release files / pygoslin-2.2.5.tar.gz
| Download URL | pygoslin-2.2.5.tar.gz |
|---|---|
| Size | 94.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8be4caf3ae4e1ce52c7036da61d280c53eba509c53d818807605c3550ab9fed4
|
|
BLAKE2b-256 checksum How to use checksums |
91dbbe26ad163cabda9e7484fdabd603e1780f8caab935d2106e63d22c0ef077
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / pygoslin-2.2.5-py3-none-any.whl
| Download URL | pygoslin-2.2.5-py3-none-any.whl |
|---|---|
| Size | 150.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea2047d2ff7162268f5beff5ada4c72fdc101bb067264d0133ce6d7e9ffdb328
|
|
BLAKE2b-256 checksum How to use checksums |
6c0616e35443cb27c0d8b3c7aa0b694a4676f427a316813b10d2f419001a668a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for pygoslin 2.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.