Skip to contents

Builds and validates an [MsCatalog]. The channel-snapshot hash is computed from the labels; violations raise errors of class `msuiter_error_catalog`.

Usage

ms_catalog(counts, channels, samples, provenance)

Arguments

counts

numeric matrix (channels x samples) with rownames equal to the channel labels and colnames equal to `samples`.

channels

channel-registry snapshot: a named list with `name` (table id, e.g. `"SBS96"`) and `labels` (canonical labels). A `hash` element is computed automatically and must not be forged.

samples

character vector of sample ids.

provenance

named list; must carry `genome` (the build label).

Value

An [MsCatalog] object.

Examples

labels <- paste0("CH", 1:4)
counts <- matrix(1:8, 4, 2, dimnames = list(labels, c("S1", "S2")))
cat1 <- ms_catalog(counts, list(name = "SYN4", labels = labels),
  c("S1", "S2"), provenance = list(genome = "GRCh38"))
cat1
#> <MsCatalog> SYN4: 4 channels x 2 samples