8000 Add docs on how to add templates for 9MXW · Issue #355 · forlilab/Meeko · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add docs on how to add templates for 9MXW #355

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

Open
diogomart opened this issue Apr 26, 2025 · 2 comments
Open

Add docs on how to add templates for 9MXW #355

diogomart opened this issue Apr 26, 2025 · 2 comments
Assignees

Comments

@diogomart
Copy link
Contributor

No description provided.

@rwxayheee
Copy link
Contributor
rwxayheee commented Apr 30, 2025

To add new padders, a small fix in #338 (e8d734b) is needed.
(Also #347 is not in my branch to run this example, but not sure if that matters)

Please consider this API example:

from meeko import Polymer, ResidueChemTemplates, MoleculePreparation
mk_prep = MoleculePreparation()
residue_chem_templates = ResidueChemTemplates.create_from_defaults()

# Update ambiguous residue templates
residue_chem_templates.ambiguous["LYS"].append("LYSiso") # to preserve order of existing templates
residue_chem_templates.ambiguous["ASN"].append("ASNiso")

# Add padders and templates
residue_chem_templates.add_dict({
    "padders": {
        "LYSiso-N-term": {
            "rxn_smarts": "[C:1]([C:7](=[O:8])[N:9])[C:2][C:3][C:4][C:5][N:6]>>[C:1]([C:7](=[O:8])[N:9])[C:2][C:3][C:4][C:5][N:6][C:11](=[O:12])[C:13]",
            "adjacent_res_smarts": "[C:11](=[O:12])[C:13][N]",
            "auto_blunt": False
        }, 
        "ASNiso-C-term": {
		"rxn_smarts": "[C:1]([C:7](=[O:8])[N:9])[C:2][C:3](=[O:4])>>[C:1]([C:7](=[O:8])[N:9])[C:2][C:3](=[O:4])[C:5][N:6]",
		"adjacent_res_smarts": "[C](=O)[C:5][N:6]",
            "auto_blunt": False
        }, 
    },
    "residue_templates":{
        "LYSiso": {
			"smiles": "C(=O)C([H])(N[H])C([H])([H])C([H])([H])C([H])([H])C([H])([H])N[H]",
			"atom_name": ["C", "O", "CA", "HA", "N", "H", "CB", "HB3", "HB2", "CG", "HG2", "HG3", "CD", "HD2", "HD3", "CE", "HE2", "HE3", "NZ", "HZ1"],
			"link_labels": {"0": "C-term", "4": "N-term", "18": "LYSiso-N-term"}
        },
        "ASNiso": {
			"smiles": "C(=O)C([H])(N[H])C([H])([H])C(=O)",
			"atom_name": ["C", "O", "CA", "HA", "N", "H", "CB", "HB2", "HB3", "CG", "OD1"],
			"link_labels": {"0": "C-term", "4": "N-term", "9": "ASNiso-C-term"}
        }
    }
})

# Input file
input_file = "9MXW.pdb"
with open(input_file, "r") as f:
    pdb_string = f.read()

# Construct the polymer object
polymer = Polymer.from_pdb_string(
    pdb_string,
    residue_chem_templates, 
    mk_prep, 
    default_altloc="A")

assert isinstance(polymer, Polymer), "Polymer object not created correctly"

@rwxayheee rwxayheee self-assigned this Apr 30, 2025
@rwxayheee
Copy link
Contributor
rwxayheee commented Apr 30, 2025

Note: In theory it's possible to reuse the "N-term" and "C-term" padders. However, the current "react_and_map" doesn't have a range to look for the reactant patterns so reusing "N-term" and "C-term" lead to incorrect products.

Therefore, to define isopeptide linkage like this example, the reaction smarts needs to be as specific as possible.

I can prepare a new post in the documentation with this example as an additional tutorial. But this can wait until the needed PR is merged and other related updates. The API example is provided for future reference.

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

No branches or pull requests

2 participants
0