---
title: "Alpha and Beta Cell Type Specific Barplots"
output: 
  pdf_document:
  fig_caption: yes
---

## Introduction

This report will explain the steps used to make barplots depicting the numbers of previously reported beta and alpha specific genes from Dorrell et al., 2011, Nica et al., 2013, Bramswig et al., 2013, and Blodgett et al., 2015 confirmed to be enriched in each cell type. 

## Barplot of Alpha Specific Genes
```{r, eval=TRUE, echo=TRUE}

rm(list=ls())
# Load in ANOVA results for alpha reported genes
setwd("/Users/lawlon/Documents/Final_RNA_Seq_3/ANOVA_3/Cell_Type_Reported/")
res <- read.csv(file = "NonT2D.Blodgett.Bramswig.Dorrell.Nica.Alpha.Reported.Genes.ANOVA.stats.csv", 
                header = TRUE, check.names = FALSE, row.names = 1)

# Only use values that don't have zeros
res.sel <- res[res[,2] != 0,]

# Define colors for each group
  # Beta alpha, delta, gamma
cols <- c("#e41a1c","#4daf4a","#984ea3","#377eb8")

# Symbol names for each cell type
new.names <- c("Beta", "Delta", "Gamma","Alpha")
```

```{r, eval=TRUE, echo=TRUE, fig.show='hold', fig.width=11, fig.height=11, fig.align='center', fig.cap='Barplot showing the number of alpha reported genes expressed in each cell type.', warning=FALSE}
bplot <- barplot(height = res.sel[c(1,3,4,2),2], horiz = TRUE, 
                 xlab = "Number of Genes out of total 1853", ylab = "",
        axisnames = TRUE, names.arg = new.names, las=1, col = cols , 
        main = "", cex.names = 0.75, xlim = c(0,120))
# Add number labels to bars
text(x = res.sel[c(1,3,4,2),2]+4, y = bplot, 
     labels = as.character(res.sel[c(1,3,4,2),2]), xpd = TRUE)

```
\pagebreak

## Barplot of Beta Specific Genes
```{r, eval=TRUE, echo=TRUE}
rm(list=ls())
setwd("/Users/lawlon/Documents/Final_RNA_Seq_3/ANOVA_3/Cell_Type_Reported/")
res <- read.csv(file = "NonT2D.Blodgett.Bramswig.Dorrell.Nica.Beta.Reported.Genes.ANOVA.stats.csv", 
                header = TRUE, check.names = FALSE, row.names = 1)

# Only use values that don't have zeros
res.sel <- res[res[,2] != 0,]

# Define colors for each group
  # Beta alpha, delta, gamma
cols <- c("#377eb8", "#984ea3", "#4daf4a","#e41a1c")

# Symbol names for each cell type
new.names <- c("Alpha", "Gamma", "Delta", "Beta")
```

```{r, eval=TRUE, echo=TRUE, fig.show='hold', fig.width=11, fig.height=11, fig.align='center', fig.cap='Barplot showing the number of beta reported genes expressed in each cell type.', warning=FALSE}
# Make barplot
bplot <- barplot(height = res.sel[c(2,4,3,1),2], horiz = TRUE,
                 xlab = "Number of Genes out of total 1683", ylab = "",
        axisnames = TRUE, names.arg = new.names, las=1, 
        col = cols , main = "", cex.names = 0.75, xlim = c(0,120))
# Add numbers to barplot
text(x = res.sel[c(2,4,3,1),2]+4, y = bplot, 
     labels = as.character(res.sel[c(2,4,3,1),2]), xpd = TRUE)

```
\pagebreak

## Session Information
```{r, eval=TRUE, echo=TRUE}
sessionInfo()
```