Skip to content

Commit

Permalink
added again more support for adducts
Browse files Browse the repository at this point in the history
  • Loading branch information
dominik-kopczynski committed Apr 7, 2023
1 parent c310713 commit ace08b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions Goslin.g4
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ grammar Goslin;

/* first rule is always start rule */
lipid : lipid_eof EOF;
lipid_eof : lipid_pure | lipid_pure adduct_info;
lipid_eof : lipid_rule | lipid_rule adduct_info;
lipid_rule: lipid_mono | lipid_mono isotope;
lipid_mono: lipid_pure | lipid_pure isoform;
lipid_pure : gl | pl | sl | sterol | mediatorc | saccharolipid;
isotope: SPACE round_open_bracket isotope_pair round_close_bracket | round_open_bracket isotope_pair round_close_bracket | DASH round_open_bracket isotope_pair round_close_bracket | DASH isotope_pair | SPACE isotope_pair | isotope_pair;
isotope_pair: isotope_element isotope_number;
isotope_number: number;
isotope_element: 'd' | 'D';


/* adduct information */
Expand Down Expand Up @@ -172,10 +178,11 @@ mediator_function_unknown_pos : mediator_functions;
mediator_functions : mediator_mono_functions | mediator_di_functions;
mediator_mono_functions: 'H' | 'Oxo' | 'Hp';
mediator_di_functions: 'E' | 'Ep' | 'DH' | 'DiH' | 'diH';
mediator_mono_pos: mediator_position;
mediator_mono_pos: mediator_position | mediator_position mediator_position_isotope;
mediator_di_pos: mediator_position ',' mediator_position | mediator_position '_' mediator_position | mediator_position '(' mediator_position ')';
mediator_full_function : mediator_mono_pos '-' mediator_mono_functions | mediator_di_pos '-' mediator_di_functions;
mediator_position : number;
mediator_position_isotope : 'S' | 'R';

trivial_mediator : 'AA' | 'ALA' | 'DHA' | 'EPA' | 'Linoleic acid' | 'TXB1' | 'TXB2' | 'TXB3' | 'Resolvin D1' | 'Resolvin D2' | 'Resolvin D3' | 'Resolvin D5' | 'LTB4' | 'Maresin 1' | 'Palmitic acid' | 'PGB2' | 'PGD2' | 'PGE2' | 'PGF2alpha';

Expand Down Expand Up @@ -223,16 +230,13 @@ number : digit | digit number;
digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';


heavy : '(+' adduct_heavy ')';
adduct_heavy : adduct_heavy_component | adduct_heavy adduct_heavy;
adduct_heavy_component : adduct_heavy_element adduct_heavy_number | adduct_heavy_element;
adduct_heavy_element: '[2]H' | '[13]C' | '[15]N' | '[17]O' | '[18]O' | '[32]P' | '[33]S' | '[34]S';
adduct_heavy_number : number;



heavy : '(+' isotopes ')';
isotopes : isotopes isotopes | isotope;
isotope : '[' isotope_number ']' isotope_element isotope_count | '[' isotope_number ']' isotope_element;
isotope_number : number;
isotope_element : element;
isotope_count : number;

/* separators */
SPACE : ' ';
COLON : ':';
Expand Down
2 changes: 1 addition & 1 deletion Shorthand2020.g4
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ adduct : adduct_set;
adduct_set : adduct_element | adduct_element adduct_set;
adduct_element : element | element number | number element | plus_minus element | plus_minus element number | plus_minus number element;
adduct_heavy : adduct_heavy_component | adduct_heavy adduct_heavy;
adduct_heavy_component : adduct_heavy_element adduct_heavy_number;
adduct_heavy_component : adduct_heavy_element adduct_heavy_number | adduct_heavy_element;
adduct_heavy_element: '[2]H' | '[13]C' | '[15]N' | '[17]O' | '[18]O' | '[32]P' | '[33]S' | '[34]S';
adduct_heavy_number : number;

Expand Down

0 comments on commit ace08b8

Please sign in to comment.