# 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: `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.

  __abstractmethods__ = frozenset({})
  __annotate_func__ = <function AlignmentWriter.__annotate__>
  __annotations_cache__ = {'fmt': 'str | None'}
  __firstlineno__ = 39
  __static_attributes__ = ('bedN',)

class Bio.Align.bed.AlignmentIterator(source)

  Bases: `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.

  fmt: str | None = 'BED'
  __abstractmethods__ = frozenset({})
  __annotate_func__ = <function AlignmentIterator.__annotate__>
  __annotations_cache__ = {'fmt': 'str | None'}
  __firstlineno__ = 157
  __static_attributes__ = ()

Biopython v: 1.86

Versions
  Previous
  Latest
  Develop

Biopython Project
  Homepage
  On GitHub