Bio.Align.maf module

Bio.Align support for the “maf” multiple alignment format.

The Multiple Alignment Format, described by UCSC, stores a series of multiple alignments in a single file. It is suitable for whole-genome to whole-genome alignments, metadata such as source chromosome, start position, size, and strand can be stored.

See http://genome.ucsc.edu/FAQ/FAQformat.html#format5

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

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

A minimal aligned region of length one and starting at first position in the source sequence would have start == 0 and size == 1.

As we can see on this example, start + size will give one more than the zero-based end position. We can therefore manipulate start and start + size as python list slice boundaries.

class Bio.Align.maf.AlignmentWriter(target)

Bases: Bio.Align.interfaces.AlignmentWriter

Accepts Alignment objects, writes a MAF file.

fmt: Optional[str] = 'MAF'
write_header(stream, alignments)

Write the MAF header.

format_alignment(alignment)

Return a string with a single alignment formatted as a MAF block.

__abstractmethods__ = frozenset({})
__annotations__ = {'fmt': 'Optional[str]'}
class Bio.Align.maf.AlignmentIterator(source)

Bases: Bio.Align.interfaces.AlignmentIterator

Alignment iterator for Multiple Alignment Format files.

The file may contain multiple concatenated alignments, which are loaded and returned incrementally.

File meta-data are stored in the .metadata attribute of the returned iterator. Alignment annotations are stored in the .annotations attribute of the Alignment object, except for the alignment score, which is stored as an attribute. Sequence information of empty parts in the alignment block (sequences that connect the previous alignment block to the next alignment block, but do not align to the current alignment block) is stored in the alignment annotations under the "empty" key. Annotations specific to each line in the alignment are stored in the .annotations attribute of the corresponding sequence record.

fmt: Optional[str] = 'MAF'
status_characters = ('C', 'I', 'N', 'n', 'M', 'T')
empty_status_characters = ('C', 'I', 'M', 'n')
__abstractmethods__ = frozenset({})
__annotations__ = {'fmt': 'Optional[str]'}