Minor updates to the slide deck and scripts

This commit is contained in:
Krishna Choudhary 2020-07-21 13:47:22 -07:00
parent 539a00f9d6
commit 0b57c58052
7 changed files with 42 additions and 3 deletions

View file

@ -1,5 +1,5 @@
#setwd() #setwd()
setwd("~/Dropbox (Gladstone)/Bioinformatics/Training_Workshops/Gladstone-internal/Intermediate_RNA-seq_Fall_2019") setwd("~/Dropbox (Gladstone)/Gladstone chapters/Workshops/2020/intermediate-r-rna-seq")
library(magrittr) library(magrittr)
library(edgeR) library(edgeR)
@ -34,7 +34,7 @@ colnames(GenewiseCounts) %<>% substring(.,1,7)
#Concept 1: MA plots #Concept 1: MA plots
#------------------------ #------------------------
two_samples <- GenewiseCounts[, c(2, 3)] %>% #Replicate samples two_samples <- GenewiseCounts[, c(2, 13)] %>% #Replicate samples
add(., 1) %>% add(., 1) %>%
log2() log2()
@ -125,7 +125,7 @@ legend("top", legend=levels(group) %>% substr(., 1, 3),
pch=pch, col=colors, ncol=2, cex = 0.5) pch=pch, col=colors, ncol=2, cex = 0.5)
#PCA plot #PCA plot
cpm <- cpm(y, log = TRUE, prior.count = 0.01) cpm <- cpm(y, log = TRUE)
rv <- apply(cpm,1,var) rv <- apply(cpm,1,var)
#Select genes with highest variance. #Select genes with highest variance.

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -0,0 +1,39 @@
cnts_casein <- cpm(y)[y$genes$Symbol == "Csn1s2b", ]
cnts_rndm <- cpm(y)[100, ]
df <- data.frame(Casein = cnts_casein,
Random = cnts_rndm,
targets[, c("CellType", "Status")])
p <- ggplot(df, aes(x=Random, y=1,
color=CellType, shape=Status)) +
geom_point(size=2.5) +
scale_x_log10() +
scale_y_log10() +
theme_classic() +
theme(axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
axis.line.y = element_blank(),
legend.position = "top",
legend.box = "vertical",
plot.margin = margin(0.5, 0.5, 0.5, 0.5, "cm"))
ggsave("Random.png",
p,
width = 3,
height = 3)
p <- ggplot(df, aes(x=1, y=Random,
color=CellType, shape=Status)) +
geom_point(size=2.5) +
scale_x_log10() +
scale_y_log10() +
theme(axis.title.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank())
ggsave("Random.png",
p)
xlab(paste("PC1:", pc1_var, "% variance")) +
ylab(paste("PC2:", pc2_var, "% variance"))