next up previous contents index
Next: alignment.append_sequence() add Up: The alignment class: comparison Previous: alignment.compare_with() compare   Contents   Index

alignment.append_model() -- copy model sequence and coordinates to alignment

append_model(mdl, align_codes, atom_files='')
This command adds the sequence and coordinates of the given model, mdl, to the end of the current alignment.

You should additionally set align_codes and atom_files to the PDB ID and file name, respectively. This information is added to the alignment with the new sequence. (Alternatively, you can set this information later by setting alnsequence.code and alnsequence.atom_file.)

Example: examples/commands/aln_append_model.py


# This demonstrates one way to generate an initial alignment between two
# PDB sequences. It can later be edited by hand.

# Set Modeller environment (including search patch for model.read())
from modeller import *
env = environ()
env.io.atom_files_directory = "./:../atom_files/"

# Create a new empty alignment and model:
aln = alignment(env)
mdl = model(env)

# Read the whole 1fdx atom file
code='1fdx'
mdl.read(file=code, model_segment=('FIRST:@', 'END:'))

# Add the model sequence to the alignment
aln.append_model(mdl, align_codes=code, atom_files=code)

# Read 5fd1 atom file from 1-63, and add to alignment
code='5fd1'
mdl.read(file=code, model_segment=('1:', '63:'))
aln.append_model(mdl, align_codes=code, atom_files=code)

# Align them by sequence
aln.malign(gap_penalties_1d=(-500, -300))
aln.write(file='fer1-seq.ali')

# Align them by structure
aln.malign3d(gap_penalties_3d=(0.0, 2.0))

# check the alignment for its suitability for modeling
aln.check()

aln.write(file='fer1.ali')



Ben Webb 2008-02-01