rmcgibbo / openmm-cmd

OpenMM Command Line Application
7 stars 3 forks source link

Cryptic error when initializing using config file #14

Closed leeping closed 10 years ago

leeping commented 10 years ago

Hi Robert,

Running the OpenMM command line app with the config file produced the following error. I attached the inputs. Over the next few days, it seems we might want to iron out the config file parsing before posting the public beta.

https://dl.dropboxusercontent.com/u/5381783/input.tar.gz

leeping@not0rious:~/projects/VSP27-Protein/W4P/Induced-O/Test-Dynamics$ openmm --config config.ini 
Traceback (most recent call last):
  File "/home/leeping/local/bin/openmm", line 5, in <module>
    pkg_resources.run_script('openmm==0.1', 'openmm')
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 489, in run_script
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1207, in run_script
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/EGG-INFO/scripts/openmm", line 1072, in <module>
    openmm.initialize()
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/EGG-INFO/scripts/openmm", line 696, in initialize
    self.initialize_configured_classes()
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/openmmapplication.py", line 210, in initialize_configured_classes
    instantiated = klass(config=self.config)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/openmmapplication.py", line 378, in __init__
    super(AppConfigurable, self).__init__(config=config)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/configurable.py", line 99, in __init__
    self.config = config
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 317, in __set__
    obj._notify_trait(self.name, old_value, new_value)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 467, in _notify_trait
    c(name, old_value, new_value)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/configurable.py", line 171, in _config_changed
    self._load_config(new, traits=traits, section_names=section_names)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/configurable.py", line 155, in _load_config
    setattr(self, name, deepcopy(config_value))
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 313, in __set__
    new_value = self._validate(obj, value)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 321, in _validate
    return self.validate(obj, value)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 1222, in validate
    value = super(Container, self).validate(obj, value)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 806, in validate
    self.error(obj, value)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 638, in error
    self.info(), msg)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 813, in info
    result = class_of(klass)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 97, in class_of
    return add_article( object )
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/openmmapplication.py", line 56, in _traitlets_add_article
    return _super_traitlets_add_article(object)
  File "/home/leeping/local/lib/python2.7/site-packages/openmm-0.1-py2.7.egg/ipcfg/IPython/traitlets.py", line 106, in add_article
    if name[:1].lower() in 'aeiou':
TypeError: 'type' object has no attribute '__getitem__'
rmcgibbo commented 10 years ago

I fixed the error with 25a98ae. Your example now gives the error

>>> system = forcefield.createSystem(topology,nonbondedMethod=PME,constraints=HBonds
... ,rigidWater=True,nonbondedCutoff=1.0*nanometer,useDispersionCorrection=True,vdwC
... utoff=1.0*nanometer,polarization=mutual,polar_eps=1e-05,ewaldErrorTolerance=0.00
... 05)
Traceback (most recent call last):
  File "/home/rmcgibbo/.pythonbrew/venvs/Python-2.7.3/sci/bin/openmm", line 7, in <module>
    execfile(__file__)
  File "/home/rmcgibbo/projects/openmm-cmd/openmm", line 1069, in <module>
    openmm.start()
  File "/home/rmcgibbo/projects/openmm-cmd/openmm", line 844, in start
    system = forcefield.createSystem(topology, **system_options)
  File "/home/rmcgibbo/.pythonbrew/venvs/Python-2.7.3/sci/lib/python2.7/site-packages/simtk/openmm/app/forcefield.py", line 328, 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 (HOH).  The set of atoms is similar to HOH, but it is missing 1 extra particles.  You can add them with Modeller.addExtraParticles().
leeping commented 10 years ago

Perfect, that is the error I wanted it to have. :)

rmcgibbo commented 10 years ago

Okay. Closing this then.

rmcgibbo commented 10 years ago

Oops. Sorry.