mutationCallsFromMatrix: mutationCalls constructor

View source: R/classes.R

mutationCallsFromMatrixR Documentation

mutationCalls constructor

Description

To be used when allele-specific count matrices are available.

Usage

mutationCallsFromMatrix(
  M,
  N,
  cluster = NULL,
  metadata = data.frame(row.names = rownames(M)),
  binarize = 0.05
)

Arguments

M

A matrix of read counts mapping to the mutant allele. Columns are genomic sites and rows and single cells.

N

A matrix of read counts mapping to the referece allele. Columns are genomic sites and rows and single cells.

cluster

If NULL, only mutations with coverage in 20 percent of the cells or more will be used for the clustering, and all other mutations will be used for cluster annotation only. Alternatively, a boolean vector of length ncol(M) that specifies the desired behavior for each genomic site.

metadata

A data.frame of metadata that will be transfered to the final output where the row.names(metadata) correspond to the the row.names(M).

binarize

Allele frequency threshold to define a site as mutant (required for some clustering methods)

Value

An object of class mutationCalls.

Examples

load(system.file("extdata/example_counts.Rda",package = "mitoClone2"))
## we have loaded the example.counts object
known.variants <- c("8 T>C","4 G>A","11 G>A","7 A>G","5 G>A","15 G>A","14 G>A")
known.subset <- pullcountsVars(example.counts, known.variants)
known.subset <- mutationCallsFromMatrix(t(known.subset$M), t(known.subset$N),
cluster = rep(TRUE, length(known.variants)))

benstory/mitoClone2 documentation built on Nov. 8, 2023, 12:13 a.m.