Code Monkey home page Code Monkey logo

blggm's Introduction

BLGGM: Estimating Heterogeneous Gene Regulatory Networks from Zero-Inflated Single-Cell Expression Data

Single-cell sequencing technologies can elucidate the gene-gene relationship at an unprecedented resolution. However, the expression data from single cells are often zero-inflated and heterogeneous, making commonly used Gaussian graphical models infeasible to correctly estimate gene regulatory networks. We proposed a Bayesian latent mixture Gaussian graphical model to explicitly account for the data heterogeneity and zero-inflation. The R package BLGGM (Bayesian Latent Gaussian Graph Mixture), designed for operating systems Windows and Linux, implements the proposed method to cluster cells and obtain cellular gene regulatory networks simultaneously. Package BLGGM employs a hybrid Markov chain Monte Carlo algorithm to perform posterior inference in the Bayesian framework.

Prerequisites and Installation

  1. R version >= 3.6.
  2. R packages: Rcpp (>= 1.0.3), RcppArmadillo (>= 0.9.850.1.0), stats, MASS.
  3. Install the package BLGGM.
devtools::install_github("WgitU/BLGGM")

Example Code

library(BLGGM)

#import example data
data(example_data)

#gene number
nrow(scRNA_data_matr)

#cell number
ncol(scRNA_data_matr)

#cell type number
n_celltype <- dim(precision_matr)[3]

#run BLGGM
set.seed(20200201)
t1 <- Sys.time()
Result <- BLGGM(scRNA_data_matr, n_celltype, num_iterations = 10000, num_threads = 10)
t2 <- Sys.time()

#time cost
print(t2 - t1)

#Compared with true cell type labels
cell_table <- table(Result$cell_labels, cell_label_truth)
cell_table

#The following shows the Frobenius norms of precision matrix within each cell type
sqrt(sum((Result$cell_type_precision_matr[,,which.max(cell_table[,1])] - precision_matr[,,1])^2))
sqrt(sum((Result$cell_type_precision_matr[,,which.max(cell_table[,2])] - precision_matr[,,2])^2))

or you can simply run

library(BLGGM)
example(BLGGM)

Remarks

  • This package applies openmp to parallel computing.
  • This package can be downloaded and run in Windows and Linux. However, as Mac OS does not support openmp, the package temporarily does not support Mac OS.
  • If you have any questions regarding this package, please contact Qiuyu Wu at [email protected].

blggm's People

Contributors

wgitu avatar xiangyuluo avatar

Watchers

James Cloos 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.