Skip to content

Commit

Permalink
updated tri hydro information
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-kopczynski committed Feb 23, 2024
1 parent 7430e6f commit 2472b10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pygoslin/data/goslin/Goslin.g4
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,20 @@ mediator_function_unknown_pos : mediator_functions;
mediator_functions : mediator_mono_functions | mediator_di_functions | mediator_tri_functions;
mediator_mono_functions: 'H' | 'Oxo' | 'oxo' | 'OXO' | 'keto' | 'Hp' | 'HP' | 'NO2' | 'K' | 'k' | 'hydroxy' | 'd' | 'deoxy' | 'beta';
mediator_di_functions: 'E' | 'Ep' | 'EP' | 'DH' | 'DiH' | 'diH' | 'dihydro';
mediator_tri_functions : 'triH' | 'trihydroxy';
mediator_tri_functions : 'TriH' | 'triH' | 'trihydroxy';
mediator_full_function : mediator_position_group '-' mediator_mono_functions | mediator_di_pos '-' mediator_di_functions | mediator_tri_pos '-' mediator_tri_functions | mediator_position_group mediator_mono_functions;
mediator_db_function : mediator_double_bond_positions '-' mediator_mono_functions;
mediator_double_bond_positions_full : '(' mediator_double_bond_positions ')';
mediator_double_bond_positions : mediator_double_bond_position | mediator_double_bond_positions ',' mediator_double_bond_position;
mediator_double_bond_position : mediator_double_bond_pos mediator_double_bond_ct;
mediator_double_bond_pos : number;
mediator_double_bond_ct : cistrans;
mediator_di_pos: mediator_position_group mediator_separator mediator_position_group | mediator_position_group '(' mediator_position_group ')' | '(' mediator_position_group mediator_separator mediator_position_group ')' | mediator_position_group ',' mediator_position_group;
mediator_di_pos: mediator_position_group mediator_separator mediator_position_group | mediator_position_group '(' mediator_position_group ')' | '(' mediator_position_group mediator_separator mediator_position_group ')';
mediator_tri_pos: mediator_position_group mediator_separator mediator_position_group mediator_separator mediator_position_group | '(' mediator_position_group mediator_separator mediator_position_group mediator_separator mediator_position_group ')';
mediator_position_group : mediator_position | mediator_position mediator_position_isotope | mediator_position '(' mediator_position_isotope ')' | '(' mediator_position mediator_position_isotope ')';
mediator_position : number;
mediator_position_isotope : 'S' | 'R';
mediator_separator : ',' | '-' | '_';

trivial_mediator : 'AA' | 'ARA' | 'LA' | 'ALA' | 'DHA' | 'EPA' | 'Linoleic acid' | 'Arachidonic acid' | 'TXB1' | 'TXB2' | 'TXB3' | 'Resolvin D1' | 'Resolvin D2' | 'Resolvin D3' | 'Resolvin D5' | 'LTB4' | 'Mar1' | 'Maresin 1' | 'Palmitic acid' | 'PDX' | 'OA' | 'Oleic acid' | 'iPF2alpha-VI';

Expand Down
5 changes: 3 additions & 2 deletions pygoslin/parser/GoslinParserEventHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ def recursive_deletion(fg_name, fg, functional_groups):
return True

for fg_curr in fg_list_curr:
if recursive_deletion(fg_name, fg, fg_curr.functional_groups): break
if recursive_deletion(fg_name, fg, fg_curr.functional_groups): return True
return False

if not recursive_deletion(fg_name, fg, self.current_fa.functional_groups):
if fg_name not in self.current_fa.functional_groups: self.current_fa.functional_groups[fg_name] = []
self.current_fa.functional_groups[fg_name].append(fg)
Expand Down Expand Up @@ -482,7 +484,6 @@ def new_fa(self, node):


def append_fa(self, node):

if type(self.current_fa.double_bonds) != int:
if self.db_numbers > -1 and self.db_numbers != len(self.current_fa.double_bonds):
raise LipidException("Double bond count does not match with number of double bond positions")
Expand Down
2 changes: 1 addition & 1 deletion pygoslin/parser/LipidBaseParserEventHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def resolve_fa_synonym(self, mediator_name):
elif mediator_name in {"Linoleic acid", "LA"}:
return FattyAcid("FA", 18, {9: "Z", 12: "Z"})

elif mediator_name in {"Arachidonic acid", "AA"}:
elif mediator_name in {"Arachidonic acid", "AA", "ARA"}:
return FattyAcid("FA", 20, {5: "Z", 8: "Z", 11: "Z", 14: "Z"})

elif mediator_name == "ALA":
Expand Down

0 comments on commit 2472b10

Please sign in to comment.