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

Fixing NME in #180 by fallback logics instead of additional information from chem template #185

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

rwxayheee
Copy link

@rwxayheee rwxayheee commented Oct 4, 2024

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:

target_mol ([H]NC([H])([H])[H]) is not fully compliant with the template rxn ([C:1](=[O:2])[C:3][N:4]>>[C:1](=[O:2])[C:3][N:4][C:11](=[O:12])[C:13])...
Switched from Template rxn ([C:1](=[O:2])[C:3][N:4]>>[C:1](=[O:2])[C:3][N:4][C:11](=[O:12])[C:13]) to Fallback rxn ([#6:3]-[#7:4]>>[C:3][N:4][C:11](=[O:12])[C:13])

(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:

adjacent_mol ([H]NC([H])([H])[H]) is not fully compliant with the template adjacent_smarts (C(=O)[C:11][N:12])...
Switched from Template adjacent mol (C(=O)[C:11][N:12]) to Fallback adjacent mol ([C:11][N:12])

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

mk_prepare_receptor.py --pdb 2g5z.pdb --delete_residues B:66,229 --output_filename 2g5z --skip_gpf

Standard Output

[00:13:35] product atom-mapping number 11 not found in reactants.
[00:13:35] product atom-mapping number 12 not found in reactants.
[00:13:35] product atom-mapping number 11 not found in reactants.
[00:13:35] product atom-mapping number 12 not found in reactants.
[00:13:35] product atom-mapping number 13 not found in reactants.
adjacent_mol ([H]NC([H])([H])[H]) is not fully compliant with the template adjacent_smarts (C(=O)[C:11][N:12])...
Switched from Template adjacent mol (C(=O)[C:11][N:12]) to Fallback adjacent mol ([C:11][N:12])
target_mol ([H]NC([H])([H])[H]) is not fully compliant with the template rxn ([C:1](=[O:2])[C:3][N:4]>>[C:1](=[O:2])[C:3][N:4][C:11](=[O:12])[C:13])...
Switched from Template rxn ([C:1](=[O:2])[C:3][N:4]>>[C:1](=[O:2])[C:3][N:4][C:11](=[O:12])[C:13]) to Fallback rxn ([#6:3]-[#7:4]>>[C:3][N:4][C:11](=[O:12])[C:13])
[00:13:35] product atom-mapping number 11 not found in reactants.
[00:13:35] product atom-mapping number 12 not found in reactants.
[00:13:35] product atom-mapping number 13 not found in reactants.

Files written:
2g5z.pdbqt <-- static (i.e., rigid) receptor input file

Output PDBQT:
2g5z.pdbqt.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant