The scFlow R package provides the analytical back-end to the nf-core/scflow Nextflow pipeline for the orchestration of automated, scalable, and reproducible single-cell RNA sequencing analyses.

The scFlow R package is built to enable standardized workflows following best practices on top of popular single-cell R packages, including Seurat, Monocle, scater, emptyDrops, DoubletFinder, LIGER, and MAST (Hao 2021, Cao 2019, McCarthy 2017, Lun 2019, McGinnis 2019, Welch 2019). Common analytical tasks required by users that involve multiple tools can be performed in scFlow with a single command (i.e. a higher level of abstraction). Key plots, tables, and other analysis outputs are automatically generated, together with interactive HTML reports for each stage of the analysis. These reports provide informative summaries of analytical steps in ways that can highlight the impact of parameter choices and guide their revision when needed.

The following example illustrates a complete sample quality-control with default parameters using the scFlow R package, including ambient RNA profiling, gene/cell annotation, thresholding, doublet/multiplet removal, and generation of an interactive HTML report with key plots: -

sce <- read_sparse_matrix(matrix_path) %>%
generate_sce(metadata) %>%
find_cells() %>%
annotate_sce() %>%
filter_sce() %>%
find_singlets() %>%
filter_sce() %>%
report_qc_sce()

Overview of scFlow features

  • Quality control of gene-cell matrices
    • Profiling of ambient RNA with emptyDrops
    • Filtering of matrices by counts and features including optional adaptive filtering
    • Filtering of mitochondrial and ribosomal genes and thresholding of counts
    • Doublet and multiplet identification and removal with DoubletFinder
    • Rich QC metrics annotation with scater
  • Integration
    • Calculation of latent-gene metafactors for integration Liger
    • Evaluation of integration performance across major sources of experimental variance with kBet
    • Latent factor contribution analysis with UpSetR plots
  • Dimensionality reduction and Clustering
    • Dimensionality reduction with tSNE and/or UMAP with/without integration
    • Community detection with the Louvain or Leiden clustering algorithms using monocle
  • Cell-type identification
  • Differential gene expression implementations
    • Flexible pre-processing including gene expressivity filtering, and options for numeric covariate scaling/centering, matrix normalization, and pseudobulking
    • Zero-inflated mixed-effect regression model with MAST
    • Random effects models with Limma
  • Pathway and functional category enrichment analysis
    • Interface to the Enrichr database with EnrichR
    • Interface to the WebGestalt tool with WebGestaltR
  • Cell-type composition analysis
    • Dirichlet modeling of differential cell-type composition using DirichletReg
  • Publication quality plots and analysis reports
    • Eight interactive HTML reports with key plots and algorithm performance metrics

Get Started and Documentation

Our primary documentation is at https://combiz.github.io/scflow-manual/.

You can install the development version of scFlow from GitHub with: -

# install.packages("devtools")
devtools::install_github("neurogenomics/scFlow")

Running RStudio Server with pre-installed scFlow via Docker

If using linux system, open a cmd terminal and run the following commands:

docker pull nfancy/scflow

docker run --rm -d \
-v $HOME:/home/rstudio/home \
-e ROOT=true \
-e PASSWORD=password \
-p 8950:8787 \
nfancy/scflow

Then access the RStudio Server on your browser at IP:8950. The default username is rstudio and password is password. To understand more on how to run docker Rstudio follow the link here.

Support

  • Ask a question on Stack Overflow with the scFlow tag, we monitor this for new questions.
  • Discuss on the scFlow Slack team.
  • Open bug reports and feature requests (not questions) on GitHub issues.

How to Contribute

Check the CONTRIBUTING page.

Reference Papers

Combiz Khozoie, Nurun Fancy, Mahdi M. Marjaneh, Alan E. Murphy, Paul M. Matthews, Nathan Skene. “scFlow: A Scalable and Reproducible Analysis Pipeline for Single-Cell RNA Sequencing Data.” bioRxiv 2021 August 19. doi: 10.22541/au.162912533.38489960/v1.

Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen. “The nf-core framework for community-curated bioinformatics pipelines”. Nat Biotechnology (2020); doi: 10.1038/s41587-020-0439-x

Note: If you use scFlow in your GitHub projects, please add scFlow in the requirements.txt.