-
Notifications
You must be signed in to change notification settings - Fork 1
/
3_tissue_specific_expression.R
executable file
·63 lines (49 loc) · 1.82 KB
/
3_tissue_specific_expression.R
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
# required packages
load.lib<-c("dplyr", "openxlsx", "ggplot2", "BiocManager", "UpSetR", "openxlsx", "Cairo")
install.lib<-load.lib[!load.lib %in% installed.packages()]
for(lib in install.lib) install.packages(lib,dependencies=TRUE)
sapply(load.lib,require,character=TRUE)
BiocManager::install(c("edgeR", "ComplexHeatmap", "topGO"))
bioc_pckg = c("edgeR", "ComplexHeatmap", "topGO")
lapply(bioc_pckg, require, character.only = TRUE)
######################################################################################
######################################################################################
# heat response of different tissues on moneymaker genotype #
######################################################################################
######################################################################################
rm(list=ls())
set.seed(123)
combined.logFC = read.csv("inputs/combined.logFC.csv")
row.names(combined.logFC) = combined.logFC$X
combined.logFC = combined.logFC[, -1]
moneymaker = combined.logFC[, c("e5.1", "e6.1", "e6.3", "e8.1")]
colnames(moneymaker) = c("pollen", "leaf", "anther", "stem")
condition <- function(x) {
ifelse(x == 0, 0, 1)
}
upset.moneymaker <-
as.data.frame(lapply(moneymaker, condition))
pdf("outputs/tissue_heat_response.pdf",
width = 6.13,
height = 5.60)
upset(
upset.moneymaker,
nsets = 4,
sets.x.label = "significant genes",
mb.ratio = c(0.7, 0.3),
point.size = 2, line.size = 0.75,
matrix.color = "black", main.bar.color = "black",
text.scale = c(1.3, 1.3, 1, 1, 2, 1.3),
order.by = "freq"
)
dev.off()
moneymaker_mat = as.matrix(moneymaker)
pdf("outputs/tissue_heat_response_heatmap.pdf",
width = 6.13,
height = 5.60)
Heatmap(
moneymaker_mat, name = "logFC",
show_row_names = FALSE,
column_names_gp = gpar(fontsize = 9)
)
dev.off()