Bio.Align.bigmaf module

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

The bigMaf format stores multiple alignments in a format compatible with the MAF (Multiple Alignment Format) format. BigMaf files are binary and are indexed as a bigBed file.

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

class Bio.Align.bigmaf.AlignmentWriter(target, targets=None, compress=True)

Bases: Bio.Align.bigbed.AlignmentWriter

Alignment file writer for the bigMaf file format.

fmt: Optional[str] = 'bigMaf'
__init__(target, targets=None, compress=True)

Create an AlignmentWriter object.

Arguments:
  • target - output stream or file name.

  • targets - A list of SeqRecord objects with the chromosomes in the

    order as they appear in the alignments. The sequence contents in each SeqRecord may be undefined, but the sequence length must be defined, as in this example:

    SeqRecord(Seq(None, length=248956422), id=”chr1”)

    If targets is None (the default value), the alignments must have an attribute .targets providing the list of SeqRecord objects.

  • compress - If True (default), compress data using zlib.

    If False, do not compress data.

write_file(stream, alignments)

Write the file.

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

Bases: Bio.Align.bigbed.AlignmentIterator, Bio.Align.maf.AlignmentIterator

Alignment iterator for bigMaf files.

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

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] = 'bigMaf'
mode = 'b'
__init__(source)

Create an AlignmentIterator object.

Arguments: - source - input file stream, or path to input file

__abstractmethods__ = frozenset({})
__annotations__ = {'fmt': 'Optional[str]'}