Exemplo n.º 1
0
 def test_lipid_fragment_fail(self):
     goslin_parser = Parser(GoslinParserEventHandler(), "pygoslin/data/goslin/Goslin.g4", ParserTest.PARSER_QUOTE)
     
     
     lipid_name = "PE 16:1-12:0 - -(H20)"
     lipid = goslin_parser.parse(lipid_name)
     assert lipid != None
Exemplo n.º 2
0
    def test_lipid_fragment_fail(self):
        file_name = os.path.join("pygoslin", "data", "goslin", "Goslin.g4")
        goslin_parser = Parser(GoslinParserEventHandler(), file_name,
                               ParserTest.PARSER_QUOTE)

        lipid_name = "PE 16:1-12:0 - -(H20)"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None
Exemplo n.º 3
0
    def test_adduct(self):
        goslin_parser_event_handler = GoslinParserEventHandler()
        goslin_parser = Parser(goslin_parser_event_handler, "pygoslin/data/goslin/Goslin.g4")

        lipid_name = "PE 16:1/12:0[M+H]1+"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None
        assert lipid.get_lipid_string() == "PE 16:1/12:0[M+H]1+"
Exemplo n.º 4
0
    def test_adduct(self):
        goslin_parser_event_handler = GoslinParserEventHandler()
        file_name = os.path.join("pygoslin", "data", "goslin", "Goslin.g4")
        goslin_parser = Parser(goslin_parser_event_handler, file_name)

        lipid_name = "PE 16:1/12:0[M+H]1+"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None
        assert lipid.get_lipid_string() == "PE 16:1/12:0[M+H]1+"
Exemplo n.º 5
0
    def test_lipid_names(self):
        file_name = os.path.join("pygoslin", "data", "goslin", "Goslin.g4")
        goslin_parser = Parser(GoslinParserEventHandler(), file_name,
                               ParserTest.PARSER_QUOTE)

        ## glycerophospholipid
        lipid_name = "PE 16:1/12:0"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None
        assert lipid.lipid.get_lipid_string(
            LipidLevel.STRUCTURAL_SUBSPECIES) == "PE 16:1/12:0"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.MOLECULAR_SUBSPECIES) == "PE 16:1-12:0"
        assert lipid.lipid.get_lipid_string(LipidLevel.SPECIES) == "PE 28:1"
        assert lipid.lipid.get_lipid_string(LipidLevel.CLASS) == "PE"
        assert lipid.lipid.get_lipid_string(LipidLevel.CATEGORY) == "GP"

        ## sphingolipid
        lipid_name = "Cer 16:1;2/12:0"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None
        assert lipid.lipid.get_lipid_string(
            LipidLevel.STRUCTURAL_SUBSPECIES) == "Cer 16:1;2/12:0"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.MOLECULAR_SUBSPECIES) == "Cer 16:1;2-12:0"
        assert lipid.lipid.get_lipid_string(LipidLevel.SPECIES) == "Cer 28:1;2"
        assert lipid.lipid.get_lipid_string(LipidLevel.CLASS) == "Cer"
        assert lipid.lipid.get_lipid_string(LipidLevel.CATEGORY) == "SP"

        ## glycerolipid
        lipid_name = "TAG 16:1/12:0/20:2"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None

        assert lipid.lipid.get_lipid_string(
            LipidLevel.STRUCTURAL_SUBSPECIES) == "TAG 16:1/12:0/20:2"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.MOLECULAR_SUBSPECIES) == "TAG 16:1-12:0-20:2"
        assert lipid.lipid.get_lipid_string(LipidLevel.SPECIES) == "TAG 48:3"
        assert lipid.lipid.get_lipid_string(LipidLevel.CLASS) == "TAG"
        assert lipid.lipid.get_lipid_string(LipidLevel.CATEGORY) == "GL"

        ## sterol
        lipid_name = "ChE 16:1"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None

        assert lipid.lipid.get_lipid_string(
            LipidLevel.STRUCTURAL_SUBSPECIES) == "SE 27:1/16:1"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.MOLECULAR_SUBSPECIES) == "SE 27:1/16:1"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.SPECIES) == "SE 27:1/16:1"
        assert lipid.lipid.get_lipid_string(LipidLevel.CLASS) == "SE 27:1"
        assert lipid.lipid.get_lipid_string(LipidLevel.CATEGORY) == "ST"

        ## sterol
        lipid_name = "SE 27:1/16:1"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None

        assert lipid.lipid.get_lipid_string(
            LipidLevel.STRUCTURAL_SUBSPECIES) == "SE 27:1/16:1"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.MOLECULAR_SUBSPECIES) == "SE 27:1/16:1"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.SPECIES) == "SE 27:1/16:1"
        assert lipid.lipid.get_lipid_string(LipidLevel.CLASS) == "SE 27:1"
        assert lipid.lipid.get_lipid_string(LipidLevel.CATEGORY) == "ST"

        ## PC
        lipid_name = "PC O-18:1a/16:0"
        lipid = goslin_parser.parse(lipid_name)
        assert lipid != None

        assert lipid.lipid.get_lipid_string(
            LipidLevel.STRUCTURAL_SUBSPECIES) == "PC O-18:1a/16:0"
        assert lipid.lipid.get_lipid_string(
            LipidLevel.MOLECULAR_SUBSPECIES) == "PC O-18:1a-16:0"
        assert lipid.lipid.get_lipid_string(LipidLevel.SPECIES) == "PC O-34:1a"
        assert lipid.lipid.get_lipid_string(LipidLevel.CLASS) == "PC"
        assert lipid.lipid.get_lipid_string(LipidLevel.CATEGORY) == "GP"
Exemplo n.º 6
0
 def __init__(self):
     self.event_handler = GoslinParserEventHandler()
     dir_name = path.dirname(pygoslin.__file__)
     file_name = path.join(dir_name, "data", "goslin", "Goslin.g4")
     super().__init__(self.event_handler, file_name, Parser.DEFAULT_QUOTE)
Exemplo n.º 7
0
 def __init__(self):
     self.event_handler = GoslinParserEventHandler()
     dir_name = path.dirname(pygoslin.__file__)
     super().__init__(self.event_handler,
                      dir_name + "/data/goslin/Goslin.g4",
                      Parser.DEFAULT_QUOTE)