Giter Site home page Giter Site logo

sparsepenn / multik Goto Github PK

View Code? Open in Web Editor NEW

This project forked from siyao-liu/multik

0.0 0.0 0.0 211.53 MB

MultiK is a data-driven tool that objectively assesses the optimal number(s) of clusters based on the concept of consensus clustering via a multi-resolution perspective.

License: MIT License

R 100.00%

multik's Introduction

MultiK

Single cell RNA-seq analysis tool that objectively selects multiple insightful numbers of clusters (K).

Getting started

Installing

MultiK relies on the following R packages: Seurat, SigClust, please install them before installing MultiK.

#install.packages("Seurat")
#install.packages("SigClust")
#install.packages("devtools")
#library(devtools)
#install_github("siyao-liu/MultiK")

MultiK( ) is the main function that implements the subsampling and application of the Seurat clustering over multiple resolution parameters. Details about this function can be found in the user manual:

?MultiK

The main function, MultiK( ), takes a Seurat object with the normalized expression matrix and other parameters set by default values if not specified. MultiK explores a range of resolution parameters (from 0.05 to 2.00 with a step size of 0.05) in Seurat clustering, and aggregates all the clustering runs that give rise to the same K groups regardless of the resolution parameter and computes a consensus matrix for each K.

Note: MultiK re-selects highly variable genes in each subsampling run. Also, MultiK, by default, uses 30 principal components and 20 K-nearest neighbors in Seurat clustering.

MultiK workflow

Example

For this vignette, we use a 3 cell line mixture dataset published from Dong et al. 2019 (https://pubmed.ncbi.nlm.nih.gov/31925417/) to demonstrate the workflow of MultiK. This dataset contains ~2,600 cells and is included in the MultiK package.

data(p3cl)
seu <- p3cl

Step 1: Run MultiK main algorithm to determine optimal Ks

Run subsampling and consensusing clustering to generate output for evaluation (this step can take a long time). For demonstration purpose, we are running 10 reps here. For real data pratice, we recommend using at least 100 reps.

multik <- MultiK(seu, reps=10)

Make MultiK diagnostic plots:

DiagMultiKPlot(multik$k, multik$consensus)

Step 2: Assign classes and subclasses

Get the clustering labels at optimal K level:

clusters <- getClusters(seu, 3)

Run SigClust at optimal K level:

pval <- CalcSigClust(seu, clusters$clusters)

Make diagnostic plots (this includes a dendrogram of cluster centroids with the pairwise SigClust p values mapped on the nodes, and a heatmap of the pairwise SigClust p values)

PlotSigClust(seu, clusters$clusters, pval)

License

This software is licensed under MIT License.

Contact

If you have any questions, please contact: Siyao Liu ([email protected])

multik's People

Contributors

siyao-liu avatar

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.