oxbow.core.PyBBIZoomScanner#
- class oxbow.core.PyBBIZoomScanner(src, bbi_type, zoom_level, fields=None)#
A BBI file zoom level scanner.
Can only be initialized from a BigBed or BigWig scanner.
- Parameters:
src (str or file-like) – The path to the BBI file or a file-like object.
bbi_type (PyBBIFileType) – The type of BBI file (BigWig or BigBed).
zoom_level (int) – The zoom level resolution in bp.
fields (list[str], optional) – Names of the fields to include in the schema.
- __init__()#
Methods
__init__()Return the names of the reference sequences.
scan([columns, batch_size, limit])Scan batches of records from the zoom level.
scan_query(region[, columns, batch_size, limit])Scan batches of records from a genomic range query.
schema()Return the Arrow schema.
- field_names()#
Return the names of the reference sequences.
- scan(columns=None, batch_size=1024, limit=None)#
Scan batches of records from the zoom level.
- Parameters:
columns (list[str], optional) – Names of the columns to project.
batch_size (int, optional [default: 1024]) – The number of records to include in each batch.
limit (int, optional) – The maximum number of records to scan. If None, records are scanned until EOF.
- Returns:
An iterator yielding Arrow record batches.
- Return type:
arro3 RecordBatchReader (pycapsule)
- scan_query(region, columns=None, batch_size=1024, limit=None)#
Scan batches of records from a genomic range query.
- Parameters:
region (str) – Genomic region in the format “chr:start-end”.
columns (list[str], optional) – Names of the columns to project.
batch_size (int, optional [default: 1024]) – The number of records to include in each batch.
limit (int, optional) – The maximum number of records to scan. If None, all records intersecting the query range are scanned.
- Returns:
An iterator yielding Arrow record batches.
- Return type:
arro3 RecordBatchReader (pycapsule)
- schema()#
Return the Arrow schema.
- Return type:
arro3 Schema (pycapsule)