Asthma Overview
Glucocorticoids have an anti-inflammatory effect on airway smooth muscle cells, and used as a therapy for asthma
The following describes transcriptomic profiling of cells treated with dexamethasone - a potent synthetic glucocorticoid
Project re-analyzes RNA-seq data from 4 airway smooth muscle (ASM) cell lines: N61311 N052611 N080611 N061011
Data Source
Himes BE, Jiang X, Wagner P, Hu R, Wang Q, Klanderman B, Whitaker RM, Duan Q, Lasky-Su J, Nikolos C, Jester W, Johnson M, Panettieri R Jr, Tantisira KG, Weiss ST, Lu Q. “RNA-Seq Transcriptome Profiling Identifies CRISPLD2 as a Glucocorticoid Responsive Gene that Modulates Cytokine Function in Airway Smooth Muscle Cells.” PLoS One. 2014 Jun 13;9(6):e99625. PMID: 24926665. GEO: GSE52778.
Airways Dataset
Asthma Image Source
https://github.com/rstudio/d3heatmap/
Highlight rows/columns by clicking axis labels
Click and drag over colormap to zoom in (click on colormap to zoom out)
Optional clustering and dendrograms, courtesy of base::heatmap
https://rstudio.github.io/dygraphs/
Automatically plots xts time series objects (or any object convertible to xts).
Highly configurable axis and series display (including optional second Y-axis).
Rich interactive features including zoom/pan and series/point highlighting.
Various graph overlays including shaded regions, event lines, and point annotations.
If you use ggplot2, ggplotly() converts your plots to an interactive, web-based version! It also provides sensible tooltips, which assists decoding of values encoded as visual properties in the plot.
plotly supports some chart types that ggplot2 doesn’t (such as 3D surface, point, and line plots). You can create these (or any other plotly) charts using plot_ly().
https://hrbrmstr.github.io/metricsgraphics/
Building metricsgraphics charts follows the “piping” idiom made popular through the magrittr, ggvis and dplyr packages. This makes it possible to avoid one giant function with a ton of parameters and facilitates breaking out the chart building into logical steps.
While MetricsGraphics.js charts may not have the flexibility of ggplot2, you can build functional, interactive [multi-]line, scatterplot, bar charts & histograms and + even link charts together.
---
title: "BIOF439 Final Project"
author: Lesley M Chapman
output:
flexdashboard::flex_dashboard:
storyboard: true
social: menu
source: embed
---
```{r, include=FALSE}
#if (!('airway' %in% installed.packages()[,1])) #install.packages('airway', repos = 'http://cran.rstudio.com')
#if (!('ggbeeswarm' %in% installed.packages()[,1])) #install.packages('ggbeeswarm', repos = #'http://cran.rstudio.com')
#if (!('pheatmap' %in% installed.packages()[,1])) #install.packages('pheatmap', repos = #'http://cran.rstudio.com')
#if (!('PoiClaClu' %in% installed.packages()[,1])) #install.packages('PoiClaClu', repos = #'http://cran.rstudio.com')
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("apeglm")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("DESeq2")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("Gviz")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("IHW")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("org.Hs.eg.db")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("vsn")
library("AnnotationDbi")
library("apeglm")
library(airway)
library('DESeq2')
library("dplyr")
library(flexdashboard)
library("genefilter")
library("ggbeeswarm")
library("ggplot2")
library("Gviz")
library("IHW")
library("org.Hs.eg.db")
library("pheatmap")
library("PoiClaClu")
library("RColorBrewer")
library("vsn")
dir <- system.file("extdata", package="airway", mustWork=TRUE)
```
```{r, include=FALSE}
'
Part 1
----------
Load data and create dataframe for analysis
'
# Load sample descriptions
csvfile <- file.path(dir,"sample_table.csv")
(sampleTable <- read.csv(csvfile,row.names=1))
data("airway")
se <- airway
head(se)
dds <- DESeqDataSet(se, design = ~ cell + dex)
head(dds, 5)
countdata <- assay(se)
coldata <- colData(se)
head(countdata, 3)
ddsMat <- DESeqDataSetFromMatrix(countData = countdata,
colData = coldata,
design = ~ cell + dex)
nrow(dds)
dds <- dds[ rowSums(counts(dds)) > 1, ]
nrow(dds)
lambda <- 10^seq(from = -1, to = 2, length = 1000)
cts <- matrix(rpois(1000*100, lambda), ncol = 100)
meanSdPlot(cts, ranks = FALSE)
#logarithm-transformed counts
log.cts.one <- log2(cts + 1)
meanSdPlot(log.cts.one, ranks = FALSE)
# FYI: fully unsupervised transformation blind = TRUE
vsd <- vst(dds, blind = FALSE)
head(assay(vsd), 3)
colData(vsd)
#rlog
rld <- rlog(dds, blind = FALSE)
```
### Project Overview:
Use visual exploratory data analysis (EDA) techniques to understand the structure and potential bias within a High Throughput Sequencing dataset.
```{r asthma, echo=FALSE, fig.cap="Asthma Overview", out.width = '100%'}
knitr::include_graphics("/Users/chapmanlm/Desktop/FAES/Homework/BIOF439/Project/normal-vs-asthma-lung.png")
```
***
##### Experimental Background
* Glucocorticoids have an anti-inflammatory effect on airway smooth muscle cells, and used as a therapy for asthma
* The following describes transcriptomic profiling of cells treated with dexamethasone - a potent synthetic glucocorticoid
* Project re-analyzes RNA-seq data from 4 airway smooth muscle (ASM) cell lines:
*N61311
*N052611
*N080611
*N061011
**Data Source**
Himes BE, Jiang X, Wagner P, Hu R, Wang Q, Klanderman B, Whitaker RM, Duan Q, Lasky-Su J, Nikolos C, Jester W, Johnson M, Panettieri R Jr, Tantisira KG, Weiss ST, Lu Q. “RNA-Seq Transcriptome Profiling Identifies CRISPLD2 as a Glucocorticoid Responsive Gene that Modulates Cytokine Function in Airway Smooth Muscle Cells.” PLoS One. 2014 Jun 13;9(6):e99625. PMID: 24926665. GEO: GSE52778.
[Airways Dataset](https://bioconnector.github.io/workshops/data.html)
[Asthma Image Source](https://community.aafa.org/blog/what-happens-in-your-airways-when-you-have-asthma)
### d3heatmap creates interactive D3 heatmaps including support for row/column highlighting and zooming.
```{r}
library(d3heatmap)
d3heatmap(mtcars, scale="column", colors="Blues")
```
***
https://github.com/rstudio/d3heatmap/
- Highlight rows/columns by clicking axis labels
- Click and drag over colormap to zoom in (click on colormap to zoom out)
- Optional clustering and dendrograms, courtesy of base::heatmap
### Dygraphs provides rich facilities for charting time-series data in R and includes support for many interactive features.
```{r}
library(dygraphs)
dygraph(nhtemp, main = "New Haven Temperatures") %>%
dyRangeSelector(dateWindow = c("1920-01-01", "1960-01-01"))
```
***
https://rstudio.github.io/dygraphs/
- Automatically plots xts time series objects (or any object convertible to xts).
- Highly configurable axis and series display (including optional second Y-axis).
- Rich interactive features including zoom/pan and series/point highlighting.
- Display upper/lower bars (e.g. prediction intervals) around series.
- Various graph overlays including shaded regions, event lines, and point annotations.
### Plotly provides bindings to the plotly.js library and allows you to easily translate your ggplot2 graphics into an interactive web-based version.
```{r}
library(plotly)
p <- ggplot(data = diamonds, aes(x = cut, fill = clarity)) +
geom_bar(position = "dodge")
ggplotly(p)
```
***
https://plot.ly/ggplot2/
If you use ggplot2, `ggplotly()` converts your plots to an interactive, web-based version! It also provides sensible tooltips, which assists decoding of values encoded as visual properties in the plot.
plotly supports some chart types that ggplot2 doesn't (such as 3D surface, point, and line plots). You can create these (or any other plotly) charts using `plot_ly()`.
### MetricsGraphics enables easy creation of D3 scatterplots, line charts, and histograms.
```{r}
library(metricsgraphics)
mjs_plot(mtcars, x=wt, y=mpg) %>%
mjs_point(color_accessor=carb, size_accessor=carb) %>%
mjs_labs(x="Weight of Car", y="Miles per Gallon")
```
***
https://hrbrmstr.github.io/metricsgraphics/
Building metricsgraphics charts follows the “piping” idiom made popular through the magrittr, ggvis and dplyr packages. This makes it possible to avoid one giant function with a ton of parameters and facilitates breaking out the chart building into logical steps.
While MetricsGraphics.js charts may not have the flexibility of ggplot2, you can build functional, interactive [multi-]line, scatterplot, bar charts & histograms and + even link charts together.