Skip to content

Commit

Permalink
more prostaglandins support
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-kopczynski committed Feb 26, 2024
1 parent 3af5080 commit fab1533
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/parser/GoslinParserEventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,13 @@ void GoslinParserEventHandler::reset_lipid(TreeNode *node) {


void GoslinParserEventHandler::add_prostaglandin(TreeNode *node){
set<string> pg_types = {"B", "D", "E", "F", "J"};
set<string> pg_types = {"B", "D", "E", "F", "J", "K"};
set<string> pg_numbers = {"1", "2", "3"};
if (uncontains_val(pg_types, prostaglandin_type) || uncontains_val(pg_numbers, prostaglandin_number)) return;

DoubleBonds *db = nullptr;
FattyAcid *tmp_fa = current_fa;


if (prostaglandin_number == "1") db = new DoubleBonds({{13, "E"}});
else if (prostaglandin_number == "2") db = new DoubleBonds({{5, "Z"}, {13, "E"}});
else if (prostaglandin_number == "3") db = new DoubleBonds({{5, "Z"}, {13, "E"}, {17, "Z"}});
Expand All @@ -163,7 +162,6 @@ void GoslinParserEventHandler::add_prostaglandin(TreeNode *node){
Cycle* cy = new Cycle(5, 8, 12, new DoubleBonds({{8, ""}}), new map<string, vector<FunctionalGroup*>>{{"OH", {f2}}});
current_fa = new FattyAcid("FA", 20, db, new map<string, vector<FunctionalGroup*>>{{"OH", {f1}}, {"cy", {cy}}});
}

else if (prostaglandin_type == "D"){
FunctionalGroup *f1 = KnownFunctionalGroups::get_functional_group("OH");
FunctionalGroup *f2 = KnownFunctionalGroups::get_functional_group("OH");
Expand All @@ -184,7 +182,6 @@ void GoslinParserEventHandler::add_prostaglandin(TreeNode *node){
Cycle* cy = new Cycle(5, 8, 12, 0, new map<string, vector<FunctionalGroup*>>{{"OH", {f3}}, {"oxy", {f2}}});
current_fa = new FattyAcid("FA", 20, db, new map<string, vector<FunctionalGroup*>>{{"OH", {f1}}, {"cy", {cy}}});
}

else if (prostaglandin_type == "F"){
FunctionalGroup *f1 = KnownFunctionalGroups::get_functional_group("OH");
FunctionalGroup *f2 = KnownFunctionalGroups::get_functional_group("OH");
Expand All @@ -195,8 +192,6 @@ void GoslinParserEventHandler::add_prostaglandin(TreeNode *node){
Cycle* cy = new Cycle(5, 8, 12, 0, new map<string, vector<FunctionalGroup*>>{{"OH", {f2, f3}}});
current_fa = new FattyAcid("FA", 20, db, new map<string, vector<FunctionalGroup*>>{{"OH", {f1}}, {"cy", {cy}}});
}


else if (prostaglandin_type == "J"){
FunctionalGroup *f1 = KnownFunctionalGroups::get_functional_group("OH");
FunctionalGroup *f2 = KnownFunctionalGroups::get_functional_group("oxo");
Expand All @@ -205,6 +200,16 @@ void GoslinParserEventHandler::add_prostaglandin(TreeNode *node){
Cycle* cy = new Cycle(5, 8, 12, new DoubleBonds({{9, ""}}), new map<string, vector<FunctionalGroup*>>{{"oxo", {f2}}});
current_fa = new FattyAcid("FA", 20, db, new map<string, vector<FunctionalGroup*>>{{"OH", {f1}}, {"cy", {cy}}});
}
else if (prostaglandin_type == "K"){
FunctionalGroup *f1 = KnownFunctionalGroups::get_functional_group("OH");
FunctionalGroup *f2 = KnownFunctionalGroups::get_functional_group("oxo");
FunctionalGroup *f3 = KnownFunctionalGroups::get_functional_group("oxo");
f1->position = 15;
f2->position = 9;
f3->position = 11;
Cycle* cy = new Cycle(5, 8, 12, 0, new map<string, vector<FunctionalGroup*>>{{"oxo", {f2, f3}}});
current_fa = new FattyAcid("FA", 20, db, new map<string, vector<FunctionalGroup*>>{{"OH", {f1}}, {"cy", {cy}}});
}
else {
delete db;
return;
Expand Down

0 comments on commit fab1533

Please sign in to comment.