## Commands to install the packages necessary for the course

install.packages("BiocManager")

BiocManager::install(version = "3.9") ## this workshop uses Bioc release version 3.9

## Check which packages need installation
required_pkgs <- c("batchelor", "beachmat", "biomaRt", "bookdown", "cluster",
                   "corrplot", "cowplot", "DelayedArray", "DESeq2", "destiny",
                   "devtools", "DrImpute", "DropletUtils", "edgeR",
                   "EnsDb.Hsapiens.v86", "EnsDb.Mmusculus.v79", "future",
                   "ggbeeswarm", "ggfortify", "ggthemes", "glmpca", "googleVis",
                   "graph", "gtools", "harmony", "igraph", "kBET", "KernSmooth",
                   "knitr", "leidenbase", "limma", "lle", "M3Drop", "MAST",
                   "Matrix", "matrixStats", "mclust", "mixtools", "monocle",
                   "monocle3", "MultiAssayExperiment", "mvoutlier", "ouija",
                   "pcaMethods", "phateR","pheatmap", "plotly", "Polychrome",
                   "pryr", "RBGL", "RColorBrewer", "Rhdf5lib", "ROCR",
                   "RUVSeq", "SC3", "scater", "scds", "scfind", "scImpute",
                   "scmap", "scran", "scRNA.seq.funcs", "scRNAseq",
                   "sctransform", "sctransform", "Seurat",
                   "SingleCellExperiment", "SingleR", "slalom", "SLICER",
                   "slingshot", "SummarizedExperiment", "sva", "tidyverse",
                   "TSCAN", "umap", "UpSetR", "xtable")

installed_pkgs <- installed.packages()
ip <- rownames(installed_pkgs)
pkgs_to_install <- required_pkgs[!(required_pkgs %in% ip)]
pkgs_to_install
BiocManager::install(pkgs_to_install)

## Install all the required packages hosted on CRAN

BiocManager::install(c("devtools", "pryr", "tidyverse", "Seurat", "umap",
                       "bookdown", "cluster", "KernSmooth", "ROCR", "googleVis",
                       "ggbeeswarm", "SLICER", "ggfortify", "mclust",
                       "DrImpute", "phateR", "mixtools", "mvoutlier", "igraph",
                       "sctransform", "corrplot", "cowplot", "ggthemes",
                       "knitr", "lle", "Matrix", "matrixStats", "pheatmap",
                       "Polychrome", "plotly", "RColorBrewer", "future", "UpSetR"))

## Install all the required Bioconductor packages - the command is the same
BiocManager::install(c("graph", "RBGL", "gtools", "xtable", "pcaMethods",
                       "limma", "SingleCellExperiment", "Rhdf5lib", "scater",
                       "scran", "RUVSeq", "sva", "SC3", "TSCAN", "monocle",
                       "destiny", "DESeq2", "edgeR", "MAST", "scmap", "biomaRt",
                       "MultiAssayExperiment", "SummarizedExperiment",
                       "DropletUtils", "beachmat", "batchelor", "M3Drop",
                       "scfind", "scRNAseq", "SingleR", "slalom",
                       "DelayedArray", "scds", "slingshot",
                       "EnsDb.Mmusculus.v79", "EnsDb.Hsapiens.v86"))

## install all the required GitHub packages
devtools::install_github(c("hemberg-lab/scRNA.seq.funcs",
                           "immunogenomics/harmony", "Vivianstats/scImpute",
                           "theislab/kBET", "kieranrcampbell/ouija",
                           "willtownes/glmpca", "cole-trapnell-lab/leidenbase",
                           "cole-trapnell-lab/monocle3",
                           "ChristophH/sctransform"))