Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements #121

Merged
merged 4 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion devtools/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ requirements:
- networkx
- rdkit
- ambertools
- openforcefield==0.8.0
- openforcefield==0.8.3

about:
home: https://github.com/martimunicoy/peleffy
Expand Down
2 changes: 1 addition & 1 deletion devtools/envs/standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dependencies:
- coverage < 5.0
- ambertools
- rdkit
- openforcefield ==0.8.0
- openforcefield ==0.8.3
4 changes: 4 additions & 0 deletions docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ New features
""""""""""""
- `PR #117 <https://github.com/martimunicoy/peleffy/pull/117>`_: New method to assign external partial charges.
- `PR #118 <https://github.com/martimunicoy/peleffy/pull/118>`_: New method to load parameters from an Impact Template.
- `PR #119 <https://github.com/martimunicoy/peleffy/pull/119>`_: Adds explanatory error message when using an invalid Impact Template in the from_impact_template method.
- `PR #119 <https://github.com/martimunicoy/peleffy/pull/119>`_: Supports Openforcefield-0.8.3 .


Tests added
"""""""""""
- `PR #117 <https://github.com/martimunicoy/peleffy/pull/117>`_: Adds tests to validate the MAE parse for external partial charges.
- `PR #118 <https://github.com/martimunicoy/peleffy/pull/118>`_: Adds tests to validate the new method to load parameters from an Impact Template.
- `PR #119 <https://github.com/martimunicoy/peleffy/pull/119>`_: Adds tests for the new error message when using an invalid Impact Template in the from_impact_template method.


1.1.0 - Improvements in parameterization API, OBC template for OPLS2005 and Molecule initializators
Expand Down
7 changes: 7 additions & 0 deletions peleffy/forcefield/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,13 @@ def reindex_atom_idx(list_params, dict_index):
ordered_pdb_atom_names = [pdb_name.replace(' ', '_') for pdb_name in
molecule.get_pdb_atom_names()]

# Check up that the Molecule representation and the Impact template
# represent the same chemical entity
if not set(ordered_pdb_atom_names) == set(atom_names_list):
raise ValueError(
"The Impact template file {} ".format(impact_template_path) +
"does not represent the same chemical entity as the molecule.")

# Molecule object and Impact template have the atoms in the same order
if ordered_pdb_atom_names == atom_names_list:
# Assign parameters from Impact template to the BaseParameterWrapper
Expand Down
12 changes: 10 additions & 2 deletions peleffy/tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,17 @@ def test_generate_OPLS2005ParameterWrapper(molecule,
# Load molecule, parameterize and generate Impact template
molecule = Molecule(smiles='c1c(c(n(n1)S(=O)(=O)C))O')
impact_template_path = get_data_file_path('tests/unlz')
# Test from_impact_template method
test_generate_OpenForceFieldParameterWrapper(molecule,
impact_template_path)
impact_template_path)

# The molecule and Impact template do no represent the same chemical
# entity
with pytest.raises(ValueError):
pdb_path = get_data_file_path('ligands/ethylene.pdb')
molecule = Molecule(pdb_path, tag='ETL')
impact_template_path = get_data_file_path('tests/metz')
test_generate_OpenForceFieldParameterWrapper(molecule,
impact_template_path)


class TestBonds(object):
Expand Down