Bio.Align.bed module

Bio.Align support for BED (Browser Extensible Data) files.

The Browser Extensible Data (BED) format, stores a series of pairwise alignments in a single file. Typically they are used for transcript to genome alignments. BED files store the alignment positions and alignment scores, but not the aligned sequences.

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

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

Coordinates in the BED 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 in 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.bed.AlignmentWriter(target, bedN=12)

Bases: Bio.Align.interfaces.AlignmentWriter

Alignment file writer for the Browser Extensible Data (BED) file format.

__init__(target, bedN=12)

Create an AlignmentWriter object.

Arguments:
  • target - output stream or file name

  • bedN - number of columns in the BED file.

    This must be between 3 and 12; default value is 12.

format_alignment(alignment)

Return a string with one alignment formatted as a BED line.

class Bio.Align.bed.AlignmentIterator(source)

Bases: Bio.Align.interfaces.AlignmentIterator

Alignment iterator for Browser Extensible Data (BED) files.

Each line in the file contains one pairwise alignment, which are loaded and returned incrementally. Additional alignment information is stored as attributes of each alignment.

__init__(source)

Create an AlignmentIterator object.

Arguments:
  • source - input data or file name

__abstractmethods__ = frozenset({})