Skip to content

ccnv.io.tracks

Genomic track readers for mappability, GC content, and cytobands.

Attributes

NameDescription
BUNDLED_HG38_CYTOBANDS_RESOURCENo description.

Functions

NameDescription
load_cytobands_trackParse a UCSC cytoband BED/TSV file (.txt, .bed, or .gz) aligned to contigs.
load_default_cytobands_trackReturn bundled GRCh38 cytobands when canonical contigs match hg38 lengths.
load_gc_trackLoad per-bin GC content in [0, 1], N-base mask, and optional FASTA GC quantiles.
load_mappability_trackLoad per-bin mean mappability from a BigWig file.
read_fasta_contigsRead contig names and lengths from a FASTA file and select canonical layout.

BUNDLED_HG38_CYTOBANDS_RESOURCEattributemodule attribute#

BUNDLED_HG38_CYTOBANDS_RESOURCE: Final[str] = 'cytoBand_hg38.gz'

load_cytobands_trackfunction#

def load_cytobands_track(path: Path, contig_lengths: Mapping[str, int]) -> tuple[Cytoband, ...]

Parse a UCSC cytoband BED/TSV file (.txt, .bed, or .gz) aligned to contigs.

load_default_cytobands_trackfunction#

def load_default_cytobands_track(contig_lengths: Mapping[str, int], *, target_contigs: Iterable[str] | None = None) -> tuple[Cytoband, ...] | None

Return bundled GRCh38 cytobands when canonical contigs match hg38 lengths.

load_gc_trackfunction#

def load_gc_track(path: Path, contigs: Sequence[str], starts: NDArray[np.int64], ends: NDArray[np.int64]) -> tuple[NDArray[np.float64], NDArray[np.bool_], NDArray[np.float32] | None]

Load per-bin GC content in [0, 1], N-base mask, and optional FASTA GC quantiles.

load_mappability_trackfunction#

def load_mappability_track(path: Path, contigs: Sequence[str], starts: NDArray[np.int64], ends: NDArray[np.int64]) -> NDArray[np.float64]

Load per-bin mean mappability from a BigWig file.

read_fasta_contigsfunction#

def read_fasta_contigs(fasta_path: Path | str, *, all_contigs: bool = False) -> dict[str, int]

Read contig names and lengths from a FASTA file and select canonical layout.