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
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
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+"
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+"
def test_lipid_fragment_success(self): goslin_fragment_parser = Parser(GoslinFragmentParserEventHandler(), "pygoslin/data/goslin/GoslinFragments.g4", ParserTest.PARSER_QUOTE) lipid_name = "PE 16:1-12:0 - -(H20)" lipid = goslin_fragment_parser.parse(lipid_name) assert lipid != None assert lipid.fragment != None assert lipid.fragment.name == "-(H20)"
def test_lipid_fragment_success(self): file_name = os.path.join("pygoslin", "data", "goslin", "GoslinFragments.g4") goslin_fragment_parser = Parser(GoslinFragmentParserEventHandler(), file_name, ParserTest.PARSER_QUOTE) lipid_name = "PE 16:1-12:0 - -(H20)" lipid = goslin_fragment_parser.parse(lipid_name) assert lipid != None assert lipid.fragment != None assert lipid.fragment.name == "-(H20)"
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"