SplitMatrixBySampleType: Split an exposure matrix or spectrum matrix into a list of...

Description Usage Arguments Value Examples

View source: R/SplitMatrixBySampleType.R

Description

Split an exposure matrix or spectrum matrix into a list of matrices, each for a single sample type

Usage

1
SplitMatrixBySampleType(M, sample.type)

Arguments

M

A numerical matrix or data frame or ICAMS catalog in which columns are samples (e.g. tumors) and rows are either mutational signatures (for exposures) or mutation types (for spectra), and, each element is the number of mutations due to a given mutational signature or mutation type in a single sample

sample.type

A character or numeric vector, each element of which indicates a particular sample type.

Value

Invisibly, the list of exposure or spectrum matrices created by splitting M by sample.type.

Examples

1
2
3
4
ff <- matrix(1, nrow=3, ncol = 2)
colnames(ff) <- c("sample1", "sample2")
xx <- SplitMatrixBySampleType(ff, c("sample.type.x", "sample.type.y"))
xx

steverozen/PCAWG7.WGS.Spectra documentation built on Jan. 27, 2022, 4:51 a.m.