Hello all,I'm using modeller to mutate a single residue in a PDB template that contains ZN atoms.
The mutation is taking place correctly, but the resulting PDB is written with the name ZN instead of ZN2, which is in the original template. My ZN is in a different coordination state and I need the name to stay ZN2 in the mutated structure.
I have tried setting env.io.heatatm = True, but the outcome is the same.
Is there a way to explicitly set modeller to leave the atom names untouched?
Thanks in advance for any help.
Pedro
Here is my code:
env = environ()
env.io.atom_files_directory = ['.', './atom_files']
env.libs.topology.read(file='$(LIB)/top_heav.lib')
env.libs.parameters.read(file='$(LIB)/par.lib')
env.io.hetatm = True
#Prepare Modeller
mdl = model(self.env, file=pdb_file)
aln = alignment(self.env)
aln.append_model(mdl, atom_files=pdb_file, align_codes=pdb_file)
chain_id, res_id = mutatnt.split(":")
pointmut = f'{res_id}:{chain_id}'
new_residue = "A"
sel = selection(mdl.residues[pointmut])
sel.mutate(residue_type=self.res1to3[new_residue]) #mutate
# Generate the mutated model
aln.append_model(mdl, align_codes='mut')
mdl.clear_topology()
mdl.generate_topology(aln['mut'])
mdl.transfer_xyz(aln)
mdl.build(initialize_xyz=False, build_method='INTERNAL_COORDINATES')
mdl2 = model(self.env, file=pdb_file)
mdl.res_num_from(mdl2,aln)
# Write the mutated structure to a PDB file
mdl.write(file=output_file, model_format='PDB')