GithubHelp home page GithubHelp logo

speckle_old's Introduction

speckle

Note: we have created a clean repository of the speckle package in order to submit the package to Bioconductor and will be retiring this version of speckle (v0.99.0). The new repository is https://github.com/phipsonlab/speckle.

The speckle package currently contains functions to analyse differences in cell type proportions in single cell RNA-seq data. As our research into specialised analyses of single cell data continues we anticipate that the package will be updated with new functions.

The propeller, propeller.ttest and propeller.anova functions perform statistical tests for differences in cell type composition in single cell data. In order to test for differences in cell type proportions between multiple experimental conditions at least one of the groups must have some form of biological replication (i.e. at least two samples). For a two group scenario, the absolute minimum sample size is thus three. Since there are many technical aspects which can affect cell type proportion estimates, having biological replication is essential for a meaningful analysis.

The propeller function takes a SingleCellExperiment or Seurat object as input, extracts the relevant cell information, and tests whether the cell type proportions are statistically significantly different between experimental conditions/groups. The user can also explicitly pass the cluster, sample and experimental group information to propeller. P-values and false discovery rates are outputted for each cell type.

The propeller.ttest() and propeller.anova() are more general functions that can account for additional covariates in the analysis.

Installation

If you would like to view the speckle vignette, you can install the released version of speckle from github using the following commands:

# devtools/remotes won't install Suggested packages from Bioconductor
BiocManager::install(c("CellBench", "BiocStyle", "scater"))

remotes::install_github("phipsonlab/speckle", build_vignettes = TRUE, 
dependencies = "Suggest")

In order to view the vignette for speckle use the following command:

browseVignettes("speckle")

If you don't care to view the glorious vignette you can also install speckle as follows:

library(devtools)
devtools::install_github("phipsonlab/speckle")

propeller example

This is a basic example which shows you how to test for differences in cell type proportions in a two group experimental set up.

library(speckle)
library(limma)
library(ggplot2)

# Get some example data which has two groups, three cell types and two 
# biological replicates in each group
cell_info <- speckle_example_data()
head(cell_info)

# Run propeller testing for cell type proportion differences between the two 
# groups
propeller(clusters = cell_info$clusters, sample = cell_info$samples, 
group = cell_info$group)

# Plot cell type proportions
plotCellTypeProps(clusters=cell_info$clusters, sample=cell_info$samples)

Please note that this basic implementation is for when you are only modelling group information. When you have additional covariates that you would like to account for, please use the propeller.ttest() and propeller.anova() functions directly. Please read the vignette for examples on how to model a continuous variable, account for additional covariates and include a random effect in the analysis.

speckle_old's People

Contributors

melodyjin-y avatar bphipson avatar

Stargazers

Devika Agarwal avatar slp avatar DDuchen avatar Yi Xiong avatar ZhengWen Cai avatar  avatar

Watchers

 avatar

Forkers

kew24

speckle_old's Issues

Fitting a mixed-effect model --> dream() instead of lmFit() or duplicateCorrelation()?

Hi,

Thanks for the clear explanations of your vignette!

I am interested in fitting a mixed-effect model (i.e., including the sequencing lane as a random effect). I noticed that in the 'More complex (or just different) experimental designs' section, you suggest to use lmFit() for LM, or duplicateCorrelation() for LMM, but I was wondering whether I could use dream() on the transformed proportions (props$TransformedProps of the vignette) since dream() can hold mixed-models and lmFit() not. See section 'Dream Analysis' for more details.

Thanks a lot!

Best,
Aida

Error with 2 levels clusters

Hello,

Thank you for this useful package.

When I provide a vector with 2 levels for the clusters argument in the propeller function, I get the following error :
Error in tmixture.matrix(out$t, stdev.unscaled, df.total, proportion, : Dims of tstat and stdev.unscaled don't match

Is it not possible to find differences of proportions when we only have 2 levels of cluster ?

FYI, I don't have any issue when the clusters argument has more than 2 levels and my study is based on the differences between 2 groups.

Thank you for your help.

Regards,
Yannick

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.