A comprehensive package for performing differential expression analysis and visualizing results for the COST IBD project.
- Analysis Scripts: DESeq2 and GSEA analysis pipelines
- Shiny Application: Interactive web interface for results exploration
- Docker Support: Containerized deployment for easy setup
- Documentation: Comprehensive guides and examples
# Clone the repository
git clone <your-repo-url>
cd cost-ibd-dea
# Start the Shiny application
cd shiny
docker-compose up -d
# Access the app at http://localhost:3838# Install R dependencies
Rscript install_packages.R
# Run DESeq2 analysis
./run_deseq2.sh
# Run GSEA analysis
./run_gsea.sh
# Start Shiny app
cd shiny
R -e "shiny::runApp()"cost-ibd-dea/
βββ deseq2.R # DESeq2 differential expression analysis
βββ gsea.R # GSEA pathway enrichment analysis
βββ run_deseq2.sh # SLURM script for DESeq2
βββ run_gsea.sh # SLURM script for GSEA
βββ dea_slurm.sh # Combined SLURM submission script
βββ install_packages.R # R package installation script
βββ output/ # Analysis results (not in repo)
β βββ celltype1/
β β βββ condition1_vs_condition2/
β β βββ DESeq2_results.tsv
β β βββ gsea_results.tsv
β β βββ gsea_plots/
β βββ logs/
βββ shiny/ # Shiny application
βββ app.R
βββ global.R
βββ ui.R
βββ server.R
βββ Dockerfile
βββ docker-compose.yml
βββ README.md
Performs differential expression analysis using DESeq2:
# Key features:
- Multiple cell type support
- Flexible contrast definitions
- Quality control metrics
- Results export in multiple formatsUsage:
Rscript deseq2.R --helpPerforms Gene Set Enrichment Analysis:
# Key features:
- MSigDB pathway analysis
- Multiple gene set collections
- Enrichment plot generation
- Results visualizationUsage:
Rscript gsea.R --helprun_deseq2.sh: Submit DESeq2 analysis to SLURM clusterrun_gsea.sh: Submit GSEA analysis to SLURM clusterdea_slurm.sh: Combined submission script
- Interactive Results Browser: Explore DEA results from multiple cell types
- Volcano Plots: Customizable plots with gene labeling
- GSEA Visualization: Interactive pathway analysis
- Data Tables: Sortable and searchable results
- Progress Tracking: Real-time loading indicators
- Cell type selection cards (color-coded by major cell type)
- Summary statistics and KPIs
- DESeq2 parameter display
- Interactive heatmaps
- Volcano plots with configurable options
- GSEA results with pathway selection
- Data tables with sorting and filtering
cd shiny
docker-compose up -d# R settings
export R_MAX_MEM_SIZE=4G
export R_NUM_THREADS=4
# Analysis parameters
export DESEQ2_ALPHA=0.05
export GSEA_PVALUE=0.05The analysis expects input data in the following format:
input_data/
βββ counts_matrix.tsv # Gene expression counts
βββ metadata.tsv # Sample metadata
βββ gene_annotations.tsv # Gene information
# Features:
- Ubuntu 22.04 base
- R 4.3+ with all required packages
- Shiny application server
- Data volume mounting support# Build image
docker build -t cost-ibd-dea-shiny ./shiny
# Run container
docker run -d \
--name dea-shiny-app \
-p 3838:3838 \
-v /path/to/results:/data:ro \
cost-ibd-dea-shinyoutput/
βββ celltype1/
β βββ condition1_vs_condition2/
β β βββ DESeq2_results.tsv
β β βββ gsea_results.tsv
β β βββ volcano_plot.png
β β βββ gsea_plots/
β β βββ HALLMARK_ADIPOGENESIS.png
β β βββ ...
β βββ condition3_vs_condition4/
βββ celltype2/
βββ logs/
βββ DESeq2_20240101_120000.log
βββ GSEA_20240101_140000.log
Modify analysis parameters in the R scripts:
# DESeq2 parameters
alpha <- 0.05
lfc_threshold <- 0.5
# GSEA parameters
pvalue_cutoff <- 0.05
min_gene_set_size <- 15
max_gene_set_size <- 500Update color palettes in shiny/global.R:
MAJOR_CLASS_PALETTE <- c(
"T/NK" = "#FF6B6B",
"Myeloid" = "#4ECDC4",
"B" = "#45B7D1",
"Stromal" = "#96CEB4",
"Other" = "#FFEAA7"
)-
Package Installation
# Reinstall packages Rscript install_packages.R -
Memory Issues
# Increase memory limit export R_MAX_MEM_SIZE=8G
-
Docker Issues
# Check logs docker logs dea-shiny-app # Rebuild image docker build --no-cache -t cost-ibd-dea-shiny ./shiny
# Analysis logs
tail -f output/logs/DESeq2_*.log
tail -f output/logs/GSEA_*.log
# Shiny app logs
docker logs -f dea-shiny-app# 1. Submit DESeq2 analysis
sbatch run_deseq2.sh
# 2. Submit GSEA analysis (after DESeq2 completes)
sbatch run_gsea.sh
# 3. Start Shiny app to explore results
cd shiny
docker-compose up -d# Load functions
source("deseq2.R")
source("gsea.R")
# Run custom analysis
run_deseq2_analysis(
counts_file = "my_counts.tsv",
metadata_file = "my_metadata.tsv",
output_dir = "my_results"
)- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For issues and questions:
- Create an issue in the GitHub repository
- Check the troubleshooting section
- Review the application logs
[Add your license information here]
Note: This package is designed specifically for the COST IBD project differential expression analysis. Ensure your data follows the expected structure for optimal functionality.