- 
                Notifications
    
You must be signed in to change notification settings  - Fork 64
 
(Fix #215) Update polymer/chorizo padded molecule with positions from adjacent residue when there are multiple bonds between a pair of residues #341
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
Conversation
(1) multiple bonds between two residues and with (2) all Hs and positions
| 
           In the original code, the padded_mol did not necessarily contain all hydrogens. Although the PR works, it requires all hydrogens, so it does not reproduce  And therefore it also breaks test  It seems like the tests (  | 
    
| 
           Closing this, while it technically works, it changes atom indexing and hydrogen count in a way that could affect many things down the line.  | 
    
| 
           I will give another try in the next few days. I was doing the additional   | 
    
| 
           Changed the logic in  Before the change, atoms added during the making of  from meeko import Polymer, ResidueChemTemplates, MoleculePreparation
from rdkit import Chem
mk_prep = MoleculePreparation()
residue_chem_templates = ResidueChemTemplates.create_from_defaults()
input_file = "disulfide_bridge_in_adjacent_residues.pdb"
with open(input_file, "r") as f:
    pdb_string = f.read()
polymer = Polymer.from_pdb_string(
    pdb_string,
    residue_chem_templates, 
    mk_prep)
assert isinstance(polymer, Polymer), "Polymer object not created correctly"
for res_id in polymer.monomers:
    if res_id in ["G:187", "G:188"]:
        padded_mol = polymer.monomers[res_id].padded_mol
        assert padded_mol is not None, f"Padded molecule for residue {res_id} is None"
        
        writer = Chem.SDWriter(f"padded_mol_{res_id}.sdf")
        writer.write(padded_mol)
        writer.close()        | 
    
No description provided.