1 Development

table24 <- read.csv("./24.csv", header = TRUE)
table30 <- read.csv("./30.csv", header = TRUE)

table24$Treatment[table24$Treatment == 'C_C'] <- 'C→C'
table30$Treatment[table30$Treatment == 'C_C'] <- 'C→C'
table24$Treatment[table24$Treatment == 'hP_hP'] <- 'hP→hP'
table30$Treatment[table30$Treatment == 'hP_hP'] <- 'hP→hP'
table24$Treatment[table24$Treatment == 'C_hP'] <- 'C→hP'
table30$Treatment[table30$Treatment == 'C_hP'] <- 'C→hP'
table24$Treatment[table24$Treatment == 'hP_C'] <- 'hP→C'
table30$Treatment[table30$Treatment == 'hP_C'] <- 'hP→C'

boxplot(weighted.development ~ Treatment, data = table24, xlab='treatment', ylab='Development rate (day)')

boxplot(weighted.development ~ Treatment, data = table30, xlab='treatment', ylab='Development rate (day)')

table24$Treatment <- factor(table24$Treatment , levels = c("C→C", "hP→hP", "C→hP", "hP→C"))
table30$Treatment <- factor(table30$Treatment , levels = c("C→C", "hP→hP", "C→hP", "hP→C"))

plot24 <- ggplot(table24, aes(x = Treatment, y = weighted.development)) + geom_boxplot() + labs(x = "Treatmet", y = "development rate (day)") + geom_signif(comparisons = list(c("C→hP", "hP→hP"), c("C→C", "hP→hP"), c("C→C", "hP→C")), annotation=c("P = 0.0005", "P < 0.0001", "P = 0.0003"), fontface = "italic", textsize = 6, y_position = c(35, 33, 38)) + theme_gray(base_size = 25) + theme(axis.title = element_blank(), axis.text=element_text(size=20, color = "black"), axis.text.x = element_blank()) + scale_y_continuous(limits = c(18, 40))
print(plot24)
## Warning: Removed 18 rows containing non-finite values (stat_boxplot).
## Warning: Removed 18 rows containing non-finite values (stat_signif).

plot30 <- ggplot(table30, aes(x = Treatment, y = weighted.development)) + geom_boxplot() + labs(x = "Treatmet", y = "development rate (day)") + geom_signif(comparisons = list(c("C→hP", "hP→hP"), c("C→C", "hP→hP"), c("C→C", "hP→C")), annotation=c("P = 0.0048", "P = 0.0022", "P < 0.0001"), fontface = "italic", textsize = 6, y_position = c(27, 26, 28)) + theme_gray(base_size = 25) + theme(axis.title = element_blank(), axis.text=element_text(size=20, color = "black")) + scale_y_continuous(limits = c(18, 30))
print(plot30)
## Warning: Removed 14 rows containing non-finite values (stat_boxplot).
## Warning: Removed 14 rows containing non-finite values (stat_signif).

combine <- ggarrange(plot24, plot30, label.x = 0, label.y = 1, hjust = 0, vjust = 1, font.label = list(size = 40, color = "black", face = "bold"), ncol = 1, nrow = 2)
## Warning: Removed 18 rows containing non-finite values (stat_boxplot).
## Warning: Removed 18 rows containing non-finite values (stat_signif).
## Warning: Removed 14 rows containing non-finite values (stat_boxplot).
## Warning: Removed 14 rows containing non-finite values (stat_signif).
combine_figure <- annotate_figure(combine, bottom = text_grob("Treatment", color = "black", face = "bold", size = 30), left = text_grob("Mean Development Time (day)", color = "black", rot = 90, face = "bold", size = 30), right = text_grob("24°C \n \n \n \n \n \n \n \n 30°C", color = "black", face = "bold", size = 36))
print(combine_figure)

jpeg("development_combine.jpeg", width = 750, height = 1000)
combine_figure
dev.off()
## png 
##   2
cairo_pdf("development_combine.pdf", width = 8, height = 12, family = "Helvetica")
combine_figure
dev.off()
## png 
##   2

2 Survival

survival_data <- read.csv("./Survival_data.csv", header = TRUE)

survival_data$Treatment[survival_data$Treatment == 'C_C'] <- 'C→C'
survival_data$Treatment[survival_data$Treatment == 'hP_hP'] <- 'hP→hP'
survival_data$Treatment[survival_data$Treatment == 'C_hP'] <- 'C→hP'
survival_data$Treatment[survival_data$Treatment == 'hP_C'] <- 'hP→C'



survival24 <- subset(survival_data, Temperature == "24")
survival30 <- subset(survival_data, Temperature == "30")

boxplot(Survival ~ Treatment, data = survival24, xlab='treatment', ylab='Survival (%)')

boxplot(Survival ~ Treatment, data = survival30, xlab='treatment', ylab='Survival (%)')

survival24$Treatment <- factor(survival24$Treatment , levels = c("C→C", "hP→hP", "C→hP", "hP→C"))
survival30$Treatment <- factor(survival30$Treatment , levels = c("C→C", "hP→hP", "C→hP", "hP→C"))

Sur_plot24 <- ggplot(survival24, aes(x = Treatment, y = Survival)) + geom_boxplot() + labs(x = "Treatmet", y = "Survival (%)") + theme_gray(base_size = 25) + theme(axis.title = element_blank(), axis.text=element_text(size=20, color = "black"), axis.text.x = element_blank()) + scale_y_continuous(limits = c(0, 1.3)) + geom_signif(comparisons = list(c("C→hP", "hP→hP"), c("C→C", "hP→hP"), c("C→C", "hP→C")), annotation=c("P = 0.0022", "P < 0.0001", "P = 0.0209"), fontface = "italic", textsize = 6, y_position = c(1.1, 1, 1.2)) 
print(Sur_plot24)

Sur_plot30 <- ggplot(survival30, aes(x = Treatment, y = Survival)) + geom_boxplot() + labs(x = "Treatmet", y = "Survival (%)") + theme_gray(base_size = 25) + theme(axis.title = element_blank(), axis.text=element_text(size=20, color = "black")) + scale_y_continuous(limits = c(0, 1.3)) + geom_signif(comparisons = list(c("C→hP", "hP→hP"), c("C→C", "hP→hP"), c("C→C", "hP→C")), annotation=c("P = 0.0003", "P < 0.0001", "P = 0.0022"), fontface = "italic", textsize = 6, y_position = c(1.1, 1, 1.2)) 
print(Sur_plot30)

Sur_combine <- ggarrange(Sur_plot24, Sur_plot30, label.x = 0, label.y = 1, hjust = 0, vjust = 1, font.label = list(size = 40, color = "black", face = "bold"), ncol = 1, nrow = 2)
Sur_combine_figure <- annotate_figure(Sur_combine, bottom = text_grob("Treatment", color = "black", face = "bold", size = 30), left = text_grob("Survival (%)", color = "black", rot = 90, face = "bold", size = 30), right = text_grob("24°C \n \n \n \n \n \n \n \n 30°C", color = "black", face = "bold", size = 36))
print(Sur_combine_figure)

jpeg("Survival_combine.jpeg", width = 750, height = 1000)
Sur_combine_figure
dev.off()
## png 
##   2
cairo_pdf("Survival_combine.pdf", width = 8, height = 12, family = "Helvetica")
Sur_combine_figure
dev.off()
## png 
##   2

3 Pepper - Cotton adaptation

cotton_not_cost <- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("hP→hP", "hP→C","C→C", "hP→hP", "hP→C","C→C"), LFC <- c(0.01, 1, 1, -0.01, -1, -1))
stress <- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("hP→hP", "hP→C", "C→C", "hP→hP", "hP→C", "C→C"), LFC <- c(0.01, 1, 0.01, -0.01, -1, -0.01))
cotton_cost <- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("hP→hP", "hP→C","C→C", "hP→hP", "hP→C","C→C"), LFC <- c(0.01, 0.01, 1, -0.01, -0.01, -1))
cotton_not_cost$comparison <- ordered(cotton_not_cost$comparison, levels=c("hP→hP", "hP→C","C→C"))

cnc <- ggplot(data=cotton_not_cost, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2) + theme(text = element_text(family = "Helvetica")) + scale_color_manual(values = c("green3", "orchid4")) + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), axis.text.x = element_blank(), axis.text.y = element_blank(), axis.text=element_text(size=13, color = "black", face = "bold")) + theme(legend.position = "none") + geom_hline(yintercept=0, linetype="dashed", color = "black") + annotate("text", x=3.8, y=0.78, label = "Cathepsin B (6) \n Cathepsin L (2) \n Proteolysis (5) \n Maltase (4) \n Alpha-glucosidase (1) \n Cytochrome P450 (1) \n Other (2) ", color = "orchid4", hjust = 1, size = 4, family = "Helvetica") + annotate("text", x=3.8, y=-0.65, label = "Oxidization-reduction process (2) \n Proteolysis (3) \n ATP binding (1) \n Transferring acyl groups (2) \n Structural constituent of cuticle (2) \n Chitin metabolic process (2) \n G protein-coupled receptor activity (3) \n Protein binding (1) \n N-acetyltransferase activity (1) \n Other (1) ", color = "green3", hjust = 1, size = 4, family = "Helvetica") 


cnc

###

stress$comparison <- ordered(stress$comparison, levels=c("hP→hP", "hP→C","C→C"))

str <- ggplot(data=stress, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2)  + theme(text = element_text(family = "Helvetica")) + scale_color_manual(values = c("green3", "orchid4"))  + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), axis.text.x = element_blank(), axis.text.y = element_blank(), axis.text=element_text(size=13, color = "black", face = "bold")) + theme(legend.position = "top", legend.title = element_blank()) + geom_hline(yintercept=0, linetype="dashed", color = "black") + scale_colour_manual(values = c("green3", "orchid4")) + theme(legend.position = "none") + annotate("text", x=3.8, y=0.95, label = "Cathepsin B (2) \n Proteolysis (1) \n Maltase (1) ", color = "orchid4", hjust = 1, size = 4, family = "Helvetica") + annotate("text", x=3.8, y=-0.8, label = "Oxidation-reduction process (2) \n Trehalose transporter (1) \n ABC transporter (1) \n Transferring acyl groups (1) \n Sulfotransferase (1) \n Other (1) ", color = "green3", hjust = 1, size = 4, family = "Helvetica")
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
str

###

cotton_cost$comparison <- ordered(cotton_cost$comparison, levels=c("hP→hP", "hP→C","C→C"))

cc <- ggplot(data=cotton_cost, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2)  + theme(text = element_text(family = "Helvetica")) + scale_color_manual(values = c("green3", "orchid4")) + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank(), axis.text=element_text(size=13, color = "black", face = "bold")) + theme(legend.position = "none") + geom_hline(yintercept=0, linetype="dashed", color = "black") + annotate("text", x=3.8, y=0.75, label = "Maltase (2) \n Proteolysis (5) \n Lipid metabolic process (1) \n Transcription (1) \n Protein binding (1) \n Nucleic acid binding (1) \n Carbohydrate metabolic process (1) \n Other (7) ", color = "orchid4", hjust = 1, size = 4, family = "Helvetica") + annotate("text", x=3.8, y=-0.89, label = "Oxidation-reduction process (2) \n Transferring acyl groups (2) \n Trehalose transporter (1) \n Other (4) ", color = "green3", hjust = 1, size = 4, family = "Helvetica")

cc

figure_cotton <- ggarrange(cnc, str, cc, labels = c("A", "B", "C"), label.x = 0, label.y = 1, hjust = 0, vjust = 1, font.label = list(size = 30, color = "black", face = "bold", family = "Helvetica"), ncol = 1, nrow = 3, common.legend = TRUE, legend="top", align = c("hv"))
evolution_cotton <- annotate_figure(figure_cotton, bottom = text_grob("Treatment", color = "black", face = "bold", size = 20, family = "Helvetica"), left = text_grob("Expression relative to hP→hP", color = "black", rot = 90, face = "bold", size = 20, family = "Helvetica"))

cairo_pdf("cotton_evo.pdf", height = 18, width = 11)
evolution_cotton
dev.off()
## png 
##   2

4 Plastic Evolved

p_e_same <- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("C→C", "C→hP", "hP→hP", "C→C", "C→hP", "hP→hP"), LFC <- c(0.01, 1, 1.5, -0.01, -1, -1.5))
p_not_e <- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("C→C", "C→hP", "hP→hP", "C→C", "C→hP", "hP→hP"), LFC <- c(0.01, 1, 1, -0.01, -1, -1))
e_not_p <- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("C→C", "C→hP", "hP→hP", "C→C", "C→hP", "hP→hP"), LFC <- c(0.01, 0.01, 1, -0.05, -0.05, -1))
p_e_opposite<- data.frame(Direction<- c("Upregulated genes", "Upregulated genes", "Upregulated genes", "Downregulated genes", "Downregulated genes", "Downregulated genes"), comparison <- c("C→C", "C→hP", "hP→hP", "C→C", "C→hP", "hP→hP"), LFC <- c(0, 1, 0, 0, -1, 0))
p_e_opposite$comparison <- ordered(p_e_opposite$comparison, levels=c("C→C", "C→hP", "hP→hP"))

peo <- ggplot(data=p_e_opposite, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2) + theme(text = element_text(family = "Helvetica"))+scale_color_manual(values = c("green3", "orchid4")) + theme(axis.title.x = element_blank(), axis.text.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank(), axis.text=element_text(size=13, color = "black", face = "bold")) + theme(legend.position = "none") + geom_hline(yintercept=0, linetype="dashed", color = "black") + ylim(-3,3) + annotate("text", x=4.5, y=2.5, label = "Maltase (1) \n UDP-glucuronosyltransferase (1) \n Trehalose transporter (1) \n Cytochrome P450 (1) \n Other (1) ", color = "orchid4", hjust = 1, size = 4, family = "Helvetica") 

peo

p_not_e$comparison <- ordered(p_not_e$comparison, levels=c("C→C", "C→hP", "hP→hP"))

pne <- ggplot(data=p_not_e, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2) + theme(text = element_text(family = "Helvetica")) + scale_color_manual(values = c("green3", "orchid4"))  + theme(axis.title.x = element_blank(), axis.text.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank(), axis.text=element_text(size=13, color = "black", face = "bold")) + theme(legend.position = "none") + geom_hline(yintercept=0, linetype="dashed", color = "black") + ylim(-3,3) + annotate("text", x=4.5, y=3, label = "Phospholipase A2 activity (1) ", color = "orchid4", hjust = 1, size = 4, family = "Helvetica") + annotate("text", x=4.5, y=-2.6, label = "Cathepsin B (3) \n Proteolysis (3) \n Maltase (1) \n Alpha-glucosidase (1) ", color = "green3", hjust = 1, size = 4, family = "Helvetica") 

pne

p_e_same$comparison <- ordered(p_e_same$comparison, levels=c("C→C", "C→hP", "hP→hP"))

pes <- ggplot(data=p_e_same, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2) + theme(text = element_text(family = "Helvetica")) + scale_color_manual(values = c("green3", "orchid4")) + theme(axis.title.x = element_blank(), axis.text.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank()) + theme(legend.position = "top", legend.title = element_blank()) + geom_hline(yintercept=0, linetype="dashed", color = "black") + ylim(-3,3) + scale_colour_manual(values = c("green3", "orchid4"), labels = c("Downregulated genes", "Upregulated genes")) + annotate("text", x=4.5, y=-3, label = "Cathepsin B (3) ", color = "green3", hjust = 1, size = 4, family = "Helvetica")
## Scale for 'colour' is already present. Adding another scale for 'colour',
## which will replace the existing scale.
pes

e_not_p$comparison <- ordered(e_not_p$comparison, levels=c("C→C", "C→hP", "hP→hP")) 

enp <- ggplot(data=e_not_p, aes(x=factor(comparison), y=LFC, colour=Direction, group=Direction)) + geom_path(lineend = "round",linejoin = "round", size=2) + theme(text = element_text(family = "Helvetica")) + scale_color_manual(values = c("green3", "orchid4")) + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank(), axis.text=element_text(size=13, color = "black", face = "bold")) + theme(legend.position = "none") + geom_hline(yintercept=0, linetype="dashed", color = "black") + ylim(-3,3) + annotate("text", x=4.5, y=1.7, label = "Structural constituent of cuticle (10) \n Oxidation-reduction process (6) \n Transferring acyl groups (4) \n Trehalose transporter (1) \n Proteolysis (3) \n UDP-glucuronosyltransferase (3) \n G protein-coupled receptor activity (4) \n Carbohydrate metabolic process (1) \n Chitin metabolic process (2) \n N-acetyltransferase activity (2) \n Other (13) ", color = "orchid4", hjust = 1, size = 4, family = "Helvetica") + annotate("text", x=4.5, y=-1.9, label = "Cathepsin B (2) \n Proteolysis (4) \n UDP-glucuronosyltransferase (1) \n Oxidation-reduction process (1) \n Lipid metabolic process (1) \n Maltase (2) \n Transcription (1) \n Peptide transport (1) \n Other (3) ", color = "green3", hjust = 1, size = 4, family = "Helvetica") 

enp

figure1 <- ggarrange(pne, pes, peo, enp, labels = c("A", "B", "C", "D"), label.x = 0, label.y = 1, hjust = 0, vjust = 1, font.label = list(size = 30, color = "black", face = "bold", family = "Helvetica"), ncol = 1, nrow = 4, common.legend = TRUE, legend="top", align = c("hv"))
evolution1 <- annotate_figure(figure1, bottom = text_grob("Treatment", color = "black", face = "bold", size = 20, family = "Helvetica"), left = text_grob("Expression relative to C→C", color = "black", rot = 90, face = "bold", size = 20, family = "Helvetica"))

cairo_pdf("evolution.pdf", height = 23, width = 8)
evolution1
dev.off()
## png 
##   2
###HEATMAP - each table separately###
my_palette <- colorRampPalette(c("#107C10", "#DEDFE4", "#5B2071"))(n = 299)
colors = c(seq(-2,-0.10,length=100),seq(-0.09,0.09,length=100),seq(0.10,2,length=100))

#Fig 5

#5a
zscore_5a <- read.csv("./fig_5_a_data_final.csv", header = TRUE)
hd_data <- scale(zscore_5a)
hd_data
##              CCF1       CCF2       CCF3       CCF4       CCF5        CPF1
##  [1,] -1.48535542 -1.4282384 -1.3024204 -1.4737265 -1.4334478 -0.87690983
##  [2,] -0.72919256 -0.7301793 -0.7917117 -0.7223234 -0.6587267 -0.83071456
##  [3,] -0.09446503 -0.3999716 -0.3037643 -0.4325037 -0.4256771 -0.09574919
##  [4,] -0.38735658 -0.5352016 -0.4784524 -0.3707452 -0.4539554 -0.21292718
##  [5,] -0.57194507 -0.4364955 -0.6154887 -0.4593531 -0.3137673 -0.77638021
##  [6,]  1.96256612  1.8773612  1.9447689  1.9182788  2.0416832  2.26059718
##  [7,]  0.16398809  0.3433652  0.2965486  0.2025500  0.0448826  0.68699470
##  [8,]  0.92126661  1.0357510  1.0283173  0.9474406  0.8605453  0.30294585
##  [9,]  0.22049386  0.2736091  0.2222027  0.3903825  0.3384633 -0.45785677
##             CPF2       CPF3        PPF1       PPF2        PPF3        PPF4
##  [1,] -0.5915387 -0.5462605 -0.82292569 -0.8986225 -0.43441488 -0.18598792
##  [2,] -1.1506951 -0.8472107 -0.75413771 -0.8536743 -0.71112231 -1.05320783
##  [3,] -0.4085509 -0.1880209 -0.38673733 -0.3311347 -0.46994090 -0.43340847
##  [4,] -0.3904642 -0.3880287 -0.37592559 -0.2787797 -0.57576279 -0.40780187
##  [5,] -0.6756679 -0.6851276 -0.37592559 -0.3951066 -0.49179166 -0.51344100
##  [6,]  2.0952481  2.4253546  2.28390413  2.3085040  2.36165025  2.32892363
##  [7,]  0.7350496  0.4906325  0.90886238  0.6608149  0.83941767  0.71656871
##  [8,]  0.7153151  0.1619919  0.04936258  0.3013696 -0.04085694  0.08965095
##  [9,] -0.3286959 -0.4233306 -0.52647718 -0.5133706 -0.47717844 -0.54129619
## attr(,"scaled:center")
##     CCF1     CCF2     CCF3     CCF4     CCF5     CPF1     CPF2     CPF3 
## 9.376090 9.567707 9.536794 9.244461 9.279456 8.544608 8.552152 8.465650 
##     PPF1     PPF2     PPF3     PPF4 
## 8.340560 8.315563 8.341707 8.328951 
## attr(,"scaled:scale")
##      CCF1      CCF2      CCF3      CCF4      CCF5      CPF1      CPF2      CPF3 
## 1.2243884 1.4147155 1.3186872 1.1232294 1.1971701 0.8211013 0.6019908 0.7571553 
##      PPF1      PPF2      PPF3      PPF4 
## 0.7800781 0.6700602 0.6876650 0.6306186
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_5_a_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_5_a_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2
#5b
zscore_5b <- read.csv("./fig_5_b_data_final.csv", header = TRUE)
hd_data <- scale(zscore_5b)
hd_data
##            CCF1       CCF2       CCF3       CCF4       CCF5       CPF1
## [1,]  0.2535459  0.2713281  0.2299318  0.4104758  0.4959639  0.1321272
## [2,]  0.8488222  0.8363369  0.8650078  0.7294451  0.6550766  0.9273682
## [3,] -1.1023681 -1.1076650 -1.0949396 -1.1399208 -1.1510406 -1.0594954
##            CPF2        CPF3       PPF1       PPF2       PPF3       PPF4
## [1,]  0.5214855  0.01572837  0.2445012  0.2096128  0.3807466  0.1719480
## [2,]  0.6314678  0.99204304  0.8550745  0.8785790  0.7536998  0.9028766
## [3,] -1.1529533 -1.00777141 -1.0995757 -1.0881918 -1.1344464 -1.0748245
## attr(,"scaled:center")
##     CCF1     CCF2     CCF3     CCF4     CCF5     CPF1     CPF2     CPF3 
## 9.053388 9.112966 9.118379 8.811569 8.917771 8.454624 8.539815 8.304696 
##     PPF1     PPF2     PPF3     PPF4 
## 8.106452 8.039404 8.072545 8.015008 
## attr(,"scaled:scale")
##      CCF1      CCF2      CCF3      CCF4      CCF5      CPF1      CPF2      CPF3 
## 0.9589834 1.1518245 1.1095175 0.8076733 0.9046229 0.7530849 0.7619592 0.8249850 
##      PPF1      PPF2      PPF3      PPF4 
## 0.6877322 0.5871477 0.5765094 0.5127190
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_5_b_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_5_b_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2
#5c
zscore_5c <- read.csv("./fig_5_c_data_final.csv", header = TRUE)
hd_data <- scale(zscore_5c)
hd_data
##            CCF1       CCF2       CCF3       CCF4       CCF5       CPF1
## [1,] -0.5215696 -0.4298007 -0.3856790 -0.4285993 -0.4384812 -0.5282047
## [2,] -0.6323416 -0.7354732 -0.7224334 -0.7598285 -0.6023591 -0.6060783
## [3,] -0.3154515 -0.2082361 -0.2691966 -0.2574431 -0.3133303 -0.3138252
## [4,]  1.7712831  1.7562697  1.7629880  1.7542974  1.7793178  1.7744526
## [5,] -0.3019204 -0.3827598 -0.3856790 -0.3084266 -0.4251471 -0.3263444
##            CPF2       CPF3        PPF1         PPF2       PPF3       PPF4
## [1,] -0.4777720 -0.5523589 -0.21046237 -0.551304679 -0.4957220 -0.4403270
## [2,] -0.5455523 -0.5319024 -1.15471193 -0.780038495 -0.6419724 -0.8231674
## [3,] -0.4265404 -0.2923546 -0.16469751  0.004106924 -0.3371541 -0.2687637
## [4,]  1.7834965  1.7789437  1.60902322  1.714048560  1.7720423  1.7362750
## [5,] -0.3336318 -0.4023278 -0.07915142 -0.386812310 -0.2971938 -0.2040168
## attr(,"scaled:center")
##     CCF1     CCF2     CCF3     CCF4     CCF5     CPF1     CPF2     CPF3 
## 8.027369 7.910267 7.715588 7.984553 7.983086 8.355812 8.696520 8.379981 
##     PPF1     PPF2     PPF3     PPF4 
## 7.623018 7.596894 7.924960 7.940301 
## attr(,"scaled:scale")
##      CCF1      CCF2      CCF3      CCF4      CCF5      CPF1      CPF2      CPF3 
## 1.0666507 1.0635861 0.6476769 0.9836512 1.1149581 1.3485711 1.8975421 1.2816942 
##      PPF1      PPF2      PPF3      PPF4 
## 0.4286695 0.3992282 0.9038466 0.7682994
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_5_c_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_5_c_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2
#5d
zscore_5d <- read.csv("./fig_5_d_data_final.csv", header = TRUE)
hd_data <- scale(zscore_5d)
hd_data
##              CCF1         CCF2        CCF3        CCF4        CCF5         CPF1
##  [1,]  2.82975225  3.847486122  3.83863830  3.48713822  3.42284647  3.674394366
##  [2,] -0.81334863 -0.536534902 -0.53034744 -0.67661977 -0.54976389 -0.397557941
##  [3,]  0.90508504  1.734814961  1.45387028  0.94816425  1.46630927  1.560706393
##  [4,] -0.68120078 -0.551858828 -0.54398265 -0.90632159 -0.85272306 -0.695959169
##  [5,]  0.31325651  0.859049494  0.85943500 -0.07136203 -0.17215836  0.243084925
##  [6,] -0.18542855 -0.125644168 -0.03435833 -0.07136203 -0.06668209 -0.017156710
##  [7,] -0.30375842  0.340280704  0.04309470  0.02316334 -0.21201003  0.167085268
##  [8,] -0.52702219 -0.002871615 -0.05865817 -0.28831983 -0.41420150 -0.212326273
##  [9,] -0.81334863 -0.807459428 -0.85294242 -0.75478133 -0.82221439 -0.857883653
## [10,] -0.26993372  0.800112487  0.40464450  0.15559768  0.15862594  0.449309317
## [11,]  0.04803544  0.277050667  0.36458364  0.20493411  0.22998582  0.213187825
## [12,] -0.35100149 -0.298117822 -0.39387110 -0.33579050 -0.28207508 -0.519289727
## [13,] -0.32705519 -0.744221790 -0.61616805 -0.51819126 -0.61112595 -0.714207626
## [14,] -0.57442322 -0.830068457 -0.87616539 -0.59325264 -0.63275742 -0.771974378
## [15,]  0.38208000  0.218228934 -1.35488028  0.75387966 -0.23945585  0.675405257
## [16,]  0.37597614  0.305517168  0.29299184  0.64689431  0.52352416  0.572409703
## [17,]  0.17012453  0.319530003  0.28067323  0.36987529  0.48580500  0.377049272
## [18,] -0.25893780 -0.358497662 -0.16161474 -0.14974840 -0.12748446 -0.360199996
## [19,]  0.92162489  0.658553969  0.57429688  0.78255806  0.84880670  0.735206528
## [20,] -0.35100149 -0.333901096 -0.36014585 -0.33579050 -0.01464202 -0.244683458
## [21,] -1.11838745 -0.959581409 -0.87616539 -0.95251341 -1.07027203 -1.017881071
## [22,] -0.32705519 -0.668320411 -0.67977786 -0.56742674 -0.44828082 -0.533879162
## [23,] -0.74299740 -0.599645864 -0.57201028 -0.70677221 -0.73947662 -0.881411396
## [24,]  0.57422326  1.234837202  0.87175108  0.68194674  0.41924017  0.613269734
## [25,]  2.03606591  2.760692069  2.58295016  2.28593945  2.15759705  2.514792351
## [26,] -0.76532991 -0.744221790 -0.60114523 -0.86423014 -0.63275742 -0.771974378
## [27,] -0.29234049 -0.067362072  0.02039811 -0.22542766 -0.03747812 -0.191267098
## [28,]  0.97015285  1.108133911  1.05293694  0.79468823  1.16318207  0.977884006
## [29,] -0.51191813 -0.230122256 -0.33834221 -0.47175175 -0.44828082 -0.360199996
## [30,]  0.06403657  0.573716906  0.37615136  0.23485097  0.22069966  0.265095616
## [31,]  0.24720439  0.567883502  0.37038018  0.47815968  0.44310175  0.342991235
## [32,] -0.11716145 -0.067362072 -0.05865817 -0.31652574 -0.26766522 -0.130333340
## [33,] -0.76532991 -0.830068457 -0.83077094 -0.86423014 -0.91982411 -0.835265010
## [34,] -1.05502891 -0.959581409 -0.90060221 -0.90632159 -1.04468320 -0.931676303
## [35,] -0.76532991 -0.650552916 -0.45314175 -0.78898838 -0.66649079 -0.813456499
## [36,] -0.08927794  0.108443146  0.21074429  0.37522355  0.19242851  0.159246929
## [37,]  0.12585442  0.744026944  0.82187921  0.50765519  0.42724016  0.548569501
## [38,] -0.72159851 -0.830068457 -0.69668805 -0.64774079 -0.68993230 -0.857883653
## [39,]  0.58470521  0.849380359  0.96304606  0.69917613  1.09350373  0.584194075
## [40,] -0.66204162 -0.878140513 -0.80952412 -0.55482946 -0.73947662 -0.504937818
## [41,] -0.68120078 -0.551858828 -0.73194298 -0.78898838 -0.75249157 -0.931676303
## [42,] -0.68120078 -0.011871904 -0.45314175 -0.53022047 -0.36540467 -0.212326273
## [43,] -0.92956254 -1.143274706 -1.05159783 -1.09877944 -1.20549466 -1.125924040
## [44,] -0.15558704 -0.057928554  0.10157514 -0.17438700 -0.17215836 -0.063033052
## [45,] -0.83940735 -1.143274706 -1.35488028 -1.06420490 -1.20549466 -1.170830486
## [46,] -0.17537804 -0.396611764  0.57429688 -0.55482946 -0.48376122 -0.336047335
## [47,] -0.40106426 -0.492173169 -0.47806563 -0.54243006 -0.43107498 -0.504937818
## [48,] -0.89704985 -0.878140513 -0.95401797 -0.95251341 -0.90216113 -0.881411396
## [49,]  0.17734119  0.041146828  0.40464450 -0.09431121  0.06193669  0.143433107
## [50,]  3.03053262  0.602540631  0.64258959  2.11014156  2.43302268  2.612914392
## [51,]  2.89579493  0.658553969  0.72143912  2.21974248  2.21294583  1.710457699
## [52,]  0.01532000 -0.135656593 -0.19827505  0.01615394 -0.02600262 -0.212326273
## [53,] -0.28106638 -0.422904514 -0.55786519 -0.29763251 -0.31154468 -0.449707499
## [54,] -0.66204162 -0.807459428 -1.01589642 -0.66203153 -0.97742648 -0.987368949
## [55,]  2.80081842  2.538917607  2.76081157  2.46681368  2.74090663  1.676477423
## [56,] -0.96556096 -1.266366481 -0.66330020 -1.39235208 -0.53999711 -0.857883653
## [57,] -0.92956254 -1.143274706 -1.09215463 -1.00426753 -1.02088216 -1.224140809
## [58,] -0.14583948 -0.686536336 -0.58643189 -0.33579050 -0.47475058 -0.360199996
## [59,] -0.57442322 -0.521488395 -0.51694943 -0.56742674 -0.62186137 -0.476905575
## [60,]  1.90175612  1.922337655  2.29513700  2.18211756  1.55473784  2.046028830
## [61,]  1.14626315  0.764661104  0.80915090  1.19255257  1.09095732  1.018875523
## [62,] -1.05502891 -1.143274706 -1.09215463 -1.03297016 -1.16394292 -1.086395849
## [63,]  0.28067427 -0.230122256 -0.17978318  0.57425601  0.32797979  0.009576212
## [64,] -0.78872570 -1.143274706 -0.78909669 -1.03297016 -0.79331065 -0.931676303
## [65,]  0.75627828  0.413799319  0.62340391  0.50278078  0.47428872  0.542550776
##               CPF2        CPF3        PPF1        PPF2         PPF3        PPF4
##  [1,]  2.875242859  3.49327230  3.39497582  3.63208647  3.623342215  4.11377349
##  [2,] -0.557972707 -0.71877932 -0.29576264 -0.32451743 -0.342138430 -0.56683276
##  [3,]  0.652556712  0.94581272  1.99361578  1.91529983  1.946054200  1.59279399
##  [4,] -0.661870809 -0.69918098 -0.52129870 -0.55985265 -0.624227082 -0.73976826
##  [5,]  0.445451148  0.43515385  1.11946608  1.01038460  0.972923995  1.29595570
##  [6,] -0.118269240 -0.03037258  0.16069346  0.07001036  0.021331430 -0.01034233
##  [7,] -0.223300763  0.13235885  0.87648235  0.63266911  0.549229731  0.32926775
##  [8,] -0.366266986 -0.25316596  0.34326769  0.23278787  0.198863536  0.18832378
##  [9,] -0.722550929 -0.78198109 -0.89281670 -0.68167190 -0.836011266 -0.65487328
## [10,]  0.107424664  0.24140514  1.18348058  0.99690460  0.841053283  1.00677996
## [11,] -0.031874186  0.26895532  0.45351382  0.55190897  0.591507673  0.48883439
## [12,] -0.590557951 -0.66179072  0.01296054  0.17890184 -0.002900383 -0.30230856
## [13,] -0.342580659 -0.47265459 -0.36948252 -0.36224424 -0.249199978 -0.21741590
## [14,] -0.643153725 -0.71877932 -0.35563784 -0.57399870 -0.493975182 -0.57881624
## [15,]  0.477869147 -1.32195182  1.87977566  1.65672937  1.844138321  2.13706075
## [16,]  0.423374712  0.45899403  0.86693606  1.05652555  0.781608386  1.03829694
## [17,] -0.007340801  0.19892545  0.74405192  1.17287352  0.814060153  0.35973118
## [18,] -0.483239132 -0.54553024 -0.12997872  0.26938028 -0.118980601  0.20540209
## [19,]  0.514695694  0.43515385  1.11349577  1.23676644  1.069586868  0.99398660
## [20,] -0.007340801 -0.04799447  0.28418793  0.16584825  0.193699706  0.48426516
## [21,] -0.846780818 -0.90893181 -0.89281670 -0.83165046 -0.836011266 -0.97727162
## [22,] -0.557972707 -0.59296897 -0.34879305 -0.58841837 -0.317025345 -0.47677101
## [23,] -0.767850458 -0.66179072 -0.62785778 -0.54596822 -0.509167670 -0.56683276
## [24,]  0.062980615 -0.02166647  1.42134547  1.28142748  1.352971198  0.90122717
## [25,]  1.977133281  2.43158045  2.56863162  2.49758891  2.517959414  2.60129416
## [26,] -0.681285752 -0.73906034 -0.41232728 -0.61814546 -0.595282565 -0.73976826
## [27,] -0.193443188  0.02921379  0.24963877  0.50084895  0.293037867  0.16518526
## [28,]  0.819919154  0.95848836  1.20603608  1.44684726  1.241543883  1.50532548
## [29,] -0.469255464 -0.50097822 -0.11910869 -0.11676532 -0.132675977 -0.22559595
## [30,]  0.157115897  0.24140514  0.61135634  0.66140859  0.583920347  0.40900176
## [31,]  0.417795442  0.77548997  0.69313369  0.65922068  0.722887390  0.75016315
## [32,] -0.275433303 -0.19024288  0.02721845  0.12576875  0.050913820 -0.16962702
## [33,] -0.877431306 -0.73906034 -0.83780520 -0.74275579 -0.725273231 -0.73976826
## [34,] -0.846780818 -1.05124414 -0.97086698 -0.96601703 -0.983559164 -0.89270848
## [35,] -0.681285752 -0.48668792 -0.61839354 -0.46128860 -0.499008920 -0.54338793
## [36,]  0.008696741  0.28923762  0.27659672  0.45019736  0.295421496  0.29280910
## [37,]  0.383791618  0.60474534  0.83542959  0.72537741  0.786525670  0.69216950
## [38,] -0.681285752 -0.60952081 -0.58167618 -0.66522609 -0.660487200 -0.64165525
## [39,]  0.275811035  1.15227031  1.82102909  1.51459176  1.883471348  1.00677996
## [40,] -0.557972707 -0.66179072 -0.44967699 -0.53911988 -0.618349842 -0.40498267
## [41,] -0.527031043 -0.56099670 -0.48871263 -0.79043157 -0.660487200 -0.62866812
## [42,] -0.428913146 -0.38065361 -0.03095581  0.06284047  0.050913820 -0.13891413
## [43,] -1.055369935 -0.93945562 -0.98812655 -1.01104954 -0.994401948 -0.85511043
## [44,] -0.015454024  0.01250470  0.26126622  0.22968624  0.226878521 -0.03078549
## [45,] -1.055369935 -1.16556524 -0.97086698 -0.96601703 -0.972966073 -0.85511043
## [46,] -0.164537350 -0.38065361  0.01296054 -0.06284733  0.180692561  0.33439391
## [47,] -0.415954610 -0.48668792 -0.47288285 -0.36776645 -0.300639994  0.16518526
## [48,] -0.949911274 -0.73906034 -0.75245687 -0.70713700 -0.796900655 -0.91254481
## [49,]  0.143141855 -0.09332762  0.32876465  0.34780072  0.323673585  0.09923435
## [50,]  3.788996532  3.06417730 -0.10301277 -0.43692395  0.623276455  0.02294989
## [51,]  2.958806768  2.04264863  0.04129725 -0.09153090  0.102322362  0.08685173
## [52,] -0.254201517  0.06192244 -0.97086698 -0.90021979 -0.781926386 -0.69603459
## [53,] -0.428913146 -0.20045626 -0.97086698 -1.02731461 -1.028620454 -1.08170821
## [54,] -0.643153725 -0.57680194 -1.32099312 -1.28403068 -1.357166792 -1.05291328
## [55,]  2.008431093  2.07530997  0.11791273 -0.03887114 -0.118980601  0.34458707
## [56,] -0.949911274 -1.10085364 -1.32099312 -1.39523790 -1.458909565 -1.44265139
## [57,] -0.911362938 -0.90893181 -1.44944234 -1.39523790 -1.357166792 -1.44265139
## [58,] -0.091546019 -0.11200676 -1.13532417 -1.02731461 -0.983559164 -0.71030384
## [59,] -0.625067122 -0.62648814 -0.95422975 -1.06227532 -1.171515450 -0.91254481
## [60,]  2.266337247  1.62748725  0.09590953  0.12916296  0.371632580  0.66025223
## [61,]  0.888831615  1.08768655 -0.42707745 -0.30881756 -0.449948336 -0.15416150
## [62,] -0.995676444 -1.16556524 -1.44944234 -1.39523790 -1.357166792 -1.44265139
## [63,]  0.070515095  0.02088993 -0.92258821 -0.99545952 -1.016911086 -0.93317941
## [64,] -0.722550929 -0.90893181 -1.32099312 -1.20271732 -1.209925240 -1.14775194
## [65,]  0.703102222  0.67747142 -0.52129870 -0.36776645 -0.493975182 -0.38547006
## attr(,"scaled:center")
##     CCF1     CCF2     CCF3     CCF4     CCF5     CPF1     CPF2     CPF3 
## 8.206679 8.260681 8.196216 8.162349 8.253549 8.161888 8.125050 8.162071 
##     PPF1     PPF2     PPF3     PPF4 
## 8.576667 8.525233 8.518615 8.371382 
## attr(,"scaled:scale")
##      CCF1      CCF2      CCF3      CCF4      CCF5      CPF1      CPF2      CPF3 
## 0.8483150 0.7894191 0.7884004 0.7428587 0.8093764 0.7072927 0.8311124 0.7822091 
##      PPF1      PPF2      PPF3      PPF4 
## 0.9994455 1.0014098 0.9531684 0.8618531
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_5_d_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_5_d_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2
###Fig 6###
#6a
zscore_6a <- read.csv("./fig_6_a_data_final.csv", header = TRUE)
hd_data <- scale(zscore_6a)
hd_data
##              PPF1        PPF2        PPF3        PPF4         PCF1         PCF2
##  [1,] -0.21324893 -0.30296938 -0.14986945 -0.23604163  0.786966768  1.035402988
##  [2,] -0.77324608 -0.74452086 -0.63383609 -0.75567190  0.010857098  0.312265065
##  [3,]  0.23694426  0.11102414  0.08697300  0.20816822  1.278502233  1.083769826
##  [4,] -0.46597663 -0.37547953 -0.45114407 -0.29238321  0.295722454  0.274989542
##  [5,] -0.45693441 -0.33850404 -0.53130288 -0.27324275  0.076968811  0.233892267
##  [6,] -1.20427520 -1.10612303 -1.11208686 -0.99374717 -0.854354881 -0.607182995
##  [7,]  0.23694426  0.03834745 -0.02522290  0.43389369  1.143201158  1.539967475
##  [8,] -0.92970636 -0.88390331 -0.73700489 -0.75567190 -0.740951007 -0.646904674
##  [9,] -0.92970636 -1.00494399 -0.98029904 -1.02316313 -0.817578154 -0.545764388
## [10,] -0.45693441 -0.42065938 -0.46769576 -0.35220606 -0.211709982 -0.091475094
## [11,]  1.76757174  1.48875398  1.69375224  1.77240952  2.921304952  3.006289030
## [12,]  0.15983555  0.16078996  0.13150040  0.18952558  0.578243574  0.717200151
## [13,]  0.61757751  0.32508061  0.54067933  0.56720370  0.954337111  0.972296189
## [14,]  0.67876423  0.60801619  0.76953454  1.08742307  1.191390506  1.406224656
## [15,] -0.10125144  0.07122392 -0.12611813  0.09859414  2.070621220  1.974069887
## [16,] -0.27786428 -0.21426130 -0.20746108  0.05042531 -0.085172692 -0.038395771
## [17,] -0.48435163 -0.24657809 -0.28660978 -0.03706991 -0.246411471 -0.196053108
## [18,] -0.58284583 -0.50418282 -0.45662642 -0.37302731  1.147082636  1.030574539
## [19,] -0.80132908 -0.98777638 -1.11208686 -0.85035131 -0.817578154 -0.838531737
## [20,] -1.24792747 -1.10612303 -1.19339237 -1.39189093 -1.119165670 -0.922080033
## [21,] -0.27786428 -0.35066197 -0.19903653 -0.25446854 -0.097908149  0.005771174
## [22,]  0.12448575  0.26820448  0.09665550 -0.22695382 -0.565505196 -0.640114091
## [23,]  1.03953868  1.19452685  0.92035029  1.14256511 -0.246411471 -0.098322819
## [24,] -0.26314091 -0.54169374 -0.23315993 -0.40517898 -0.970761244 -0.970813249
## [25,] -0.56216471 -0.49688806 -0.43489972 -0.49718313 -0.761735823 -0.945707164
## [26,] -0.70799497 -0.64012184 -0.69837071 -0.72168062 -0.970761244 -0.984012073
## [27,]  2.06186966  1.67801080  2.07725105  1.11036840  0.290009418  0.124830333
## [28,]  0.90786571  1.31733088  0.95442302  0.44936442 -0.000621981 -0.166000931
## [29,]  1.30373266  1.38476918  1.22271323  1.09729911  0.243107303  0.048038167
## [30,]  3.74838706  3.91300367  3.90402805  4.28437185  2.107575960  1.585445311
## [31,] -0.20631771 -0.26314913 -0.25952741 -0.49718313 -0.682835645 -0.838531737
## [32,] -0.01702924 -0.04386902 -0.03960235 -0.14858672 -0.629887412 -0.829053826
## [33,]  0.76567958  0.77748516  0.71278779  0.49969764 -0.192489308 -0.431607625
## [34,]  0.13976340  0.21212308  0.15315771 -0.09141068 -0.472308583 -0.704027592
## [35,] -0.78712783 -0.70459522 -0.66179970 -0.67384841 -0.970761244 -0.958058951
## [36,] -0.92970636 -0.94024505 -0.93298695 -0.83008716 -1.149505441 -1.114417162
## [37,] -1.10592574 -1.13107867 -1.14976712 -1.13090827 -1.346228967 -1.363288147
## [38,]  0.40697753  0.55455399  0.40987849  0.38099901 -0.206864859 -0.436671362
## [39,] -0.41306772 -0.75491649 -0.59377762 -0.56035213 -0.938382629 -0.984012073
##             PCF3        PCF4        PCF5        CCF1        CCF2         CCF3
##  [1,]  0.7754710  0.65710244  0.66888469  0.60255302  0.56332495  0.571418766
##  [2,]  0.1476284 -0.01430930  0.14351624 -0.16226505 -0.19944125 -0.195880099
##  [3,]  1.0077524  1.50538525  0.90638322  1.13941034  1.12059280  1.185304555
##  [4,]  0.3784786  0.36948736  0.47549768  0.56859764  0.20057608  0.364706212
##  [5,]  0.3812101  0.07407258  0.36817849  0.23134505  0.03675693  0.164012915
##  [6,] -0.6832271 -0.89072629 -0.74078181 -0.62029503 -0.79677504 -0.709246302
##  [7,]  1.6515920  0.81890198  1.59002926  1.81206757  1.28215133  1.442071294
##  [8,] -0.5342212 -0.74268253 -0.62759229 -0.65561122 -0.73826111 -0.716966180
##  [9,] -0.4570877 -0.79082931 -0.53678389 -0.64661689 -0.71996384 -0.837427984
## [10,]  0.1339611 -0.40014615  0.10785025  0.01879898  0.15633055  0.006576547
## [11,]  2.9762221  3.05099680  2.92388349  2.93718457  2.95936235  2.947970176
## [12,]  0.7099837  0.61013121  0.82144793  0.67265219  0.60489199  0.670178488
## [13,]  0.7461588  0.87589792  0.79057051  0.86619581  1.10106246  1.054385501
## [14,]  1.6866827  0.95126883  1.63920903  1.29048857  1.26141533  1.206747014
## [15,]  1.6562660  1.99080345  1.65239145  1.73817093  1.93982639  1.895089852
## [16,]  0.3920682 -0.33096863  0.41430587  0.29635551  0.15633055  0.233396851
## [17,]  0.2632021 -0.42845185  0.38633500  0.06878974  0.14334059 -0.087619726
## [18,]  1.4473321  0.77038162  1.38844962  0.93125987  1.01655918  0.968971993
## [19,] -0.7120071 -0.87854392 -0.74968239 -0.73213356 -0.95094719 -0.800276563
## [20,] -1.0425318 -1.00345646 -0.71481849 -0.93575489 -1.14975190 -1.109533417
## [21,]  0.1810283 -0.16486316  0.09124347  0.12822341  0.12687407  0.141720146
## [22,] -0.8589018 -0.42270722 -0.72335448 -0.70241014 -0.63561126 -0.724785377
## [23,]  0.2354732 -0.22570138  0.33906032 -0.12243759 -0.22756962 -0.252999875
## [24,] -0.7635719 -0.92942636 -0.81602920 -0.68330612 -0.88585864 -0.921166136
## [25,] -1.0209057 -0.82194428 -1.02550334 -1.01513898 -0.83943642 -0.847143826
## [26,] -0.9819247 -0.90324778 -1.13717451 -1.07126420 -1.06337676 -0.877474469
## [27,] -0.5568076  0.39337670 -0.44973398  0.04408354  0.14006784  0.207240223
## [28,] -0.3872120  0.18738074 -0.15685583 -0.28666311 -0.21809730 -0.261461161
## [29,] -0.1370628  0.34750192 -0.17404041  0.31287333  0.01107413 -0.059779901
## [30,]  1.2844587  2.38509081  1.38384658  1.83515057  2.16670981  2.182398068
## [31,] -0.9154779 -0.66504274 -0.92756470 -1.07126420 -0.79677504 -0.818526873
## [32,] -0.9471503 -0.52688271 -0.95331572 -0.83078718 -0.58964802 -0.686644250
## [33,] -0.5416679  0.07407258 -0.62018884 -0.37129859 -0.04627353 -0.195880099
## [34,] -0.7745173 -0.36747422 -0.71481849 -0.51585584 -0.47962634 -0.494537694
## [35,] -1.0660724 -0.89072629 -1.09540189 -1.03295554 -0.99519614 -1.024878742
## [36,] -1.0660724 -1.12127730 -1.05866244 -1.26407334 -1.08274354 -1.072843742
## [37,] -1.2027705 -1.36685284 -1.40835919 -1.31461990 -1.40397419 -1.280626154
## [38,] -0.5195629 -0.20348569 -0.47974285 -0.49361077 -0.36078656 -0.309493245
## [39,] -0.8862164 -0.97210576 -0.98067833 -0.96583850 -0.80713362 -0.956996788
##              CCF4        CCF5
##  [1,]  0.55859065  0.67532376
##  [2,] -0.15651219 -0.16880976
##  [3,]  0.81807508  0.81409078
##  [4,]  0.17137393  0.10016902
##  [5,]  0.24124415  0.06753100
##  [6,] -0.70267110 -0.76107887
##  [7,]  1.41648885  1.74115750
##  [8,] -0.75734833 -0.72078894
##  [9,] -0.65194219 -0.64068532
## [10,]  0.14099802  0.22933187
## [11,]  2.83092037  2.94792167
## [12,]  0.69572540  0.54747785
## [13,]  0.88983889  0.64327479
## [14,]  1.54519110  1.40779734
## [15,]  1.73256726  1.58468801
## [16,]  0.40504015  0.14742831
## [17,]  0.07450402  0.05922158
## [18,]  1.10234229  0.98211672
## [19,] -0.74926232 -0.72078894
## [20,] -1.04677555 -1.11532876
## [21,]  0.12238651 -0.13166080
## [22,] -0.68049300 -0.61769004
## [23,]  0.05477751  0.01092302
## [24,] -0.85380930 -0.74738120
## [25,] -0.95807123 -0.97460272
## [26,] -1.06106506 -1.06296948
## [27,]  0.09389613  0.45568089
## [28,] -0.15249537 -0.01850943
## [29,]  0.15628468  0.26474259
## [30,]  2.17992239  2.27327852
## [31,] -0.93551039 -0.82656894
## [32,] -0.78222277 -0.74738120
## [33,] -0.25352411 -0.22537243
## [34,] -0.66607860 -0.60644596
## [35,] -1.07588537 -1.11532876
## [36,] -1.10737930 -1.21275692
## [37,] -1.47104004 -1.30581587
## [38,] -0.14849367 -0.24743255
## [39,] -1.01958752 -0.98475835
## attr(,"scaled:center")
##     PPF1     PPF2     PPF3     PPF4     PCF1     PCF2     PCF3     PCF4 
## 8.473508 8.449924 8.428104 8.302307 8.829596 8.750382 8.631339 8.873288 
##     PCF5     CCF1     CCF2     CCF3     CCF4     CCF5 
## 8.653863 8.655817 8.767623 8.717608 8.588515 8.665947 
## attr(,"scaled:scale")
##      PPF1      PPF2      PPF3      PPF4      PCF1      PCF2      PCF3      PCF4 
## 0.9327351 0.9487637 0.9078229 0.8436576 1.2639515 1.1900302 1.1444048 1.2768454 
##      PCF5      CCF1      CCF2      CCF3      CCF4      CCF5 
## 1.0834130 1.0633365 1.1678244 1.1478161 0.9928264 1.0372565
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_6_a_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_6_a_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2
#6b
zscore_6b <- read.csv("./fig_6_b_data_final.csv", header = TRUE)
hd_data <- scale(zscore_6b)
hd_data
##                PPF1       PPF2        PPF3        PPF4        PCF1       PCF2
##  [1,] -0.1438060194 -0.1076440  0.07492055  0.25319976  0.62433191  0.6949267
##  [2,]  2.5926640557  2.3668930  2.57767007  2.51317088  2.69442724  2.5500547
##  [3,] -0.4347133086 -0.4090142 -0.51802728 -0.02840592  0.40086281  0.7961274
##  [4,] -0.7424088197 -0.8981489 -0.68726764 -0.66863663 -0.50803414 -0.4135962
##  [5,] -0.8782362156 -0.8542506 -0.90414826 -0.86607579 -0.79019569 -0.7765042
##  [6,] -0.5072399658 -0.7371965 -0.58884710 -0.55023959 -0.56685403 -0.6787838
##  [7,]  0.0002166964  0.1428076 -0.02386592 -0.19799288 -0.39244922 -0.4846993
##  [8,] -0.5905077504 -0.5728933 -0.48313139 -0.73410027 -0.54563678 -0.6383873
##  [9,] -0.5532119910 -0.5728933 -0.60643883 -0.75247888 -0.69014944 -0.6383873
## [10,]  0.4809703204  0.5828265  0.28670411  0.04527829 -0.23984101 -0.2806841
## [11,]  0.7762729981  1.0595137  0.87243169  0.98628104  0.01353835 -0.1300666
##              PCF3        PCF4       PCF5         CCF1        CCF2       CCF3
##  [1,]  0.79029778  0.61654545  0.6209829  0.027175152  0.48936605  0.1134258
##  [2,]  2.49179286  2.75321241  2.4800747  2.587946674  2.65429918  2.6380027
##  [3,]  0.75287341  0.19757731  0.7918497 -0.006966694 -0.37223830 -0.2634765
##  [4,] -0.43952616 -0.43564623 -0.6010233 -0.824439005 -0.66913088 -0.6490069
##  [5,] -0.84741555 -0.75901529 -0.8156365 -0.806524876 -0.71823633 -0.7891867
##  [6,] -0.64562740 -0.66890737 -0.6659430 -0.595294632 -0.51445848 -0.5335750
##  [7,] -0.43268126 -0.41192882 -0.3047958 -0.063057739 -0.29564894 -0.3634298
##  [8,] -0.69473142 -0.50485065 -0.6107673 -0.614994015 -0.55873363 -0.3719241
##  [9,] -0.63176350 -0.57901245 -0.7406613 -0.397880340 -0.71823633 -0.7891867
## [10,] -0.43952616 -0.15823574 -0.4894870 -0.299450334  0.04670036  0.1663089
## [11,]  0.09630741 -0.04973861  0.3354068  0.993485809  0.65631730  0.8420485
##              CCF4        CCF5
##  [1,]  0.25583262  0.03757161
##  [2,]  2.54599734  2.63593981
##  [3,]  0.07232605 -0.02504735
##  [4,] -0.72528069 -0.78253347
##  [5,] -0.91877753 -0.86750761
##  [6,] -0.62927556 -0.59314883
##  [7,]  0.04401403 -0.10248445
##  [8,] -0.79120525 -0.63844500
##  [9,] -0.50314703 -0.41914429
## [10,] -0.21792457 -0.09923975
## [11,]  0.86744058  0.85403932
## attr(,"scaled:center")
##     PPF1     PPF2     PPF3     PPF4     PCF1     PCF2     PCF3     PCF4 
## 8.343211 8.306367 8.275133 8.346394 8.262825 8.488335 8.534795 8.311095 
##     PCF5     CCF1     CCF2     CCF3     CCF4     CCF5 
## 8.552616 8.555354 8.263527 8.246348 8.375776 8.478667 
## attr(,"scaled:scale")
##     PPF1     PPF2     PPF3     PPF4     PCF1     PCF2     PCF3     PCF4 
## 1.091599 1.034983 1.161455 1.113305 1.436096 1.751835 1.660068 1.558687 
##     PCF5     CCF1     CCF2     CCF3     CCF4     CCF5 
## 1.599328 1.315219 1.211108 1.202691 1.120690 1.258053
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_6_b_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_6_b_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2
#6c
zscore_6c <- read.csv("./fig_6_c_data_final.csv", header = TRUE)
hd_data <- scale(zscore_6c)
hd_data
##              PPF1        PPF2        PPF3        PPF4       PCF1        PCF2
##  [1,] -0.63623400 -0.94719309 -0.77362017 -0.98815900 -0.8944253 -0.93290127
##  [2,]  1.31820121  1.39130955  1.65299073  1.67141917  2.1700975  1.98973254
##  [3,] -0.11979459 -0.15113557 -0.19642327 -0.31772414 -0.1749346 -0.36248708
##  [4,] -0.71239813 -0.77659598 -0.83421250 -0.49525054 -0.6538068 -0.73081748
##  [5,] -0.71239813 -0.94719309 -0.98058863 -0.98815900 -0.8944253 -0.93290127
##  [6,] -0.89648199 -0.94719309 -0.98058863 -0.80149632 -0.6538068 -0.93290127
##  [7,] -0.89648199 -0.60625317 -0.83421250 -0.80149632 -0.8944253 -0.93290127
##  [8,] -0.44631122 -0.38278145 -0.29670762 -0.06194653 -0.4780054 -0.39917375
##  [9,]  0.56869522  0.71942682  0.47099197  0.64141620 -0.2158063  0.03011474
## [10,]  0.43366435  0.62899645  0.40765107  0.34887630  0.5856055  0.43447759
## [11,] -0.41040155 -0.35783007 -0.41515881 -0.49525054 -0.2593761 -0.43862086
## [12,] -0.52867849 -0.70599283 -0.54211834 -0.61519463 -0.4780054 -0.52908750
## [13,] -0.31607251 -0.16924860 -0.39672331 -0.49525054 -0.1363237 -0.32806182
## [14,] -0.14143389 -0.33391424 -0.34469064 -0.34382108 -0.5542810 -0.48155605
## [15,] -0.31607251 -0.40891698 -0.29670762 -0.34382108 -0.3062434 -0.32806182
## [16,] -0.71239813 -0.65185746 -0.62237782 -0.61519463 -0.8944253 -0.58308611
## [17,] -0.89648199 -0.94719309 -0.72715256 -0.80149632 -0.6538068 -0.52908750
## [18,] -0.14143389  0.03957828 -0.06148669 -0.13820495 -0.5542810 -0.43862086
## [19,] -0.89648199 -0.94719309 -0.83421250 -0.98815900 -0.8944253 -0.93290127
## [20,]  0.65123599  0.63746779  0.75980626  0.56141728  0.4901626  0.75918019
## [21,]  3.87470528  3.73466828  3.77146734  3.53916417  3.5479027  3.31287444
## [22,] -0.37700984 -0.08262344  0.06506984 -0.34382108  0.2970529 -0.05662182
## [23,]  1.58802779  1.44758650  1.39700081  1.44884532  1.3792834  1.68559297
## [24,] -0.09876758 -0.08262344 -0.08443220 -0.39958524  0.2246108 -0.20681655
## [25,]  0.53630725  0.36613224  0.22871472  0.32419838  0.2493063  0.88713126
## [26,] -0.23535856 -0.35783007 -0.31230701 -0.24508589 -0.1749346 -0.17962449
## [27,]  0.01680355  0.20940638  0.09422794  0.69848051  0.2734425  0.48990147
## [28,]  0.50305033  0.62899645  0.68580012  1.04529951  0.5482741  0.66722484
##              PCF3        PCF4       PCF5         CCF1        CCF2         CCF3
##  [1,] -0.93903781 -0.67948955 -0.8465279 -0.674765807 -0.84803443 -0.810277208
##  [2,]  1.82803186  2.57290827  1.5331742  3.142419177  3.49490941  3.337436732
##  [3,] -0.61897100  0.00980045 -0.4645414 -0.090170835  0.30074194  0.004864253
##  [4,] -0.61897100 -0.52817573 -0.5233035 -0.354247021 -0.22301327 -0.766031334
##  [5,] -0.75412824 -0.88657586 -1.0238566 -0.768205503 -0.84803443 -0.329047715
##  [6,] -0.93903781 -0.88657586 -1.0238566 -0.976639740 -1.07742739  0.721453440
##  [7,] -0.67761936 -0.59382851 -1.0238566 -1.185493594 -1.07742739  2.237605993
##  [8,] -0.38572737 -0.26726320 -0.2548598  0.349781435 -0.05831872 -0.233782404
##  [9,]  0.58591120  0.07687017  0.7585084  2.112031050  1.91817980  1.495807332
## [10,] -0.09703638  0.63131594  0.4999381  1.580145527  1.44031388  1.265605228
## [11,] -0.13763325 -0.52817573 -0.3866834 -0.016059277 -0.25380626 -0.147670598
## [12,] -0.67761936 -0.59382851 -0.7731490 -0.560608894 -0.61912627 -0.270635364
## [13,] -0.41720522 -0.33996679 -0.2960467 -0.280559904 -0.19332964 -0.270635364
## [14,] -0.05840441 -0.52817573  0.1253109  0.931487314  0.56330707  0.270190164
## [15,] -0.25003081 -0.23401585 -0.2751587 -0.129327115 -0.28584319  0.004864253
## [16,] -0.56957432 -0.59382851 -0.7168921 -0.527026616 -0.68038618 -0.484951270
## [17,] -0.75412824 -0.67948955 -0.7168921 -0.719108625 -0.84803443 -0.536599490
## [18,] -0.15876182 -0.52817573  0.2008599  0.646817706  0.28244523  0.073682959
## [19,] -0.93903781 -0.88657586 -0.8465279 -0.890227434 -0.68038618 -0.860540534
## [20,]  0.82142730  0.30573999  0.9081848  0.102628221 -0.13688502 -0.270635364
## [21,]  3.63127010  3.44573321  3.6169013  1.069790733  1.17395138 -1.186144709
## [22,] -0.38572737  0.11894651 -0.3866834 -0.674765807 -0.31927933 -0.655192644
## [23,]  1.45261680  1.32006630  1.3367630  0.069968781  0.42196261  0.046661018
## [24,] -0.38572737 -0.08890062 -0.4645414 -0.976639740 -0.43020001 -0.592858260
## [25,]  0.46737258  0.15921223  0.3806393 -0.354247021 -0.31927933 -0.510267638
## [26,] -0.09703638 -0.33996679 -0.1970720 -0.719108625 -0.68038618 -0.810277208
## [27,]  0.47862268 -0.08890062  0.2249249 -0.109558459 -0.22301327 -0.623143584
## [28,]  0.59616281  0.63131594  0.6352443  0.001690069  0.20639958 -0.099480683
##              CCF4         CCF5
##  [1,] -0.59172433 -0.891373773
##  [2,]  3.19299749  1.957000444
##  [3,]  0.29663179  0.167256792
##  [4,] -0.24099944 -0.817675707
##  [5,] -1.12278111 -0.338352613
##  [6,] -1.12278111  1.470997464
##  [7,] -0.76832447  3.235689514
##  [8,]  0.15290069 -0.266857257
##  [9,]  1.99820670  1.448802481
## [10,]  1.16538319  0.773073960
## [11,] -0.48513200 -0.164545615
## [12,] -0.76832447 -0.266857257
## [13,] -0.15795651 -0.349054781
## [14,]  1.25168167  0.612752641
## [15,] -0.19024042 -0.416293639
## [16,] -0.68886700 -0.615926641
## [17,] -0.72657951 -0.138398749
## [18,]  0.42567317  0.186758971
## [19,] -0.68886700 -1.022055299
## [20,] -0.06732815 -0.416293639
## [21,]  1.46855745 -0.009027748
## [22,] -0.72657951 -0.949924989
## [23,]  0.15290069  0.237317069
## [24,] -0.59172433 -0.919413318
## [25,] -0.11156474 -0.556936778
## [26,] -0.76832447 -1.067586559
## [27,] -0.19024042 -0.664076242
## [28,] -0.09659383 -0.218998733
## attr(,"scaled:center")
##     PPF1     PPF2     PPF3     PPF4     PCF1     PCF2     PCF3     PCF4 
## 7.753224 7.746346 7.777694 7.801418 7.662099 7.687006 7.772244 7.729321 
##     PCF5     CCF1     CCF2     CCF3     CCF4     CCF5 
## 7.821563 7.865399 7.752518 7.882594 7.818830 8.066407 
## attr(,"scaled:scale")
##      PPF1      PPF2      PPF3      PPF4      PCF1      PCF2      PCF3      PCF4 
## 0.6973887 0.6527895 0.6625261 0.6814592 0.5971112 0.5991821 0.6860380 0.6782196 
##      PCF5      CCF1      CCF2      CCF3      CCF4      CCF5 
## 0.6773747 0.6219947 0.5796124 0.6361497 0.6152600 0.7386354
hd_data <- data.frame(hd_data)
treat_data <- read.csv("./fig_6_c_gene_final.csv", header = TRUE)
rownames(hd_data) <- treat_data[,1]
numerix_data <- hd_data
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.

pdf("figure_6_c_heatmap.pdf",paper = "a4r")
heatmap.2(as.matrix(numerix_data), Rowv=FALSE,Colv=FALSE, scale = "row", symm=F,symkey=F,symbreaks=T, breaks=colors, cexRow=0.6, cexCol =1.5, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.2,0.9), lwid = c(0.3,0.7), margins=c(10,5), sepwidth=c(0.05,0.05), key=F, key.title=NA, keysize=0.5, key.par=list(mgp=c(1, 0.5, 0), mar=c(1,0.5,0.4,0.4)), trace="none", density.info="none", col = my_palette)  
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Using scale="row" or scale="column" when breaks arespecified can produce
## unpredictable results.Please consider using only one or the other.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row dendogram.
## Warning in heatmap.2(as.matrix(numerix_data), Rowv = FALSE, Colv = FALSE, :
## Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
## dendogram.
dev.off()
## png 
##   2