Clusters: Return the data with the hard clustering assigments.

View source: R/Clusters.R

ClustersR Documentation

Return the data with the hard clustering assigments.

Description

Extract the clustering assignments, and return the data. Assignments can be computed subsetting the mutations that have posterior values (reponsibilities) below a certain cutoff (default 0 - all assigments); non-assigned mutations have NA as cluster label.

Usage

Clusters(x, cutoff_assignment = 0)

Arguments

x

A MOBSTER fit.

cutoff_assignment

Cutoff to compute hard clustering assignments.

Value

The data stored in x$data with a column label reporting the assigned cluster, or NA if the maximum cluster probability is below the threshold value cutoff_assignment.

Examples

data('fit_example', package = 'mobster')
Clusters(fit_example$best)

# Add some cutoff to filter assignments
Clusters(fit_example$best, cutoff_assignment = .8)

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