MethylStore
quantnado.dataset.store_methyl.MethylStore
¶
MethylStore(
store_path: Path | str,
sample: str,
chromsizes: dict[str, int],
*,
chunk_len: int,
compressors: list,
overwrite: bool = True,
)
Per-sample Zarr store for TAPS/WGBS methylation data.
Stores dense (1, chrom_len) arrays for coverage, methylation_pct,
n_methylated, and n_total per chromosome. BAM provides coverage; bedGraph
provides methylation values.
Use :meth:from_files to create or :meth:open to read.
Source code in quantnado/dataset/store_methyl.py
from_files
classmethod
¶
from_files(
bam_path: str | Path,
methyl_path: str | Path,
store_path: Path | str,
sample: str,
chromsizes: str | Path | dict[str, int] | None = None,
*,
bam_filter: ReadFilter | None = None,
count_fragments: bool = False,
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,
log_file: Path | None = None,
) -> "MethylStore"
Create a per-sample MethylStore from a BAM file and a MethylDackel bedGraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bam_path
|
str | Path
|
Aligned BAM file (for coverage). |
required |
methyl_path
|
str | Path
|
MethylDackel CpG bedGraph (for methylation values). |
required |
store_path
|
Path | str
|
Output .zarr directory. |
required |
sample
|
str
|
Sample name. |
required |
chromsizes
|
str | Path | dict[str, int] | None
|
Path to .chrom.sizes, dict, or None to infer from BAM header. |
None
|
Source code in quantnado/dataset/store_methyl.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | |