compare_k_vals: Compare k values

View source: R/k_val_assit.R

compare_k_valsR Documentation

Compare k values

Description

Compare the stability and error of various k values to help determine the correct number of signatures (k).

Usage

compare_k_vals(
  musica,
  modality,
  reps = 100,
  min_k = 1,
  max_k = 10,
  error_type = "prop",
  algorithm = "nmf"
)

Arguments

musica

A musica object.

modality

The modality to use, either "SBS96", "DBS78", or "IND83".

reps

Number of times prediction is performed. For each replicate, the count table data is perturbed. Multiple replicates allows for stability analysis by calculating silhouette width on the multiple results. Default 100.

min_k

Lower range of number of signatures for discovery. Default 1.

max_k

Upper range of number of signatures for discovery. Default 10.

error_type

Whether to calculate reconstruction error by proportions ("prop") or raw counts ("raw"). Default "prop".

algorithm

Algorithm for signature discovery. Default "nmf".

Value

a data.frame with stats for each k value tested

Examples

data(musica)
compare_k_vals(musica, "SBS96", reps = 3, min_k = 1, max_k = 5)

campbio/musicatk documentation built on Dec. 25, 2024, 9:34 p.m.