/bcbioRNASeq

R package for bcbio RNA-seq analysis.

Primary LanguageRGNU Affero General Public License v3.0AGPL-3.0

bcbioRNASeq

Install with Bioconda

R package for bcbio RNA-seq analysis.

Workflow paper

Steinbaugh MJ, Pantano L, Kirchner RD, Barrera V, Chapman BA, Piper ME, Mistry M, Khetani RS, Rutherford KD, Hoffman O, Hutchinson JN, Ho Sui SJ. (2018). bcbioRNASeq: R package for bcbio RNA-seq analysis. F1000Research 6:1976.

citation("bcbioRNASeq")

Installation

Requirements: R >= 4.0, Bioconductor >= 3.12.

R method

if (!requireNamespace("BiocManager", quietly = TRUE)) {
    install.packages("BiocManager")
}
install.packages(
    pkgs = "bcbioRNASeq",
    repos = c(
        "https://r.acidgenomics.com",
        BiocManager::repositories()
    )
)

Conda method

Configure Conda to use the Bioconda channels.

# Don't install recipe into base environment.
name="r-bcbiornaseq"
conda create --name="$name" "$name"
conda activate "$name"
R

Docker method

image="acidgenomics/r-bcbiornaseq"
workdir="/mnt/work"
docker pull "$image"
docker run -it \
    --volume="${PWD}:${workdir}" \
    --workdir="$workdir" \
    "$image" \
    R

Load bcbio RNA-seq data

library(bcbioRNASeq)
object <- bcbioRNASeq(
    uploadDir = file.path("bcbio", "final"),
    interestingGroups = c("genotype", "treatment"),
    organism = "Homo sapiens"
)
saveData(object, dir = ".")

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

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

Sample metadata

When loading a bcbio RNA-seq run, the sample metadata will be imported automatically from the project-summary.yaml file in the final upload directory. If you notice any typos in your metadata after completing the run, these can be corrected by editing the YAML file. Alternatively, you can pass in a sample metadata file into bcbioRNASeq() using the sampleMetadataFile argument.

Metadata file example

The samples in the bcbio run must map to the description column. The values provided in description must be unique. These values will be sanitized into syntactically valid names (see help("make.names")), and assigned as the column names of the bcbioRNASeq object. The original values are stored as the sampleName column in colData(), and are used for all plotting functions.

description genotype
sample1 wildtype
sample2 knockout
sample3 wildtype
sample4 knockout

Differential expression

We've designed bcbioRNASeq to easily hand off to DESeq2, edgeR, or limma-voom for differential expression analysis.

DESeq2: Coerce bcbioRNASeq to DESeqDataSet.

dds <- as(object, "DESeqDataSet")

edgeR or limma-voom: Coerce bcbioRNASeq to DGEList.

dge <- as(object, "DGEList")

R Markdown templates

The package provides multiple R Markdown templates, including quality control, differential expression using DESeq2, and functional enrichment analysis. These are available in RStudio at File -> New File -> R Markdown... -> From Template.

Troubleshooting

Invalid object

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

object <- updateObject(object)
validObject(object)
## [1] TRUE

References

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