Convert BAM/CRAM to WisecondorX NPZ format
bam_convert_npz.RdRuns bam_convert() and serialises the resulting bin-count list to a
.npz file that is byte-compatible with the file written by
wisecondorx convert. The NPZ must be created by numpy so that
wisecondorx newref can load it; this function therefore requires
reticulate and a Python environment with numpy installed (any version
≥ 1.16 works — the format is stable).
Usage
bam_convert_npz(
bam,
npz,
binsize = 5000L,
rmdup = c("streaming", "none", "flag"),
con = NULL,
np = NULL,
reference = NULL
)Arguments
- bam
Path to an indexed BAM or CRAM file.
- npz
Path for the output
.npzfile (created or overwritten).- binsize
Bin size in base pairs (default 5000).
- rmdup
Duplicate-removal strategy passed to
bam_convert().- con
Optional open DBI connection with duckhts already loaded. Passed through to
bam_convert().- np
Optional numpy module imported via
reticulate::import("numpy"). IfNULL(default) it is imported automatically.- reference
Optional FASTA reference path for CRAM inputs. Passed to
bam_convert().