BamStore
quantnado.dataset.store_bam.BamStore
¶
BamStore(
store_path: Path | str,
assay: str,
sample: str,
chromsizes: dict[str, int],
*,
ip: str | None = None,
stranded: str | None = None,
viewpoints: list[str] | None = None,
chunk_len: int,
compressors: list,
overwrite: bool = True,
)
Per-sample Zarr store for BAM-derived genomic coverage.
One zarr per BAM file. Each chromosome is a zarr group containing
(1, chrom_len) arrays — one row per sample (always 1 for per-sample stores).
Use :meth:from_bam_files to create a new store or :meth:open to read one.
Source code in quantnado/dataset/store_bam.py
open
classmethod
¶
Open an existing per-sample BamStore zarr (read-only by default).
Source code in quantnado/dataset/store_bam.py
from_bam_files
classmethod
¶
from_bam_files(
bam_path: str | Path,
store_path: Path | str,
assay: str,
sample: str,
chromsizes: str | Path | dict[str, int] | None = None,
*,
ip: str | None = None,
stranded: str | None = None,
bam_filter: ReadFilter | None = None,
count_fragments: bool | None = None,
viewpoint_tag: str = "VP",
chunk_len: int | None = None,
construction_compression: str = DEFAULT_CONSTRUCTION_COMPRESSION,
overwrite: bool = True,
filter_chromosomes: bool = True,
test: bool = False,
test_chromosomes: list[str]
| tuple[str, ...]
| None = None,
staging_dir: Path | str | None = None,
log_file: Path | None = None,
) -> "BamStore"
Create a per-sample BamStore zarr from a single BAM file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bam_path
|
str | Path
|
Path to the aligned BAM file. |
required |
store_path
|
Path | str
|
Output .zarr directory. |
required |
assay
|
str
|
Assay type string (e.g. "ATAC", "ChIP", "CUT&TAG", "RNA", "MCC"). |
required |
sample
|
str
|
Sample name (used in metadata and as sample coordinate). |
required |
chromsizes
|
str | Path | dict[str, int] | None
|
Path to .chrom.sizes file, dict, or None to infer from BAM header. |
None
|
ip
|
str | None
|
IP target (ChIP/CUT&TAG only). Combined with assay to form array key. |
None
|
stranded
|
str | None
|
Strand orientation: "R" (reverse), "F" (forward), or None (unstranded). Required for RNA assays. |
None
|
Source code in quantnado/dataset/store_bam.py
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 | |