oxbow.core.PyBigWigScanner#

class oxbow.core.PyBigWigScanner(src)#

A BigWig file scanner.

Parameters:

obj (str or file-like) – The path to the BigWig file or a file-like object.

__init__()#

Methods

__init__()

chrom_names()

Return the names of the reference sequences.

chrom_sizes()

Return the names of the reference sequences and their lengths in bp.

field_names()

Return the names of the fields.

get_zoom(zoom_level)

Return a scanner for a specific zoom level.

scan([fields, batch_size, limit])

Scan batches of records from the file.

scan_query(region[, fields, batch_size, limit])

Scan batches of records from a genomic range query.

schema([fields])

Return the Arrow schema.

zoom_levels()

Return the zoom/reduction level resolutions.

chrom_names()#

Return the names of the reference sequences.

chrom_sizes()#

Return the names of the reference sequences and their lengths in bp.

field_names()#

Return the names of the fields.

get_zoom(zoom_level)#

Return a scanner for a specific zoom level.

Parameters:

zoom_level (int) – The resolution (in bp) of the zoom level to scan.

Returns:

A scanner for the specified zoom level.

Return type:

PyBBIZoomScanner

scan(fields=None, batch_size=1024, limit=None)#

Scan batches of records from the file.

Parameters:
  • fields (list[str], optional) – Names of the fixed fields 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, fields=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”.

  • fields (list[str], optional) – Names of the fixed fields to project.

  • batch_size (int, optional [default: 1024]) – The number of records to include in each batch.

Returns:

An iterator yielding Arrow record batches.

Return type:

arro3 RecordBatchReader (pycapsule)

schema(fields=None)#

Return the Arrow schema.

Parameters:

fields (list[str], optional) – Names of the fields to project.

Return type:

arro3 Schema (pycapsule)

zoom_levels()#

Return the zoom/reduction level resolutions.