choderalab / yank

An open, extensible Python framework for GPU-accelerated alchemical free energy calculations.
http://getyank.org
MIT License
179 stars 70 forks source link

Error in getting resname when passing a molecule on PDB format #576

Open GerardBCN opened 7 years ago

GerardBCN commented 7 years ago

I assume this problem occurs because utils.Mol2File is applied on my input, a pdb, instead of a mol2 file. Should the ligand always passed as mol2 file?

2016-11-22 17:11:51,492: MPI disabled.
2016-11-22 17:11:51,546: Setting up the systems for mol, water and vacuum
2016-11-22 17:11:55,673: WARNING - Yank.yamlbuild - TLeap: The unperturbed charge of the unit: 1.000001 is not zero.
2016-11-22 17:11:55,673: WARNING - Yank.yamlbuild - TLeap: The unperturbed charge of the unit: 1.000001 is not zero.
2016-11-22 17:11:57,519: WARNING - Yank.yamlbuild - TLeap: The unperturbed charge of the unit: 1.000001 is not zero.
2016-11-22 17:11:57,520: WARNING - Yank.yamlbuild - TLeap: The unperturbed charge of the unit: 1.000001 is not zero.
2016-11-22 17:11:58,047: Setting OpenCL platform to use precision model 'mixed'.
Traceback (most recent call last):
  File "run.py", line 3, in <module>
    Yank.cli.main('script --yaml=input.yaml')
  File "/shared/gerard/software/yank/Yank/cli.py", line 74, in main
    dispatched = getattr(commands, command).dispatch(command_args)
  File "/shared/gerard/software/yank/Yank/commands/script.py", line 59, in dispatch
    yaml_builder.build_experiments()
  File "/shared/gerard/software/yank/Yank/yamlbuild.py", line 1296, in build_experiments
    self._run_experiment(combination, output_dir)
  File "/shared/gerard/software/yank/Yank/yamlbuild.py", line 2357, in _run_experiment
    ligand_dsl = utils.Mol2File(ligand_descr['filepath']).resname
  File "/shared/gerard/software/yank/Yank/utils.py", line 1316, in resname
    return residue.name
AttributeError: 'Structure' object has no attribute 'name'
andrrizzi commented 7 years ago

Yes. Unfortunately the current automatic pipeline is only able to set up systems where the molecules to be alchemically modified is in formats .mol2, and .sdf that have a unique residue name.

If you are computing the hydration free energy of a small molecule, I'd suggest you to convert it to .mol2.

If you are dealing with a small peptide instead, you can use the prmtop/inpcrd files generated by the automatic pipeline before the error happened (they should be in the folder output/setup/systems/...) to specify your system with this syntax instead. Sorry this is just a temporary workaround, but we are planning to add support to alchemically modify peptides in the future.

jchodera commented 7 years ago

Also, note that the code is still highly experimental and we haven't fully validated it yet! We are working on building an automated validation set to verify correctness prior to a 1.0 release and paper. So use at your own risk!

GerardBCN commented 7 years ago

I see! Thanks! I did a fork of it and tweaked it a bit to accept my inputs. Seems to work just fine :) By the way, now that you mention validation sets, have you run any tests on solvation free energies? It is what I'm interested the most (for now) and I wonder with which accuracy you can reproduce experimental values for a given test case. Thank you!

andrrizzi commented 7 years ago

@GerardBCN so sorry for missing your last message! Yes we did some preliminary solvation free energy calculations and we have obtained good results so far. The validation was performed using PME with a small number of uncharged molecules though. We are putting together a more comprehensive validation set.