Giter Site home page Giter Site logo

mssc's Introduction

MSSC: Multiple-subject differential analysis for single-cell RNA sequencing data

The goal of mssc is to provide a tool for differential analysis for single-cell RNA sequencing data by considering the batch effects induced when multiple subjects under different conditions, which is ignored by pseudo-bulk analysis and cannot be handled well by simple generalized linear models.

Installation

## install cmdstanr firslty.
## directly use install.package("cmdstanr") may face error.
install.packages("cmdstanr",
                 repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
## then install mssc
if(!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}
remotes::install_github("beyondpie/mssc")
## mssc => cmdstanr => cmdstan  (=>: depends on)
## so we also need to install cmdstan, which is not an R packge, but cmdline Stan tool.
## Prefer to use cmdstanr to install it since cmdstanr will then remember where the cmdstan is,
## otherwise you have to install cmdstan independently and tell cmdstanr where it is by call
## `cmdstanr::set_cmdstan_path()`.
cmdstanr::install_cmdstan()

Test

The test script can be download here: https://github.com/beyondpie/mssc/blob/main/inst/rscript/test.R. You can also use the R command below to find the script.

## test.R script can be got from the package.
test_script = system.file("rscript", "test.R", package = "mssc", mustWork = TRUE)

Then you can run this script to test if you can run mssc without errors.

Rank differentially expressed genes

Currently, we use the function evalDeltaMean to get the differential mean under two conditions. The absolute value could reflect the effect size.

  • When we use variational inference, the function returns the average differential mean from the samples of conditional gene expression levels from the approximated joint posterior distribution. For each gene, we have one such value.

  • When we use optimization, the function returns the directly differential value from the estimated conditional gene expression levels.

Currently, we have no the corresponding p-value like statistics to measure the differential expression.

Generalized linear model

A simple way to model the batch effect for different cells is to treat the batch as one covariant in a generalized linear model, which we have implemented as a control for mssc.

mssc's People

Contributors

beyondpie avatar

Watchers

 avatar  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.