Skip to contents

Runs 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 .npz file (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"). If NULL (default) it is imported automatically.

reference

Optional FASTA reference path for CRAM inputs. Passed to bam_convert().

Value

npz (invisibly).

Examples

if (FALSE) { # \dontrun{
bam_convert_npz("sample.bam", "sample.npz", binsize = 5000, rmdup = "streaming")
} # }