next up previous contents index
Next: alignment.describe() describe Up: The alignment class: comparison Previous: alignment.write() write   Contents   Index

alignment.edit() -- edit overhangs in alignment

edit(overhang, edit_align_codes, base_align_codes, min_base_entries, io=None)
This command edits the overhangs in the alignment.

edit_align_codes specifies the alignment codes for the alignment entries whose overhangs are to be cut; in addition, all or last can be used.

base_align_codes specifies the alignment codes for the alignment entries that are used to determine the extent of the overhangs to be cut from the edited entries; in addition, all or rest (relative to edit_align_codes) can be used.

The same entries can be cut and used for determining the base.

The base of the alignment is determined by the first and last alignment positions that have at least min_base_entries entries that started by that position, beginning from the first and last alignment positions, respectively.

The cuts are shortened by overhang residues respectively, so that reasonably short termini can be easily modeled ab initio if desired.

The io argument is used because the beginning and ending residue numbers for the `structure' entries in the alignment are renumbered automatically by reading the appropriate atom files.

Example: examples/commands/edit_alignment.py


# Example for: alignment.edit()

# Read an alignment, write it out in the 'PAP' format, with overhangs cut.

from modeller import *

log.level(1, 1, 1, 1, 0)
env = environ()
env.io.atom_files_directory = ['.', '../atom_files']

aln = alignment(env, file='overhang.ali', align_codes='all',
                alignment_format='PIR')

# Cut overhangs in the 1is4 sequence that are longer than 3 residues
# relative to the longest remaining entry in the alignment:
aln.edit(edit_align_codes='1is4', base_align_codes='rest',
         min_base_entries=1, overhang=3)
aln.write(file='overhang-1.pir', alignment_format='PIR')
aln.write(file='overhang-1.pap', alignment_format='PAP')


next up previous contents index
Next: alignment.describe() describe Up: The alignment class: comparison Previous: alignment.write() write   Contents   Index
Ben Webb 2008-05-05