August 6, 2022

R programming: Install code for my favorite R packages for bioinformatics

I am updating my R version and re-installing a bunch of things. Here is the code so I can copy/paste more easily in the future.

## For opening large csv files faster than read.csv()
## These are essential for my DNA methylation work when I have >800,000 rows of data

install.packages(c("vroom", "data.table"))


## For opening Excel spreadsheets
install.packages(c("gdata", "openxlsx"))


## For data cleaning, organizing, subsetting, and using the pipes (%>%) grammar. Installing tidyverse installs several powerful packages all at once (tidyr, dplyr, stringr, ggplot2, and more).

install.packages("tidyverse")


## For plotting, data visualization

install.packages(c("ggplot2", "ggrepel", "ggpubr"))

install.packages("gplots") ## for function heatmap.2

install.packages(c("plotly", "heatmaply", "htmlwidgets")) ## for interactive plots and saving to html

install.packages("ggExtra") ## for ggMarginal function

install.packages(c("viridis", "RColorBrewer")) ## for pretty color ranges

install.packages("scales") ## for prettier axis breaks



## For advanced data visualization with Dr Gu's ComplexHeatmap package
(warning: take a few minutes sometimes if the server is slow)

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install("ComplexHeatmap")


## For combining plots into multipanel figures or creating/extracting multi-page pdf files

install.packages("cowplot")  ## my favorite for aligning plots, general intro

install.packages("patchwork") ## for combining plots, used by Seurat

install.packages("pdftools")


## For easy Manhattan and QQ plots (GWAS and DNA methylation data)

install.packages("qqman")


## For genomics annotation from Ensembl release 90 specifically

install.packages("devtools")

devtools::install_github("stephenturner/annotables")


## For genomics annotations from the Ensembl BioMart servers

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install("biomaRt")


## For differential expression analysis (RNA-seq data)

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install(c("DESeq2", "limma", "edgeR"))


## Advanced image processing with magick, and image-to-text with tesseract

install.packages("magick")

install.packages("tesseract")


## Notification sounds for RStudio (Windows only) with beepr. I love using this when I'm running some code over lunch. I can hear when it's done!

install.packages("beepr")


## Web scrapping with rvest (tutorial1, tutorial2)

install.packages("rvest")


## ----------- Single cell RNA-seq analysis ---------------------

## Single cell RNA-seq analysis packages

install.packages("Seurat") # tool from Satija lab

BiocManager::install("scran") # tutorial for scran


## Quality control: doublet finder

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install("scDblFinder")

BiocManager::install("BiocSingular")  ## calculates doublet score


## Cell recognition method

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install("SingleR") 


## ----------- DNA methylation packages ---------------------

## For methylation array analysis (missMethyl has a gomethyl function for gene ontology analysis that accounts for the number of probes per gene)

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install("missMethyl")


## Differentially methylated region analysis (DNA methylation data) - three methods

if (!require("BiocManager", quietly = TRUE))

    install.packages("BiocManager")

BiocManager::install("ChAMP")

BiocManager::install("bumphunter")

BiocManager::install("DMRcate")


## ----------- Requires extra software ---------------------

## Per Seurat message: "For a (much!) faster implementation of the Wilcoxon Rank Sum Test, (default method for FindMarkers) please install the presto package". If using Windows, install Git for Windows first, linked from microsoft.com.

# install.packages('devtools')

# devtools::install_github('immunogenomics/presto')

No comments:

Post a Comment

Bookmarks: single cell RNA-seq tutorials and tools

These are my bookmarks for single cell transcriptomics resources and tutorials. scRNA-seq introductions How to make R obj...