Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3349 closed defect (fixed)

Problem handling bad template

Reported by: chimerax-bug-report@… Owned by: Tristan Croll
Priority: normal Milestone:
Component: Third Party Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-19.4.0-x86_64-i386-64bit
ChimeraX Version: 0.91 (2019-09-24)
Description
(Describe the actions that caused this problem to occur here)

Log:
Startup Messages  
---  
warnings | 'clip' is a prefix of an existing command 'clipper'  
'rota' is a prefix of an existing command 'rotamers'  
  
UCSF ChimeraX version: 0.91 (2019-09-24)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open postmap_704_4_51.mrc

Opened postmap_704_4_51.mrc, grid size 240,240,240, pixel 1.56, shown at level
0.00874, step 1, values float32  

> open mnosym-init-001.pdb

Chain information for mnosym-init-001.pdb #2  
---  
Chain | Description  
A | No description available  
B | No description available  
C | No description available  
D E | No description available  
F | No description available  
  

> show atoms

> hide atoms

> show cartoons

> toolshed show ISOLDE

> set selectionWidth 4

Chain information for mnosym-init-001.pdb  
---  
Chain | Description  
2.1/A | No description available  
2.1/B | No description available  
2.1/C | No description available  
2.1/D 2.1/E | No description available  
2.1/F | No description available  
  
Done loading forcefield  

> clipper associate #1 toModel #2.1

> set bgColor white

No template found for residue A247 (PRO)  

Adding hydrogens  
Summary of feedback from adding hydrogens to mnosym-init-001.pdb #2.1  
---  
notes | No usable SEQRES records for mnosym-init-001.pdb (#2.1) chain A;
guessing termini instead  
No usable SEQRES records for mnosym-init-001.pdb (#2.1) chain B; guessing
termini instead  
No usable SEQRES records for mnosym-init-001.pdb (#2.1) chain C; guessing
termini instead  
No usable SEQRES records for mnosym-init-001.pdb (#2.1) chain D; guessing
termini instead  
No usable SEQRES records for mnosym-init-001.pdb (#2.1) chain E; guessing
termini instead  
1 messages similar to the above omitted  
Chain-initial residues that are actual N termini: /A LEU 198, /B SER 197, /C
ASN 199, /D GLU 196, /E GLU 196, /F ASN 199  
Chain-initial residues that are not actual N termini: /A ASP 725, /B ASP 725,
/C ILE 437, /C ASP 725, /D ASP 725, /E ASP 725, /F ASP 725  
Chain-final residues that are actual C termini:  
Chain-final residues that are not actual C termini: /A ARG 772, /A SER 718, /B
PHE 771, /B SER 718, /C PHE 773, /C LEU 429, /C SER 718, /D ARG 772, /D SER
718, /E ARG 772, /E SER 718, /F GLY 767, /F SER 718  
2330 hydrogen bonds  
Adding 'H' to /A ASP 725  
Adding 'H' to /B ASP 725  
Adding 'H' to /C ILE 437  
Adding 'H' to /C ASP 725  
Adding 'H' to /D ASP 725  
2 messages similar to the above omitted  
/A ARG 772 is not terminus, removing H atom from 'C'  
/A SER 718 is not terminus, removing H atom from 'C'  
/B PHE 771 is not terminus, removing H atom from 'C'  
/B SER 718 is not terminus, removing H atom from 'C'  
/C PHE 773 is not terminus, removing H atom from 'C'  
8 messages similar to the above omitted  
26806 hydrogens added  
  
Traceback (most recent call last):  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 591, in __init__  
isolde.forcefield_mgr)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 1310, in __init__  
sim_params, residue_templates)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 1406, in
_create_openmm_system  
sys = forcefield.createSystem(top, **system_params)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/simtk/openmm/app/forcefield.py", line 1141, in createSystem  
raise ValueError('No template found for residue %d (%s). %s' % (res.index+1,
res.name, _findMatchErrors(self, res)))  
ValueError: No template found for residue 1 (PRO). The set of atoms is similar
to TRUNC_CD, but it is missing 6 hydrogen atoms.  
  
During handling of the above exception, another exception occurred:  
  
Traceback (most recent call last):  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/isolde.py", line 2676, in _start_sim_or_toggle_pause  
self.start_sim()  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/isolde.py", line 2696, in start_sim  
self.params, self.sim_params, excluded_residues = self.ignored_residues)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 597, in __init__  
self._parse_auto_template_error(e)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 633, in
_parse_auto_template_error  
self.isolde._handle_bad_template(residue)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/isolde.py", line 2788, in _handle_bad_template  
self.start_sim()  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/isolde.py", line 2706, in start_sim  
sm.start_sim()  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 653, in start_sim  
sh.start_sim()  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 1552, in start_sim  
self._prepare_sim()  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 1497, in
_prepare_sim  
self.initialize_implicit_solvent(params)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/isolde/openmm/openmm_interface.py", line 2738, in
initialize_implicit_solvent  
gbforce.addParticles(params)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/simtk/openmm/openmm.py", line 9186, in <lambda>  
__getattr__ = lambda self, name: _swig_getattr(self, CustomGBForce, name)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/simtk/openmm/openmm.py", line 74, in _swig_getattr  
return _swig_getattr_nondynamic(self, class_type, name, 0)  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/simtk/openmm/openmm.py", line 69, in _swig_getattr_nondynamic  
return object.__getattr__(self, name)  
AttributeError: type object 'object' has no attribute '__getattr__'  
  
AttributeError: type object 'object' has no attribute '__getattr__'  
  
File
"/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/simtk/openmm/openmm.py", line 69, in _swig_getattr_nondynamic  
return object.__getattr__(self, name)  
  
See log for complete Python traceback.  
  




OpenGL version: 4.1 ATI-3.8.24
OpenGL renderer: AMD Radeon HD - FirePro D300 OpenGL Engine
OpenGL vendor: ATI Technologies Inc.

Change History (5)

comment:1 by Eric Pettersen, 5 years ago

Component: UnassignedThird Party
Owner: set to Tristan Croll
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionProblem handling bad template

comment:2 by Tristan Croll, 5 years ago

Resolution: fixed
Status: assignedclosed

While this particular error has been fixed for a while, I'd like to try to improve the handling of situations like this in future. It's a bit fiddly due to the way OpenMM is structured: I create the topology, submit the whole thing to OpenMM for simulation, then if there's a failure (it can't automatically find a suitable template/finds multiple matching templates, or the template my code assigned by residue name doesn't match the topology) I need to parse the exception text to figure out what's happened. That's not really ideal for quite a few reasons, but to do it properly will likely take a lot of extra work. Not exactly sure *what's* wrong with this particular proline - seems *really* mangled.

comment:3 by Eric Pettersen, 5 years ago

It would be nice If OpenMM didn't simply throw ValueError, but instead threw a subclass of ValueError (in this case, perhaps NoResTemplateError) so that higher-level code has a chance of reacting to different errors in different ways without having to parse actual error-message strings (which are in no way guaranteed not to change).

in reply to:  4 ; comment:4 by Tristan Croll, 5 years ago

It's worse than that - even if the exception itself was customised, I'd 
*still* have to parse the error text, because the point where execution 
enters code I have no direct control over is at OpenMM's 
`ForceField.createSystem()` - which, as the name might imply, takes the 
already-generated topology as an input. So by the time the exception 
gets back to me I have no information about what stage of its execution 
it had gotten to, except what's there in the error string.

I saw a while back that they'd put out a call for feedback on how future 
OpenMM development might better serve the community 
(https://twitter.com/jchodera/status/1226497923309088769?s=20) - I think 
I'll head over there and make some suggestions about improvements to 
suit this sort of interactive application.

On 2020-06-03 17:05, ChimeraX wrote:

in reply to:  5 ; comment:5 by Tristan Croll, 5 years ago

... huh. Now that I actually look at forcefield.py again, there are two 
public methods `getMatchingTemplates` and `getUnmatchedResidues` that do 
almost exactly what I want... although it would still be better if they 
were rolled into one method to avoid looping over everything twice. I've 
suggested that to them, but meanwhile I'll adjust my code - this should 
make handling *much* easier.

On 2020-06-03 17:18, ChimeraX wrote:
Note: See TracTickets for help on using tickets.