R package for bcbio single-cell RNA-seq analysis.

Installation

R method

if (!requireNamespace("remotes", quietly = TRUE)) {
    install.packages("remotes")
}
Sys.setenv(R_REMOTES_UPGRADE = "always")
# Set `GITHUB_PAT` in `~/.Renviron` if you get a rate limit error.
remotes::install_github("hbc/bcbioSingleCell")

Here’s how to update to the latest version on GitHub:

Sys.setenv(R_REMOTES_UPGRADE = "always")
remotes::update_packages()

Always check that your Bioconductor installation is valid before proceeding.

if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}
BiocManager::valid()

conda method

Configure conda to use the bioconda channels.

Load bcbio single-cell RNA-seq data

This will return a bcbioSingleCell object, which is an extension of the Bioconductor SingleCellExperiment container class. Consult the bcbioSingleCell() constructor function documentation for detailed information on the supported parameters:

help(topic = "bcbioSingleCell", package = "bcbioSingleCell")

Sample metadata examples

FASTQ files with samples multiplexed by index barcode

This is our current recommended method for analyzing an inDrops dataset. The sample index barcodes are multiplexed per FASTQ set. For Illumina sequencing data, the raw binary base call (BCL) data must be converted into FASTQs (split into R1-R4 files) using bcl2fastq.

The inDrops library version is automatically detected by bcbio, but ensure that the sample index sequences provided match the library version when attempting to create a bcbioSingleCell object.

Consult the bcbio documentation for more information on how to configure an inDrops run prior to loading into R with the bcbioSingleCell() function.

description index sequence sampleName aggregate genotype
indrops1 1 CTCTCTAT sample1_1 sample1 wildtype
indrops1 2 TATCCTCT sample2_1 sample2 knockout
indrops1 3 GTAAGGAG sample3_1 sample3 wildtype
indrops1 4 ACTGCATA sample4_1 sample4 knockout
indrops2 1 CTCTCTAT sample1_2 sample1 wildtype
indrops2 2 TATCCTCT sample1_2 sample2 knockout
indrops2 3 GTAAGGAG sample1_2 sample3 wildtype
indrops2 4 ACTGCATA sample1_2 sample4 knockout

Note that bcbio currently outputs the reverse complement index sequence in the sample directory names (e.g. sample-ATAGAGAG). Define the forward index barcode in the sequence column here, not the reverse complement. The reverse complement will be calculated automatically and added as the revcomp column in the sample metadata.

FASTQ files demultiplexed per sample

This is our current method for handling 10X Genomics Chromium and Illumina SureCell cell barcodes.

description genotype
sample1 wildtype
sample2 knockout
sample3 wildtype
sample4 knockout

Invalid object

If you encounter a validObject error when attempting to load a bcbioSingleCell object from a previous analysis, run this step to update the object to the current version of the package:

References

The papers and software cited in our workflows are available as a shared library on Paperpile.