Bio.Align.chain module

Bio.Align support for the “chain” pairwise alignment format.

As described by UCSC, a chain file stores a series of pairwise alignments in a single file. Typically they are used for genome to genome alignments. Chain files store the lengths of the aligned segments, alignment gaps, and alignment scores, but do not store the aligned sequences.

See https://genome.ucsc.edu/goldenPath/help/chain.html.

You are expected to use this module via the Bio.Align functions.

Coordinates in the chain file format are defined in terms of zero-based start positions (like Python) and aligning region sizes.

class Bio.Align.chain.AlignmentWriter(target)

Bases: AlignmentWriter

Alignment file writer for the UCSC chain file format.

fmt: str | None = 'chain'
format_alignment(alignment)

Return a string with one alignment formatted as a chain block.

__abstractmethods__ = frozenset({})
class Bio.Align.chain.AlignmentIterator(source)

Bases: AlignmentIterator

Alignment iterator for UCSC chain files.

Each chain block in the file contains one pairwise alignment, which are loaded and returned incrementally. The alignment score is scored as an attribute of the alignment; the ID is stored under the key “id” in the dictionary referred to by the annotations attribute of the alignment.

fmt: str | None = 'chain'
__abstractmethods__ = frozenset({})