Skip to contents

Uses the NMF package to estimate the rank of the matrix provided. In the context of signature finding, this is equivalent to determining the optimal number of signatures.

Usage

ChooseNumberSignatures(
  sample_by_component,
  min_sig = 3,
  max_sig = 12,
  iter = 100,
  cores = 4,
  nmfalg = "brunet",
  seed = 77777
)

Arguments

sample_by_component

Matrix. Expects a sum-of-posteriors probability matrix. Likely the output from GenerateSampleByComponentMatrix().

min_sig

Integer. Minimum number of signatures to consider.

max_sig

Integer. Maximum number of signatures to consider.

iter

Integer. The number of runs of NMF to perform at each rank with a random seed.

cores

Integer. (NMF param) The number of cores to use when running NMF.

Value

A figure. A figure plotting the cophenetic distance, the dispersion, sparseness and silhouette score.

Details

The NMF Package (Brunet algorithm specification) is used to deconvolute the sample-by-component sum-of-posteriors matrix into a sample-by-signature matrix and a signature-by-component matrix. By default a search interval of 3-12 is used for the rank. To compare/for context the input matrix is also shuffled and the same procedure performed. The results are co-plotted to give a baseline.