bx.bitset_builders module

Support for creating dictionaries of `Bitset`s / `BinnedBitset`s from text files containg sets of "covered" intervals in sequences (e.g. `BED`_ files).

bx.bitset_builders.binned_bitsets_by_chrom(f, chrom, chrom_col=0, start_col=1, end_col=2)

Read a file by chrom name into a bitset

bx.bitset_builders.binned_bitsets_from_bed_file(f, chrom_col=0, start_col=1, end_col=2, strand_col=5, upstream_pad=0, downstream_pad=0, lens={})

Read a file into a dictionary of bitsets. The defaults arguments

  • ‘f’ should be a file like object (or any iterable containing strings)

  • ‘chrom_col’, ‘start_col’, and ‘end_col’ must exist in each line.

  • ‘strand_col’ is optional, any line without it will be assumed to be ‘+’

  • if ‘lens’ is provided bitset sizes will be looked up from it, otherwise chromosomes will be assumed to be the maximum size

bx.bitset_builders.binned_bitsets_from_file(f, chrom_col=0, start_col=1, end_col=2, strand_col=5, upstream_pad=0, downstream_pad=0, lens={})

Read a file into a dictionary of bitsets. The defaults arguments

  • ‘f’ should be a file like object (or any iterable containing strings)

  • ‘chrom_col’, ‘start_col’, and ‘end_col’ must exist in each line.

  • ‘strand_col’ is optional, any line without it will be assumed to be ‘+’

  • if ‘lens’ is provided bitset sizes will be looked up from it, otherwise chromosomes will be assumed to be the maximum size

bx.bitset_builders.binned_bitsets_from_list(list=[])

Read a list into a dictionary of bitsets

bx.bitset_builders.binned_bitsets_proximity(f, chrom_col=0, start_col=1, end_col=2, strand_col=5, upstream=0, downstream=0)

Read a file into a dictionary of bitsets