-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBoxPlotAttractors&NumberOfClusters.R
51 lines (48 loc) · 2.13 KB
/
BoxPlotAttractors&NumberOfClusters.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
BasinMacrophages<-read.table(file.choose(), header=T)
library(RColorBrewer)
library(ggplot2)
colourCount.stability = length(unique(BasinMacrophages$Phenotypes))
getPalette2 = colorRampPalette(brewer.pal(9, "Set1"))
p <- ggplot(BasinMacrophages, aes(x=Phenotypes, y=Value, fill=Phenotypes )) + geom_bar(stat = "identity") +
scale_fill_brewer(palette = "Paired") +
theme(legend.position = "none") +
labs( y = "Basin of Attraction")
q <- p + coord_flip()
q
svg(file="StabilityAttractorsAll.pdf")
q
dev.off()
##############################################
# Basin of attraction with #
# HIF1A =0 and NFKB=1 #
# #
# #
##############################################
BasinMacrophagesNoHIF1AandNFKB<-read.table(file.choose(), header=T)
library(ggplot2)
t <- ggplot(BasinMacrophagesNoHIF1AandNFKB, aes(x=Phenotypes, y=Value, fill=Phenotypes )) + geom_bar(stat = "identity") +
scale_fill_brewer(palette = "Paired") +
theme(legend.position = "none") + theme(text=element_text(family="Arial", size=10))+
labs( y = "Basin of Attraction")
u <- t + coord_flip()
ggsave("Fig6A.png", u, width=4, height=4)
##############################################
# Number of Clusters #
# #
# #
# #
##############################################
NumberOfClustersMacrophages<-read.table(file.choose(), header=T)
NumberOfClustersMacrophages <- data.frame(
Clusters=c(10,11,12,13,23,25,28,30),
Frecuency=c(6,2,4,2,4,1,1,3)
)
Clusters.Colors <- brewer.pal(8, "Set2")
barplot(height=NumberOfClustersMacrophages$Frecuency, names=NumberOfClustersMacrophages$Clusters,
col=Clusters.Colors,
xlab="Number of Clusters",
ylab="Frecuency among all indices",
names.arg = c("10", "11", "12", "13", "23", "25", "28", "30") ,
main="Best Partition Analysis with K-Means",
ylim=c(0,6)
)