osca_LIIGH_UNAM_2020

Analyzing scRNA-seq data with Bioconductor for LCG-EJ-UNAM March 2020

Here you can find the files for the March 2020 single cell RNA-sequencing (scRNA-seq) course for LCG-EJ-UNAM at LIIGH-UNAM based on the book Orchestrating Single Cell Analysis with Bioconductor by Aaron Lun, Robert Amezquita, Stephanie Hicks and Raphael Gottardo, plus WEHI’s scRNA-seq course by Peter Hickey.

Instructor: Leonardo Collado-Torres.

Course Prerequisites

Install R 3.6.x from CRAN then install the following R packages:

## For installing Bioconductor packages
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

## Install required packages
BiocManager::install(
    c(
        'SingleCellExperiment',
        'usethis',
        'here',
        'scran',
        'scater',
        'scRNAseq',
        'org.Mm.eg.db',
        'AnnotationHub',
        'ExperimentHub',
        'BiocFileCache',
        'DropletUtils',
        'EnsDb.Hsapiens.v86',
        'TENxPBMCData',
        'BiocSingular',
        'batchelor',
        'uwot',
        'Rtsne',
        'pheatmap',
        'fossil',
        'ggplot2',
        'cowplot',
        'RColorBrewer',
        'plotly',
        'iSEE',
        'pryr',
        'LieberInstitute/spatialLIBD',
        'sessioninfo'
    )
)

You will also need to install RStudio version 1.2.5 or newer.

Course files

  1. Introduction
  2. Data Infrastructure and Import
  3. Quality Control
  4. Normalization
  5. Feature Selection
  6. Dimensionality Reduction
  7. Clustering
  8. Marker gene detection
  9. Cell Annotation
  10. Data Integration
  11. Multi-Sample Comparisons
  12. Spatial Transcriptomics

OSCA Workflow

LIIGH Cluster DNA setup

If you add the following code to your ~/.Rprofile at the DNA LIIGH-UNAM cluster, you’ll be able to use the same R packages I installed.

## Log into the cluster

## Load the R 3.6.1 module
module load r/3.6.1

## Edit your ~/.Rprofile
vi ~/.Rprofile
## Add this to your ~/.Rprofile file
if(R.home() == '/cm/shared/apps/r/3.6.1-studio/lib64/R') {
    if (interactive())
        message("Using the following library: /mnt/Genoma/amedina/lcollado/R/3.6.1")
    .libPaths(
        c(
            '/mnt/Genoma/amedina/lcollado/R/3.6.1',
            '/cm/shared/apps/r/3.6.1-studio/lib64/R/library'
        )
    )
}

If you are using RStudio through Cyberduck or something like that, you could use usethis::edit_r_profile().

Now, to avoid having to download the data many times, you can use the data I downloaded by editing/creating a ~/.Renviron file with the following contents:

## Note that it has to have an empty line at the end

## For using Leo's Bioconductor cached' files
EXPERIMENT_HUB_CACHE="/mnt/Genoma/amedina/lcollado/BiocHubCache"
ANNOTATION_HUB_CACHE="/mnt/Genoma/amedina/lcollado/BiocHubCache"
XDG_CACHE_HOME="/mnt/Genoma/amedina/lcollado/BiocHubCache"

To test that it works, run:

qrsh
module load r/3.6.1
Rscript -e "packageVersion('spatialLIBD')"

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Download the materials for this course with usethis::use_course('lcolladotor/osca_LIIGH_UNAM_2020') or view online at lcolladotor.github.io/osca_LIIGH_UNAM_2020.