selection.mutate() — mutate selected residues

This command mutates the selected residues to the type specified by residue_type. CHARMM 4-character residue type names are used (see library file $RESTYP_LIB). All of the residues with at least one selected atom are mutated. To produce mutants, employ this command with alignment.append_model() and alignment.write(). It is usually necessary to write the mutated sequence out and read it in before proceeding, because not all sequence related information about the model is changed by this command (e.g., internal coordinates, charges, and atom types and radii are not updated).

Example: examples/commands/

# Example for: selection.mutate()

# This will read a PDB file, change its sequence a little, build new
# coordinates for any of the additional atoms using only the internal
# geometry, and write the mutant PDB file.  It can be seen as primitive
# but rapid comparative modeling for substitution mutants. For more
# sophisticated modeling, see
# For insertion and deletion mutants, follow the standard comparative
# modeling procedure.

from modeller import *

env = environ() = ['../atom_files']

# Read the topology library with non-hydrogen atoms only:'$(LIB)/top_heav.lib')
# To produce a mutant with all hydrogens, uncomment this line:'$(LIB)/top_allh.lib')

# Read the CHARMM parameter library:'$(LIB)/par.lib')

# Read the original PDB file and copy its sequence to the alignment array:
code = '1fas'
aln = alignment(env)
mdl = model(env, file=code)
aln.append_model(mdl, atom_files=code, align_codes=code)

# Select the residues to be mutated: in this case all ASP residues:
sel = selection(mdl).only_residue_types('ASP')

# The second example is commented out; it selects residues '1' and '10'.
#sel = selection(mdl.residues['1'], mdl.residues['10'])

# Mutate the selected residues into HIS residues (neutral HIS):

# Add the mutated sequence to the alignment arrays (it is now the second
# sequence in the alignment):
aln.append_model(mdl, align_codes='1fas-1')

# Generate molecular topology for the mutant:

# Transfer all the coordinates you can from the template native structure
# to the mutant (this works even if the order of atoms in the native PDB
# file is not standard):

# Build the remaining unknown coordinates for the mutant:, build_method='INTERNAL_COORDINATES')

# Write the mutant to a file:

Automatic builds 2017-02-17