voldog/250829_rstudio

By voldog

•Updated 7 months ago

Production RStudio + DESeq2 + clusterProfiler environment for bulk RNA-seq (bRNA3F).

Image
Languages & frameworks
Developer tools
Data science
0

2.2K

voldog/250829_rstudio repository overview

⁠RStudio with Tidyverse + Bioconductor RNA-seq Stack

Production-ready RStudio environment for bulk RNA-seq analysis with DESeq2, clusterProfiler, and comprehensive Bioconductor packages.

Docker Image Version Base Image License

ā šŸš€ Quick Start

# Pull the image
docker pull voldog/250829_rstudio:2.0

# Run RStudio Server (access at http://localhost:8787)
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  -v $(pwd):/workspace \
  --name rstudio \
  voldog/250829_rstudio:2.0

# Or run interactive R session
docker run -it --rm \
  -v $(pwd):/workspace \
  voldog/250829_rstudio:2.0 \
  R

Default credentials: username: rstudio, password: set via -e PASSWORD=yourpassword

ā šŸ“¦ What's Included

⁠Core Stack
  • R 4.5.1 - Latest stable R release
  • RStudio Server - Full web-based IDE
  • Tidyverse - Complete data science toolkit (dplyr, ggplot2, tidyr, readr, etc.)
⁠Bioconductor Packages (Latest Release 3.20)

RNA-seq Analysis:

  • DESeq2 - Differential expression analysis
  • tximport - Import transcript-level quantifications
  • GenomicFeatures - Genome annotation handling
  • rtracklayer - Genome track manipulation

Gene Set Analysis:

  • clusterProfiler - Gene set enrichment and ORA
  • enrichplot - GSEA visualization (gseaplot2, Manhattan plots)
  • fgsea - Fast GSEA implementation
  • msigdbr - MSigDB gene set access

Annotation:

  • org.Hs.eg.db - Human genome annotation
  • org.Mm.eg.db - Mouse genome annotation
  • AnnotationDbi - Annotation database interface
  • biomaRt - BioMart web service queries

Visualization:

  • ComplexHeatmap - Advanced heatmap generation
  • EnhancedVolcano - Publication-quality volcano plots
  • ggrepel - Smart label placement
  • pheatmap - Pretty heatmaps
  • RColorBrewer - Color palettes
⁠System Libraries
  • Complete compilation toolchain (gcc, gfortran, make)
  • XML/web libraries (libxml2, libcurl, libssl)
  • Graphics libraries (cairo, freetype, harfbuzz)
  • Parallel processing support (OpenMP)

ā šŸ”§ Use Cases

⁠1. bRNA3F RNA-seq Pipeline

This image is the official environment for the bRNA3F enterprise RNA-seq analysis template:

# Clone and run bRNA3F in container
git clone https://github.com/crmlab-uab/bRNA3F.git
cd bRNA3F

docker run -d \
  -p 8787:8787 \
  -e PASSWORD=rnaseq2024 \
  -v $(pwd):/data/bRNA3F \
  -w /data/bRNA3F \
  --name brna3f \
  voldog/250829_rstudio:2.0

Then access RStudio at http://localhost:8787 and render:

# Working directory is /data/bRNA3F
rmarkdown::render("bRNA3F.Rmd", 
                  params = list(config_file = "config/config.yaml"),
                  output_file = "output/analysis_report.html")

Required directory structure:

bRNA3F/
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ sf/           # Salmon quantification files (*.sf)
│   ā”œā”€ā”€ genome/       # Auto-downloaded genome references
│   └── genesets/     # Auto-downloaded MSigDB gene sets
ā”œā”€ā”€ config/           # Configuration files
ā”œā”€ā”€ output/           # Analysis results (HTML, CSV, plots)
└── logs/             # Execution logs
⁠2. Custom RNA-seq Analysis
# Example DESeq2 workflow
library(DESeq2)
library(tximport)

# Import Salmon quantifications
files <- list.files("data/salmon", pattern = ".sf", full.names = TRUE)
txi <- tximport(files, type = "salmon", txOut = FALSE)

# DESeq2 analysis
dds <- DESeqDataSetFromTximport(txi, colData = samples, design = ~ condition)
dds <- DESeq(dds)
results <- results(dds, contrast = c("condition", "treated", "control"))

# GSEA with clusterProfiler
library(clusterProfiler)
gene_list <- results$log2FoldChange
names(gene_list) <- rownames(results)
gene_list <- sort(gene_list, decreasing = TRUE)

gsea_result <- gseGO(geneList = gene_list,
                     OrgDb = org.Hs.eg.db,
                     ont = "BP",
                     keyType = "ENSEMBL")
⁠3. Interactive Exploratory Analysis

Mount your analysis directory with proper structure:

# For bRNA3F project
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=explore \
  -v /path/to/bRNA3F:/data/bRNA3F \
  -w /data/bRNA3F \
  --name rstudio-explore \
  voldog/250829_rstudio:2.0

# Or for custom project with specific mounts
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=explore \
  -v /path/to/salmon_quants:/data/sf \
  -v /path/to/results:/output \
  -w /workspace \
  --name rstudio-custom \
  voldog/250829_rstudio:2.0

ā šŸ’¾ Data Persistence

⁠Volume Mounting Best Practices
# Mount complete bRNA3F project (recommended)
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  -v $(pwd):/data/bRNA3F \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9

# Mount specific directories for separation
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  -v $(pwd)/data/sf:/data/bRNA3F/data/sf \
  -v $(pwd)/output:/data/bRNA3F/output \
  -v $(pwd)/config:/data/bRNA3F/config \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9

# Use named volumes for persistent genome/genesets cache
docker volume create brna3f-genome
docker volume create brna3f-genesets
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  -v $(pwd):/data/bRNA3F \
  -v brna3f-genome:/data/bRNA3F/data/genome \
  -v brna3f-genesets:/data/bRNA3F/data/genesets \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9

ā āš™ļø Configuration

⁠Environment Variables
  • PASSWORD - RStudio password (required)
  • ROOT=true - Enable root access in container
  • DISABLE_AUTH=true - Disable RStudio authentication (not recommended for production)
  • USERID - Match host user ID (default: 1000)
  • GROUPID - Match host group ID (default: 1000)
⁠Memory and CPU Limits
# Limit resources for large datasets
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  --memory="16g" \
  --cpus="8" \
  -v $(pwd):/data/bRNA3F \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9
⁠Custom R Library Path
# Install additional packages to persistent volume
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  -e R_LIBS_USER=/data/bRNA3F/rlibs \
  -v $(pwd):/data/bRNA3F \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9

ā šŸ”¬ Validation & Testing

This image has been validated on:

  • Linux: Ubuntu 22.04, CentOS 8, Debian 12
  • macOS: Monterey (Intel), Ventura (Apple Silicon via Rosetta)
  • Windows: WSL2 with Docker Desktop

Real-world testing:

  • 117-sample complex RNA-seq experiment (multi-factor design)
  • 25+ hour continuous analysis runs
  • ~50GB peak memory usage on large datasets
  • Parallel processing with BiocParallel (8-16 cores)

ā šŸ“Š Performance Benchmarks

Typical DESeq2 analysis (50 samples, 20K genes):

  • Gene filtering: ~2 minutes
  • DESeq2 processing: ~15 minutes
  • GSEA (clusterProfiler): ~5 minutes per comparison
  • Plot generation: ~10 minutes

Parallel processing speedup:

  • VST transformation: 5-10x faster with 8 cores
  • GSEA: 3-4x faster with parallel gene sets

ā šŸ› Troubleshooting

⁠RStudio won't start
# Check container logs
docker logs rstudio

# Common fix: ensure port 8787 is available
docker run -d -p 8888:8787 -e PASSWORD=yourpassword voldog/250829_rstudio:1.9
# Access at http://localhost:8888
⁠Out of memory errors
# Increase Docker memory limit (Docker Desktop: Settings → Resources)
docker run -d -p 8787:8787 -e PASSWORD=yourpassword --memory="32g" voldog/250829_rstudio:1.9

# Or in R, enable memory-efficient caching
options(parallelly.maxWorkers.localhost = 4)
⁠Package installation fails
# Install system dependencies for specific packages
docker exec -it rstudio bash
apt-get update && apt-get install -y libgdal-dev  # For spatial packages
R -e "install.packages('sf')"
⁠Permission denied on mounted volumes
# Match host user ID (important for Linux)
docker run -d \
  -p 8787:8787 \
  -e PASSWORD=yourpassword \
  -e USERID=$(id -u) \
  -e GROUPID=$(id -g) \
  -v $(pwd):/data/bRNA3F \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9

ā šŸ” Security Considerations

For production use:

  1. Always set strong passwords: -e PASSWORD=$(openssl rand -base64 32)
  2. Use HTTPS with reverse proxy (nginx, Caddy)
  3. Limit container capabilities: --cap-drop=ALL --cap-add=CHOWN,SETUID,SETGID
  4. Regular updates: docker pull voldog/250829_rstudio:latest
  5. Scan for vulnerabilities: docker scan voldog/250829_rstudio:1.9

Local development only:

# Disable auth for localhost testing (not recommended for production)
docker run -d \
  -p 127.0.0.1:8787:8787 \
  -e DISABLE_AUTH=true \
  -v $(pwd):/data/bRNA3F \
  -w /data/bRNA3F \
  voldog/250829_rstudio:1.9

ā šŸ“š Additional Resources

ā šŸ·ļø Version Tags

  • 2.0 - Current production release (Nov 2025)
  • latest - Always points to newest stable version
  • dev - Development builds (may be unstable)

ā šŸ“ License

This image is provided under the MIT License. Base Rocker images are under GPL-2.

Maintained by: CRM Lab, University of Alabama at Birmingham
Contact: [email protected]⁠


⭐ If you find this image useful, please star the bRNA3F repository⁠!

Tag summary

Content type

Image

Digest

sha256:0806d7427…

Size

5.5 GB

Last updated

7 months ago

docker pull voldog/250829_rstudio