Skip to content

Commit

Permalink
Remove unused variable (AriaPKParserListener.__annotation) and enable…
Browse files Browse the repository at this point in the history
… to detect spectral_region 'H_ali'
  • Loading branch information
yokochi47 committed Dec 5, 2024
1 parent f2f2a85 commit 094f982
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wwpdb/utils/nmr/pk/AriaPKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class AriaPKParserListener(ParseTreeListener, BasePKParserListener):
__intensity_error = None
__volume = None
__volume_error = None
__annotation = None

def __init__(self, verbose=True, log=sys.stdout,
representativeModelId=REPRESENTATIVE_MODEL_ID,
Expand Down Expand Up @@ -106,6 +105,10 @@ def exitDocument(self, ctx: XMLParser.DocumentContext): # pylint: disable=unuse
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H'
elif 2 < center < 4:
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H_ali'
elif 60 < center < 90:
__v['atom_type'] = 'C'
__v['atom_isotope_number'] = 13
Expand Down Expand Up @@ -138,6 +141,8 @@ def exitDocument(self, ctx: XMLParser.DocumentContext): # pylint: disable=unuse
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down
2 changes: 2 additions & 0 deletions wwpdb/utils/nmr/pk/NmrPipePKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def exitNmrpipe_pk(self, ctx: NmrPipePKParser.Nmrpipe_pkContext): # pylint: dis
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down
2 changes: 2 additions & 0 deletions wwpdb/utils/nmr/pk/NmrViewPKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def exitNmrview_pk(self, ctx: NmrViewPKParser.Nmrview_pkContext): # pylint: dis
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down
6 changes: 6 additions & 0 deletions wwpdb/utils/nmr/pk/SparkyPKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def exitSparky_pk(self, ctx: SparkyPKParser.Sparky_pkContext): # pylint: disabl
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H'
elif 2 < center < 4:
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H_ali'
elif 60 < center < 90:
__v['atom_type'] = 'C'
__v['atom_isotope_number'] = 13
Expand Down Expand Up @@ -112,6 +116,8 @@ def exitSparky_pk(self, ctx: SparkyPKParser.Sparky_pkContext): # pylint: disabl
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down
6 changes: 6 additions & 0 deletions wwpdb/utils/nmr/pk/TopSpinPKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ def exitDocument(self, ctx: XMLParser.DocumentContext): # pylint: disable=unuse
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H'
elif 2 < center < 4:
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H_ali'
elif 60 < center < 90:
__v['atom_type'] = 'C'
__v['atom_isotope_number'] = 13
Expand Down Expand Up @@ -122,6 +126,8 @@ def exitDocument(self, ctx: XMLParser.DocumentContext): # pylint: disable=unuse
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down
6 changes: 6 additions & 0 deletions wwpdb/utils/nmr/pk/XeasyPKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def exitXeasy_pk(self, ctx: XeasyPKParser.Xeasy_pkContext): # pylint: disable=u
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H'
elif 2 < center < 4:
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H_ali'
elif 60 < center < 90:
__v['atom_type'] = 'C'
__v['atom_isotope_number'] = 13
Expand Down Expand Up @@ -123,6 +127,8 @@ def exitXeasy_pk(self, ctx: XeasyPKParser.Xeasy_pkContext): # pylint: disable=u
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down
6 changes: 6 additions & 0 deletions wwpdb/utils/nmr/pk/XwinNmrPKParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def exitXwinnmr_pk(self, ctx: XwinNmrPKParser.Xwinnmr_pkContext): # pylint: dis
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H'
elif 2 < center < 4:
__v['atom_type'] = 'H'
__v['atom_isotope_number'] = 1
__v['axis_code'] = 'H_ali'
elif 60 < center < 90:
__v['atom_type'] = 'C'
__v['atom_isotope_number'] = 13
Expand Down Expand Up @@ -117,6 +121,8 @@ def exitXwinnmr_pk(self, ctx: XwinNmrPKParser.Xwinnmr_pkContext): # pylint: dis
__v['spectral_region'] = 'H_ami_or_aro'
elif 4 < center < 6 and atom_type == 'H':
__v['spectral_region'] = 'H_all'
elif 2 < center < 4 and atom_type == 'H':
__v['spectral_region'] = 'H_ali'
elif 60 < center < 90 and atom_type == 'C':
__v['spectral_region'] = 'C_all'
elif 30 < center < 50 and atom_type == 'C':
Expand Down

0 comments on commit 094f982

Please sign in to comment.