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, blockSize=256, itemsPerSlot=512)
Bases:
AlignmentWriter
Alignment file writer for the bigMaf file format.
- fmt: str | None = 'bigMaf'
- __init__(target, targets=None, compress=True, blockSize=256, itemsPerSlot=512)
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. Use compress=False for faster searching.
- blockSize - Number of items to bundle in r-tree.
See UCSC’s bedToBigBed program for more information. Default value is 256.
- itemsPerSlot - Number of data points bundled at lowest level.
See UCSC’s bedToBigBed program for more information. Use itemsPerSlot=1 for faster searching. Default value is 512.
- write_file(stream, alignments)
Write the file.
- __abstractmethods__ = frozenset({})
- class Bio.Align.bigmaf.AlignmentIterator(source)
Bases:
AlignmentIterator
,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 theAlignment
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: str | None = 'bigMaf'
- mode = 'b'
- __init__(source)
Create an AlignmentIterator object.
Arguments: - source - input file stream, or path to input file
- __abstractmethods__ = frozenset({})