Fixing NME in #180 by fallback logics instead of additional information from chem template #185
+1,048
−796
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR offers two types of fallback logics to handle systems with modified residues that aren't fully compliant with the template reaction and/or the expected adjacent molecule SMARTS. Additional information from chem template is not required.
Here the fallback options are explained with NME as an example:
(1) While making a padded NME
NME is the target residue molecule. It's only being padded on the N-term side. However, the template reaction smarts requires more than NME can offer as the reactant.
In this case, the MCS (maximum common substructure) of NME and the template reactant will be computed. The non-common part of the reactant will be dropped. The MCS will be accepted as a fallback reactant as long as the required atom from adjacent molecule is present. The following information will be printed to standard output:
(2) While making a padded residue with NME
NME is the adjacent residue molecule. It's used as source of atom positions to pad the C-term of its previous residue. However, the template adjacent res SMARTS requires more than NME can offer as the adjacent mol.
In this case, only one fallback option will be considered which is to drop the unmapped atoms from adjacent res SMARTS, as these atoms won't be used as source of atom positions anyways. The following information will be printed to standard output:
Apart from the fallback logics, the refactoring includes the following aspects:
Overall, I think this PR is better than what I previously suggested (#184 (comment)) and can be useful for other nonstandard residues not just NME. The changes shouldn't change the behaviors of handling standard residues and it doesn't require further updates of chem templates (not sure why GitHub marked the diff..).
@diogomart Could you please take a look at the changes at your convenience, and let me know what you think?
As an example (original PDB file of 2G5Z):
2g5z.pdb.txt
It has a nonstandard residue DHA at B:66 and a broken ILE at B:229.
Command
Standard Output
Output PDBQT:
2g5z.pdbqt.txt