Giter Site home page Giter Site logo

clusternomics's Introduction

Clusternomics

Integrative clustering for heterogeneous datasets.

Build Status

Introduction

The goal of context-dependendent clustering is to identify clusters in a set of related datasets. Clusternomics identifies both local clusters that exist at the level of individual datasets, and global clusters that appear across the datasets.

A typical application of the method is the task of cancer subtyping, where we analyse tumour samples. The individual datasets (contexts) are then various features of the tumour samples, such as gene expression data, DNA methylation measurements, miRNA expression etc. The assumption is that we have several measurements of different types describing the same set tumours. Each of the measurements then describes the tumour in a different context.

The clusternomics algorithm identifies

  • clusters of measurements within individual datasets, we call these local clusters
  • clusters of tumour samples that are informed by the local clusters, these are global clusters

The following diagram illustrates the distinction. When we look at the data sets individually, context 1 contains three clusters and context 2 contains two clusters. These clusters correspond to the local clusters in the clusternomics package. On the global level, there are three distinct clusters that are only revealed when we look at the combination of local assignments within individual datasets.

Illustration of local and global cluster structures

Installation

Use the devtools package to get the current version of the package:

devtools::install_github("evelinag/clusternomics")

Using clusternomics

See the package vignette for usage on a simulated dataset.

Datasets

The package was tested using datasets originally downloaded from TCGA.

clusternomics's People

Contributors

evelinag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clusternomics's Issues

Number of datasets is different from number of contexts

First of all thanks for releasing the package.

I am trying to use it with 3 (or 4) context datasets and it fails with an error:

"
Number of datasets is different from number of contexts.
"

I traced it to line 84 in clusternomics.R where the length of the list is checked with number of datasets, but the length of the $context should be checked instead.

I tried to fix that and install from source and it seems to work.

numberOfClusters (based on use in vignette)

Hi,

the vignette has a use of the numberOfClusters function that does not seem to work. The code below is the setup as used in the vignette; I'll use a separate chunk to highlight issue.

library(clusternomics)
library(ggplot2)
library(dplyr)
set.seed(1)

# Number of elements in each cluster, follows the table given above
groupCounts <- c(50, 10, 40, 60)
# Centers of clusters
means <- c(-10.5,1.5)
# Helper function to generate test data
testData <- generateTestData_2D(groupCounts, means)
datasets <- testData$data

# Setup of the algorithm
dataDistributions <- 'diagNormal'
# Pre-specify number of clusters
clusterCounts <- list(global=10, context=c(3,3))
# Set number of iterations
# The following is ONLY FOR SIMULATION PURPOSES 
# Use larger number of iterations for real-life data
maxIter <- 300  
burnin <- 200
lag <- 2  # Thinning of samples

# Run context-dependent clustering
results <- contextCluster(datasets, clusterCounts, 
                          maxIter = maxIter, burnin = burnin, lag = lag,
                          dataDistributions = 'diagNormal',
                          verbose = F)

# Extract resulting cluster assignments
samples <- results$samples  

# Extract global cluster assignments for each MCMC sample
clusters <- lapply(1:length(samples), function(i) samples[[i]]$Global) 

This is how the numberOfClusters function is used:

cc <- numberOfClusters(clusters)

However, this creates an error as numberOfClusters refers to nrow(clusters); I think something like the following might be closer? I'm not sure though as there are some issues I'm finding in recreating the code from the vignette with this.

cc <- lapply(1:length(clusters), function(i) unique(clusters[[i]]) %>% length)

Possibly the issue is that clusters is a list of vectors rather than a data.frame? Or that I've done something mad. The last shouldn't be entirely discounted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.