Skip to content

Commit

Permalink
Fix #1579 (#1589)
Browse files Browse the repository at this point in the history
* fix #1579 and add test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update file names and release history

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
j-wags and pre-commit-ci[bot] authored Apr 26, 2023
1 parent 22d0ae0 commit 110ba6f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Releases follow the `major.minor.micro` scheme recommended by [PEP440](https://w
### Behavior changes
- [PR #1569](https://github.com/openforcefield/openff-toolkit/pull/1569): Several instances of `Exception` being raised are now replaced with other exceptions being raised.

### Bugfixes
- [PR #1589](https://github.com/openforcefield/openff-toolkit/pull/1589): Fixes [Issue #1579](https://github.com/openforcefield/openff-toolkit/issues/1579), where Molecule.from_polymer_pdb could not handle NH2 caps at C termini.

### Improved documentation and warnings

- [PR #1564](https://github.com/openforcefield/openff-toolkit/pull1564) Improve documentation of conformer selection in `Molecule.assign_partial_charges()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6345,11 +6345,10 @@
]
},
"PEPTIDE_BOND": {
"[C:1](=[O:2])[N:3]([C:4])": [
"[C:1](=[O:2])[N:3]": [
"C",
"O",
"N",
"CA"
"N"
]
},
"DISULFIDE": {
Expand Down
21 changes: 21 additions & 0 deletions openff/toolkit/data/proteins/ace-ala-nh2.pdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ATOM 1 HH33 ACE A 0 -5.284 -2.981 5.320 1.00 0.00
ATOM 2 CH3 ACE A 0 -4.851 -3.877 5.426 1.00 0.00
ATOM 3 HH31 ACE A 0 -5.412 -4.481 6.144 1.00 0.00
ATOM 4 HH32 ACE A 0 -4.840 -4.406 4.474 1.00 0.00
ATOM 5 C ACE A 0 -3.431 -3.679 5.966 1.00 0.00
ATOM 6 O ACE A 0 -2.705 -2.809 5.481 1.00 0.00
ATOM 7 N ALA A 1 -2.983 -4.446 6.956 1.00 0.00
ATOM 8 CA ALA A 1 -1.682 -4.415 7.599 1.00 0.00
ATOM 9 CB ALA A 1 -1.818 -3.599 8.890 1.00 0.00
ATOM 10 C ALA A 1 -1.154 -5.834 7.868 1.00 0.00
ATOM 11 O ALA A 1 -1.891 -6.699 8.345 1.00 0.00
ATOM 12 H ALA A 1 -3.478 -5.294 6.716 1.00 0.00
ATOM 13 HA ALA A 1 -1.025 -3.946 6.994 1.00 0.00
ATOM 14 HB1 ALA A 1 -2.653 -3.055 8.848 1.00 0.00
ATOM 15 HB2 ALA A 1 -1.860 -4.221 9.669 1.00 0.00
ATOM 16 HB3 ALA A 1 -1.028 -2.996 8.983 1.00 0.00
ATOM 17 N NH2 A 2 0.110 -6.138 7.586 1.00 0.00
ATOM 18 HN1 NH2 A 2 0.717 -5.444 7.199 1.00 0.00
ATOM 19 HN2 NH2 A 2 0.453 -7.061 7.761 1.00 0.00
TER
END
10 changes: 10 additions & 0 deletions openff/toolkit/tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3955,6 +3955,16 @@ def test_molecule_from_pdb_name(self):
)
assert offmol.name == "bob"

def test_molecule_from_pdb_ace_ala_nh2(self):
offmol = Molecule.from_polymer_pdb(
get_data_file_path("proteins/ace-ala-nh2.pdb")
)
assert offmol.n_atoms == 19
expected_mol = Molecule.from_smiles("CC(=O)N[C@H](C)C(=O)N")
assert offmol.is_isomorphic_with(
expected_mol, atom_stereochemistry_matching=False
)

def test_molecule_from_pdb_mainchain_ala_tripeptide(self):
offmol = Molecule.from_polymer_pdb(
get_data_file_path("proteins/MainChain_ALA_ALA.pdb")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,10 @@ def _add_common_linkages(self):
"""

self.data["PEPTIDE_BOND"] = {
"[C:1](=[O:2])[N:3]([C:4])": [
"[C:1](=[O:2])[N:3]": [
"C",
"O",
"N",
"CA",
]
}
self.data["DISULFIDE"] = {
Expand Down

0 comments on commit 110ba6f

Please sign in to comment.