Examples

The Goslin API-REST enables to standardize lipid names. Here, you will found some examples of output in JSON format that can be return by the API. Theses output have been retrieve from requests send to the API via the MetaboCloud website : https://metabocloud.mesocentre.uca.fr/goslin

One lipid name put in the query parameters

The API can be used with only one lipid name put as parameters in the query. In this case, the query will look like : https://metabocloud.mesocentre.uca.fr/goslin/validate?lipids_names=yourvalue

See the Web usage section in the Overview and the Swagger documentation for more information about the use of the API.

When only one valid lipid name is sent with the request, 3 types of output can be returned :

  • A successful parsing when the API succeeds to parse the lipid name and to provide a standardized name with the information associated.

  • An uncompleted parsing when the API fails to completely parse the lipid name. This means that at least one of the grammars manage to begin reading the lipid name but was not able to provide a standardized name. In this case, a string corresponding to how far a grammar was able to read the lipid name is returned for each grammars used.

  • A failed parsing when the API was unable to parse the lipid name. The lidip is therefore considered as not found. This may be because the lipid name was not valid but also because the lipid name is not part a lipid class supported by pygoslin.

Example of a successful parsing with the lipid name : Cer 18:1;2/16:0
Request :
https://metabocloud.mesocentre.uca.fr/goslin/validate?lipids_names=Cer%2018%3A1%3B2%2F16%3A0
Output :
{
        "nb_not_parsed": 0,
        "nb_uncompleted": 0,
        "nb_failures": 0,
        "lipid_list": [
                {
                        "state": "Success",
                        "normalized_name": "Cer 18:1;O2/16:0",
                        "original_name": "Cer 18:1;2/16:0",
                        "grammar": "Goslin",
                        "lipidmaps_category": "SP",
                        "lipidmaps_class": "Ceramides [SP02]",
                        "class_name": "Cer",
                        "extended_class": "Cer",
                        "lipid_level": "SN_POSITION",
                        "mass": 537.5120952350001,
                        "sum_formula": "C34H67NO3",
                        "lipidsmaps_data": {
                                "LMSP02010004": {
                                        "inchi_key": "YDNKGFDKKRUKPY-TURZORIXSA-N",
                                        "swisslipids_id": "SLM:000000554"
                                },
                                "LMSP02010036": {
                                        "inchi_key": "DLTXHYMYPKOZOA-TURZORIXSA-N",
                                        "swisslipids_id": "SLM:000397291"
                                },
                                "LMSP02010046": {
                                        "inchi_key": "UQKAUNJILIUTGT-TURZORIXSA-N",
                                        "swisslipids_id": "SLM:000397537"
                                }
                        }
                }
        ],
        "nb_success": 1,
        "nb_total_lipids": 1
}

Several lipid names put in the query parameters

The API can also receive a resquest with several lipid names put as parameters. In this case, the different types of output described above can be found in the final output of the request.

Example of an output for several lipid names given in parameters of the same request :
Cer 18:1;2/16:0, PC (4a:0), Vitamin D5
Request :
https://metabocloud.mesocentre.uca.fr/goslin/validate?lipids_names=Cer%2018%3A1%3B2%2F16%3A0&lipids_names=PC%20(4a%3A0)&lipids_names=Vitamin%20D5
Output :
{
        "nb_not_parsed": 2,
        "nb_uncompleted": 1,
        "nb_failures": 1,
        "lipid_list": [
                {
                        "state": "Success",
                        "normalized_name": "Cer 18:1;O2/16:0",
                        "original_name": "Cer 18:1;2/16:0",
                        "grammar": "Goslin",
                        "lipidmaps_category": "SP",
                        "lipidmaps_class": "Ceramides [SP02]",
                        "class_name": "Cer",
                        "extended_class": "Cer",
                        "lipid_level": "SN_POSITION",
                        "mass": 537.5120952350001,
                        "sum_formula": "C34H67NO3",
                        "lipidsmaps_data": {
                                "LMSP02010004": {
                                        "inchi_key": "YDNKGFDKKRUKPY-TURZORIXSA-N",
                                        "swisslipids_id": "SLM:000000554"
                                },
                                "LMSP02010036": {
                                        "inchi_key": "DLTXHYMYPKOZOA-TURZORIXSA-N",
                                        "swisslipids_id": "SLM:000397291"
                                },
                                "LMSP02010046": {
                                        "inchi_key": "UQKAUNJILIUTGT-TURZORIXSA-N",
                                        "swisslipids_id": "SLM:000397537"
                                }
                        }
                },
                {
                        "state": "Uncompleted",
                        "original_name": "PC (4a:0)",
                        "messages": {
                                "Shorthand2020": "PC",
                                "Goslin": "PC",
                                "FattyAcids": "",
                                "LipidMaps": "PC ",
                                "SwissLipids": "PC",
                                "HMDB": "PC"
                        }
                },
                {
                        "state": "Failure",
                        "original_name": "Vitamin D5",
                        "messages": "Lipid not found"
                }
        ],
        "nb_success": 1,
        "nb_total_lipids": 3
}