Learn R Programming

cellassign

cellassign automatically assigns single-cell RNA-seq data to known cell types across thousands of cells accounting for patient and batch specific effects. Information about a priori known markers cell types is provided as input to the model in the form of a (binary) marker gene by cell-type matrix. cellassign then probabilistically assigns each cell to a cell type, removing subjective biases from typical unsupervised clustering workflows.

Getting started

Installation

Installing from GitHub

cellassign is built using Google's Tensorflow, and as such requires installation of the R package tensorflow:

install.packages("tensorflow")
tensorflow::install_tensorflow()

cellassign can then be installed from github:

install.packages("devtools") # If not already installed
devtools::install_github("Irrationone/cellassign")

Installing from conda

With conda, install the current release version of cellassign as follows:

conda install -c conda-forge -c bioconda r-cellassign

Vignettes

Basic usage

cellassign requires the following inputs:

  • exprs_obj: Cell-by-gene matrix of raw counts (or SingleCellExperiment with counts assay)
  • marker_gene_info: Binary gene-by-celltype marker gene matrix or list relating cell types to marker genes
  • s: Size factors
  • X: Design matrix for any patient/batch specific effects

The model can be run as follows:

cas <- cellassign(exprs_obj = gene_expression_data,
                  marker_gene_info = marker_gene_info,
                  s = s,
                  X = X)

An example set of markers for the human tumour microenvironment can be loaded by calling

data(example_TME_markers)

Please see the package vignette for details and caveats.

Paper

Probabilistic cell type assignment of single-cell transcriptomic data reveals spatiotemporal microenvironment dynamics in human cancers, Biorxiv 2019

Authors

Allen W Zhang, University of British Columbia

Kieran R Campbell, University of British Columbia

Copy Link

Version

Version

0.99.2

License

Apache License (>= 2.0)

Maintainer

Last Published

April 6th, 2020

Functions in cellassign (0.99.2)

example_rho

Example cell marker matrix
simulate_cellassign

Simulate from the cellassign model
print.cellassign_fit

Print a cellassign fit
marker_list_to_mat

Convert a list of marker genes to a binary matrix
inference_tensorflow

cellassign inference in tensorflow, semi-supervised version
initialize_X

Create X matrix
example_cellassign_fit

Example cellassign fit
example_TME_markers

Example tumour microevironment markers
cellassign

Annotate cells to cell types using cellassign
get_mle_cell_type

Get MLE estimates of type of each cell
holik_data

Example bulk RNA-seq data
extract_expression_matrix

Extract expression matrix from expression object
example_sce

Example SingleCellExperiment