Learn R Programming

⚠️There's a newer version (3.0.0) of this package.Take me there.

diceR

Overview

The goal of diceR is to provide a systematic framework for generating diverse cluster ensembles in R. There are a lot of nuances in cluster analysis to consider. We provide a process and a suite of functions and tools to implement a systematic framework for cluster discovery, guiding the user through the generation of a diverse clustering solutions from data, ensemble formation, algorithm selection and the arrival at a final consensus solution. We have additionally developed visual and analytical validation tools to help with the assessment of the final result. We implemented a wrapper function dice() that allows the user to easily obtain results and assess them. Thus, the package is accessible to both end user with limited statistical knowledge. Full access to the package is available for informaticians and statisticians and the functions are easily expanded. More details can be found in our companion paper published at BMC Bioinformatics.

Installation

You can install diceR from CRAN with:

install.packages("diceR")

Or get the latest development version from GitHub:

# install.packages("devtools")
devtools::install_github("AlineTalhouk/diceR")

Example

The following example shows how to use the main function of the package, dice(). A data matrix hgsc contains a subset of gene expression measurements of High Grade Serous Carcinoma Ovarian cancer patients from the Cancer Genome Atlas publicly available datasets. Samples as rows, features as columns. The function below runs the package through the dice() function. We specify (a range of) nk clusters over reps subsamples of the data containing 80% of the full samples. We also specify the clustering algorithms to be used and the ensemble functions used to aggregated them in cons.funs.

library(diceR)
data(hgsc)
obj <- dice(hgsc, nk = 4, reps = 5, algorithms = c("hc", "diana"),
            cons.funs = c("kmodes", "majority"))

The first few cluster assignments are shown below:

knitr::kable(head(obj$clusters))
kmodesmajority
TCGA.04.1331_PRO.C522
TCGA.04.1332_MES.C122
TCGA.04.1336_DIF.C442
TCGA.04.1337_MES.C122
TCGA.04.1338_MES.C122
TCGA.04.1341_PRO.C522

You can also compare the base algorithms with the cons.funs using internal evaluation indices:

knitr::kable(obj$indices$ii$`4`)
Algorithmscalinski_harabaszdunngammac_indexdavies_bouldinsds_dbwsilhouetteCompactnessConnectivity
HC_EuclideanHC_Euclidean3.1041060.26085470.63494010.28440731.8391822.8464801.678968-0.141860324.8322541.62183
DIANA_EuclideanDIANA_Euclidean53.6474000.3348103-1.97499030.15894422.8242013.4501731.8095610.056406521.93396241.66310
kmodeskmodes55.1386000.3396909-1.87041010.14535992.0067523.9869501.9674670.136928821.91494201.42540
majoritymajority19.3732480.35443710.65296530.21024871.6227994.0397081.9822100.150466623.8540864.04921

Pipeline

This figure is a visual schematic of the pipeline that dice() implements.

Please visit the overview page for more detail.

Copy Link

Version

Install

install.packages('diceR')

Monthly Downloads

532

Version

2.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Derek Chiu

Last Published

January 22nd, 2024

Functions in diceR (2.2.0)

k_modes

K-modes
majority_voting

Majority voting
external_validity

External validity indices
relabel_class

Relabel classes to a standard
prepare_data

Prepare data for consensus clustering
sigclust

Significant Testing of Clustering Results
similarity

Similarity Matrices
impute_missing

Impute missing values
consensus_matrix

Consensus matrix
compactness

Compactness Measure
LCA

Latent Class Analysis
dice

Diverse Clustering Ensemble
LCE

Linkage Clustering Ensemble
PAC

Proportion of Ambiguous Clustering
CSPA

Cluster-based Similarity Partitioning Algorithm (CSPA)
consensus_cluster

Consensus clustering
consensus_evaluate

Evaluate, trim, and reweigh algorithms
consensus_combine

Combine algorithms
graphs

Graphical Displays
impute_knn

K-Nearest Neighbours imputation
diceR-package

diceR: Diverse Cluster Ensemble in R
min_fnorm

Minimize Frobenius norm for between two matrices
hgsc

Gene expression data for High Grade Serous Carcinoma from TCGA
pcn

Simulate and select null distributions on empirical gene-gene correlations