-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCounts_plots.R
More file actions
73 lines (59 loc) · 4.46 KB
/
Counts_plots.R
File metadata and controls
73 lines (59 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
library("DESeq2")
library("ggplot2")
#df1 <-read.csv('subtable_significant_genes_WT_VSD.csv', header = TRUE, sep = ",")
head(df1)
meta1 <- read.csv('meta_allis.csv', header = TRUE, sep = ',')
head(meta1)
countData <- df1
head(countData)
metaData <- meta1
head(metaData)
design<- (~ genotype+age+region)
dds <- DESeqDataSetFromMatrix(countData = countData,
colData = metaData,
design = design, tidy = TRUE)
keep <- rowSums(counts(dds)) >= 10
dds <- dds[keep,]
dds <- estimateSizeFactors(dds)
############################# PLOT COUNTS ################################
# geneCounts <- plotCounts(dds, gene="Egr3", intgroup=c("age", "genotype", "region"), returnData=TRUE)
# Plot the data using ggplot2
# colourPallette <- c("#7145cd","#bbcfc4","#90de4a","#cd46c1","#77dd8e", "#463d25")
# ggplot(geneCounts, aes(x=interaction(genotype, age), y=count, colour=genotype, group=genotype)) + geom_point() + geom_line() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Tdg")
# ggplot(geneCounts, aes(x=interaction(genotype, age, region), y=count, colour=genotype, group=genotype)) + geom_point() + geom_line() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Tdg")
# ggplot(geneCounts, aes(x=interaction(age, region, genotype), y=count, colour=genotype)) + geom_point() + geom_line() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Tdg")
Counts <- plotCounts(dds, gene="Tmem159", intgroup=c("genotype", "age", "region"), returnData=TRUE)
# Plot the data using ggplot2
colourPallette <- c("#7145cd","#bbcfc4","#90de4a","#cd46c1","#77dd8e", "#463d25")
p <- ggplot(Counts, aes(x=age, y=count, colour=genotype, shape = genotype, group=genotype)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Tmem159 pink module")
p <- p + ylab("expression counts")
p
p + facet_grid(.~region)
Counts <- plotCounts(dds, gene="Pde11a", intgroup=c("genotype", "age", "region"), returnData=TRUE)
# Plot the data using ggplot2
colourPallette <- c("#7145cd","#bbcfc4","#90de4a","#cd46c1","#77dd8e", "#463d25")
p <- ggplot(Counts, aes(x=age, y=count, colour=genotype, shape = genotype, group=genotype)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Pde11a pink module")
p <- p + ylab("expression counts")
p
p + facet_grid(.~region)
Counts <- plotCounts(dds, gene="Corob1", intgroup=c("genotype", "age", "region"), returnData=TRUE)
# Plot the data using ggplot2
colourPallette <- c("#7145cd","#bbcfc4","#90de4a","#cd46c1","#77dd8e", "#463d25")
p <- ggplot(Counts, aes(x=age, y=count, colour=genotype, shape = genotype, group=genotype)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Corob1 black module")
p <- p + ylab("expression counts")
p
p + facet_grid(.~region)
Counts <- plotCounts(dds, gene="Coro1b", intgroup=c("genotype", "age", "region"), returnData=TRUE)
# Plot the data using ggplot2
colourPallette <- c("#7145cd","#bbcfc4","#90de4a","#cd46c1","#77dd8e", "#463d25")
p <- ggplot(Counts, aes(x=age, y=count, colour=genotype, shape = genotype, group=genotype)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Coro1b magenta module")
p <- p + ylab("expression counts")
p
p + facet_grid(.~region)
Counts <- plotCounts(dds, gene="Sipa1l1", intgroup=c("genotype", "age", "region"), returnData=TRUE)
# Plot the data using ggplot2
colourPallette <- c("#7145cd","#bbcfc4","#90de4a","#cd46c1","#77dd8e", "#463d25")
p <- ggplot(Counts, aes(x=age, y=count, colour=genotype, shape = genotype, group=genotype)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(angle=15, hjust=1)) + scale_colour_manual(values=colourPallette) + guides(colour=guide_legend(ncol=3)) + ggtitle("Sipa1l1 magenta module")
p <- p + ylab("expression counts")
p
p + facet_grid(.~region)