Problem with addh command in Python script

Hi everyone, I am trying to add hydrogen using the command addh. I am using the command in a python script in this form runCommand("addh spec #0 hbond true") or runCommand("addh hbond true") both gives a "KeyError: <_molecule.Atom object at 0x7fa2d115c180>" But deleting hydrogen with this command works runCommand("delete element.H") I have attached the full error report below. Could anyone please help me with this. Thanks in advance, Abhik "Traceback (most recent call last): File "/home/amukhopadhyay/anaconda3/envs/chimera/bin/pychimera", line 4, in <module> __import__('pkg_resources').run_script('pychimera==0.2.1', 'pychimera') File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1469, in run_script exec(script_code, namespace, namespace) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/site-packages/pychimera-0.2.1-py2.7.egg/EGG-INFO/scripts/pychimera", line 12, in <module> File "build/bdist.linux-x86_64/egg/pychimera/__main__.py", line 6, in run # All rights reserved. This software provided pursuant to a File "build/bdist.linux-x86_64/egg/pychimera/core.py", line 290, in main File "build/bdist.linux-x86_64/egg/pychimera/core.py", line 259, in run_cli_options File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/runpy.py", line 252, in run_path return _run_module_code(code, init_globals, run_name, path_name) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/runpy.py", line 82, in _run_module_code mod_name, mod_fname, mod_loader, pkg_name) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "chimera_remove_add_hydrogen.py", line 16, in <module> rc("addh spec #0 hbond true") File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/chimera/__init__.py", line 2796, in runCommand makeCommand(*args, **kw) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/Midas/midas_text.py", line 69, in makeCommand f(c, args) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/ChimeraExtension.py", line 40, in cmdAddH specInfo=[("spec", "molecules", "molecules")]) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/Midas/midas_text.py", line 451, in doExtensionFunc extFunc(*tuple(processedArgs), **kw) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/__init__.py", line 1006, in cmdAddH addHFunc(molecules, inIsolation=inIsolation, **protSchemes) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/__init__.py", line 554, in hbondAddHydrogens idatmType, hisNs, coordinations, inIsolation) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/hbond.py", line 386, in addHydrogens if d not in finished and _typeInfo(d).geometry == 4: File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/hbond.py", line 1403, in _typeInfo return typeInfo4Atom[atom] KeyError: <_molecule.Atom object at 0x7fa2d115c180> "

Hi Abhik, There is something unusual or incorrect about your structure, and Chimera cannot determine one or more of the atom types for atoms in it. Please use Help→Report A Bug in the Chimera menus to submit a bug report and attach the file for the structure that is producing this error and we can take it from there. --Eric Eric Pettersen UCSF Computer Graphics Lab
On Oct 21, 2021, at 7:05 AM, Abhik Mukhopadhyay via Chimera-users <chimera-users@cgl.ucsf.edu> wrote:
Hi everyone,
I am trying to add hydrogen using the command addh. I am using the command in a python script in this form
runCommand("addh spec #0 hbond true") or runCommand("addh hbond true") both gives a "KeyError: <_molecule.Atom object at 0x7fa2d115c180>"
But deleting hydrogen with this command works
runCommand("delete element.H")
I have attached the full error report below. Could anyone please help me with this.
Thanks in advance, Abhik
"Traceback (most recent call last): File "/home/amukhopadhyay/anaconda3/envs/chimera/bin/pychimera", line 4, in <module> __import__('pkg_resources').run_script('pychimera==0.2.1', 'pychimera') File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1469, in run_script exec(script_code, namespace, namespace) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/site-packages/pychimera-0.2.1-py2.7.egg/EGG-INFO/scripts/pychimera", line 12, in <module>
File "build/bdist.linux-x86_64/egg/pychimera/__main__.py", line 6, in run # All rights reserved. This software provided pursuant to a File "build/bdist.linux-x86_64/egg/pychimera/core.py", line 290, in main File "build/bdist.linux-x86_64/egg/pychimera/core.py", line 259, in run_cli_options File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/runpy.py", line 252, in run_path return _run_module_code(code, init_globals, run_name, path_name) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/runpy.py", line 82, in _run_module_code mod_name, mod_fname, mod_loader, pkg_name) File "/home/amukhopadhyay/anaconda3/envs/chimera/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "chimera_remove_add_hydrogen.py", line 16, in <module> rc("addh spec #0 hbond true") File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/chimera/__init__.py", line 2796, in runCommand makeCommand(*args, **kw) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/Midas/midas_text.py", line 69, in makeCommand f(c, args) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/ChimeraExtension.py", line 40, in cmdAddH specInfo=[("spec", "molecules", "molecules")]) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/Midas/midas_text.py", line 451, in doExtensionFunc extFunc(*tuple(processedArgs), **kw) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/__init__.py", line 1006, in cmdAddH addHFunc(molecules, inIsolation=inIsolation, **protSchemes) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/__init__.py", line 554, in hbondAddHydrogens idatmType, hisNs, coordinations, inIsolation) File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/hbond.py", line 386, in addHydrogens if d not in finished and _typeInfo(d).geometry == 4: File "/home/amukhopadhyay/.local/UCSF-Chimera64-1.15rc/share/AddH/hbond.py", line 1403, in _typeInfo return typeInfo4Atom[atom] KeyError: <_molecule.Atom object at 0x7fa2d115c180> " _______________________________________________ Chimera-users mailing list: Chimera-users@cgl.ucsf.edu Manage subscription: https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
participants (2)
-
Abhik Mukhopadhyay
-
Eric Pettersen