bx.bbi.bbi_file module

Core implementation for reading UCSC “big binary indexed” files.

There isn’t really any specification for the format beyond the code, so this mirrors Jim Kent’s ‘bbiRead.c’ mostly.

class bx.bbi.bbi_file.BBIFile

Bases: object

A “big binary indexed” file. Stores blocks of raw data and numeric summaries of that data at different levels of aggregation (“zoom levels”). Generic enough to accommodate both wiggle and bed data.

level_list
magic
open(file, expected_sig, type_name)

Initialize from an existing bbi file, signature (magic) must be passed in since this is generic.

query(chrom, start, end, summary_size)

Provides a different view of summary for region, a list of dictionaries with keys: mean, max, min, coverage, std_dev

summarize(chrom, start, end, summary_size)

Gets summary_size data points over the regions chrom:start-end.

summarize_from_full(chrom, start, end, summary_size)

Gets summary_size data points over the regions chrom:start-end, always using the raw data points

version
zoom_levels
class bx.bbi.bbi_file.BlockHandler

Bases: object

Callback for BBIFile.visit_blocks_in_region

class bx.bbi.bbi_file.SummarizedData

Bases: object

The result of using SummaryBlocks read from the file to produce a aggregation over a particular range and resolution

end
max_val
min_val
size
start
sum_data
sum_squares
valid_count
class bx.bbi.bbi_file.SummaryBlock

Bases: object

A block of summary data from disk

chrom_id
end
max_val
min_val
start
sum_data
sum_squares
valid_count
class bx.bbi.bbi_file.ZoomLevel

Bases: object

data_offset
index_offset
reduction_level