Skip to content

Commit

Permalink
Interprete XPLOR-NIH distance restraints using 'donor' and 'acceptor'…
Browse files Browse the repository at this point in the history
… terms as XPLOR-NIH HBDB restraints (2n7j)
  • Loading branch information
yokochi47 committed Jun 17, 2024
1 parent 384a6b1 commit dea0ad8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wwpdb/utils/nmr/mr/XplorMRParserListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,8 @@ def enterNoe_assign(self, ctx: XplorMRParser.Noe_assignContext): # pylint: disa
self.paramagCenter = None
self.__has_nx = False

self.donor_columnSel = self.acceptor_columnSel = -1

# Exit a parse tree produced by XplorMRParser#noe_assign.
def exitNoe_assign(self, ctx: XplorMRParser.Noe_assignContext): # pylint: disable=unused-argument

Expand Down Expand Up @@ -1910,6 +1912,17 @@ def exitNoe_assign(self, ctx: XplorMRParser.Noe_assignContext): # pylint: disab
self.exitTenso_assign(ctx)
return

if self.donor_columnSel != -1 and self.acceptor_columnSel != -1 and len(self.atomSelectionSet) == 2:
self.distRestraints -= 1
self.hbondRestraints += 1
if self.__cur_subtype_altered:
self.distStatements -= 1
if self.hbondStatements == 0:
self.hbondStatements += 1
self.__cur_subtype = 'hbond'
self.exitHbond_db_assign(ctx)
return

self.__cur_subtype = 'dist' # to get consistent number of statement

target = self.numberSelection[0]
Expand Down
5 changes: 5 additions & 0 deletions wwpdb/utils/nmr/mr/XplorMRReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def parse(self, mrFilePath, cifFilePath=None, isFilePath=True,


if __name__ == "__main__":
reader = XplorMRReader(True)
reader.setDebugMode(True)
reader.parse('../../tests-nmr/mock-data-remediation/2n7j/2n7j-corrected.mr',
'../../tests-nmr/mock-data-remediation/2n7j/2n7j.cif')

reader = XplorMRReader(True)
reader.setDebugMode(True)
reader.parse('../../tests-nmr/mock-data-remediation/2n05/2n05-corrected.mr',
Expand Down

0 comments on commit dea0ad8

Please sign in to comment.