choose_clusters: Filter MOBSTER output clusters.

View source: R/choose_clusters.R

choose_clustersR Documentation

Filter MOBSTER output clusters.

Description

This function can filter out the clusters computed by MOBSTER based on two criteria: the mixing proportion value, the number of mutations assigned and the variance of the Beta clusters.

For all criteria a scalar should be given as input. The return object will contain only the clusters that pass all filters. If any cluster is dropped the latent variables are re-computed, as well as the clustering assignments and the mixing proportions (all mutations will be still assigned after clusters' removal).

Usage

choose_clusters(
  x,
  pi_cutoff = 0.02,
  N_cutoff = 10,
  Beta_variance_cutoff = 1e-04,
  verbose = FALSE
)

Arguments

x

A MOBSTER fit object.

pi_cutoff

The cutoff on the mixing proportions, default is 0.02.

N_cutoff

The cutoff on the number of mutations assigned to a cluster, default is 10.

Beta_variance_cutoff

Minimum variance for a Beta peak.

verbose

If outputs should be reported to screen or not, default is no.

Value

A MOBSTER fit object where clusters are larger than pi_cutoff and contain at least N_cutoff. If no such cluster exists an error is generated.

Examples

data('fit_example', package = 'mobster')

# Does not change anything (no filter triggered)
choose_clusters(fit_example$best)

# Remove one Beta component because it has less than 100 points (renders the fit very poor)
choose_clusters(fit_example$best, N_cutoff = 100)

caravagnalab/mobster documentation built on March 25, 2023, 3:40 p.m.