#
The `alignment` class: comparison of sequences and structures

This section describes the commands for reading, writing, making, analyzing and using the alignments of sequences and structures (pairwise and multiple). For the underlying dynamic programming methods see Section A.1.

An `alignment` object acts like a regular Python list, where each element in the list represents a sequence in the alignment, as a `Sequence` object (see Section 6.17). The list can be indexed in standard Python fashion or by alignment code. Thus, given an `alignment` object `aln`, `len(aln)` gives the number of sequences in the alignment, `aln[0]` the first sequence, `aln[-1]` the last sequence, and `aln['1abcA']` the sequence with alignment code '1abcA'.

Subsections

- alignment() — create a new alignment
- alignment.comments — alignment file comments
- alignment.positions — list of residue-residue alignment positions (including gaps)
- alignment.append() — read sequences and/or their alignment
- alignment.clear() — delete all sequences from the alignment
- alignment.read_one() — read sequences one by one from a file
- alignment.check_structure_structure() — check template structure superpositions
- alignment.check_sequence_structure() — check sequence/structure alignment for sanity
- alignment.check() — check alignment for modeling
- alignment.compare_with() — compare two alignments
- alignment.append_model() — copy model sequence and coordinates to alignment
- alignment.append_sequence() — add a sequence from one-letter codes
- alignment.append_profile() — add profile sequences to the alignment
- alignment.write() — write sequences and/or their alignment
- alignment.edit() — edit overhangs in alignment
- alignment.describe() — describe proteins
- alignment.id_table() — calculate percentage sequence identities
- alignment.compare_sequences() — compare sequences in alignment
- alignment.align() — align two (blocks of) sequences
- alignment.align2d() — align sequences with structures
- alignment.malign() — align two or more sequences
- alignment.consensus() — consensus sequence alignment
- alignment.compare_structures() — compare 3D structures given alignment
- alignment.align3d() — align two structures
- alignment.malign3d() — align two or more structures
- alignment.salign() — align two or more sequences/structures of proteins
  - Features of proteins used for alignment
  - Alignment of protein sequences
  - Alignment of protein structures with sequences
  - Alignment of protein structures
  - Sub-optimal alignments
  - Alignments using external restraints
  - Gap penalties and correcting for gaps
  - Useful SALIGN information and commands
- alignment.get_suboptimals() — parse suboptimal alignments file
- alignment.to_profile() — convert alignment to profile format
- alignment.segment_matching() — align segments