Learn R Programming

⚠️There's a newer version (3.1.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.C533
TCGA.04.1332_MES.C133
TCGA.04.1336_DIF.C413
TCGA.04.1337_MES.C133
TCGA.04.1338_MES.C133
TCGA.04.1341_PRO.C533

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

knitr::kable(obj$indices$ii$`4`)
Algorithmscalinski_harabaszdunnpbmtaugammac_indexdavies_bouldinmcclain_raosd_disray_turig_plussilhouettes_dbwCompactnessConnectivity
HC_Euclidean4.9454990.302523438.347040.19929990.55987310.31228233.1003020.82375400.17956703.08860000.02788580.0300838NaN24.8166249.69405
DIANA_Euclidean51.3321980.334810332.927260.42714830.62168970.16394313.0378740.80776580.20342913.16878960.08929520.0700862NaN22.05147227.34841
kmodes39.1274600.335259849.270190.39072890.55285380.20202211.5633730.82541160.10465401.13569060.1116735NaN0.720735222.66419148.61865
majority5.6452200.431558196.936740.22219150.73304210.24580431.3794600.77819390.09487540.82617410.0122634NaN0.722492824.7060024.35079

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

649

Version

0.5.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Derek Chiu

Last Published

March 8th, 2019

Functions in diceR (0.5.2)

hgsc

Gene expression data for High Grade Serous Carcinoma from TCGA
consensus_cluster

Consensus clustering
dice

Diverse Clustering Ensemble
consensus_combine

Combine algorithms
majority_voting

Majority voting
diceR-package

diceR: Diverse Cluster Ensemble in R
impute_missing

Impute missing values
k_modes

K-modes
relabel_class

Relabel classes to a standard
sigclust

Significant Testing of Clustering Results
min_fnorm

Minimize Frobenius norm for between two matrices
compactness

Compactness Measure
PAC

Proportion of Ambiguous Clustering
consensus_evaluate

Evaluate, trim, and reweigh algorithms
consensus_matrix

Consensus matrix
CSPA

Cluster-based Similarity Partitioning Algorithm (CSPA)
LCE

Linkage Clustering Ensemble
pcn

Simulate and select null distributions on empirical gene-gene correlations
prepare_data

Prepare data for consensus clustering
similarity

Similarity Matrices
external_validity

External validity indices
graphs

Graphical Displays
impute_knn

K-Nearest Neighbours imputation