-
Notifications
You must be signed in to change notification settings - Fork 0
/
hbxplot.R
20 lines (19 loc) · 2.71 KB
/
hbxplot.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library(ggplot2)
hbx <- read.csv('/home/cristig/Desktop/Homeodomains/hbxCountMelt.csv', header=FALSE)
colnames(hbx)=c("species","groups","class", "family", "value")
hbx$species <- factor(hbx$species, c('Leucosolenia complicata','Sycon ciliatum','Amphimedon queenslandica','Oscarella carmela','Aiptasia pallida','Nematostella vectensis','Acropora digitifera','Hydra magnipapillata','Thelohanellus kitauei','Mnemiopsis leidyi','Trichoplax adhaerens','Patiria miniata','Strongylocentrotus purpuratus','Lytechinus variegatus','Ptychodera flava','Saccoglossus kowalevskii','Amphioxus','Branchiostoma belcheri','Oikopleura dioica','Ciona intestinalis','Botryllus schlosseri','Zebrafish','Human','Anolis carolinensis','Chicken','Frog','Trichinella spiralis','Nematode','Brugia malayi','Romanomermis culicivorax','Stegodyphus mimosarum','Ixodes scapularis','Limulus polyphemus','Daphnia pulex','Parhyale hawaiensis','Beetle','Fruitfly','Zootermopsis nevadensis','Strigamia maritima','Hypsibius dujardini','Ramazzottius varieornatus','Helobdella robusta','Capitella teleta','Lingula anatina','Crassostrea gigas','Pinctada fucata','Octopus bimaculoides','Lottia gigantea','Intoshia linei','Hymenolepis microstoma','Echinococcus multilocularis','Gyrodactylus salaris','Schmidtea mediterranea','Macrostomum lignano','Schistosoma japonicum','Adineta vaga'))
hbx$grouping <- factor(hbx$groups, levels = c('Porifera','Anthozoa','Cnidaria','Ctenophora','Placozoa','Echinodermata','Hemichordata','Cephalochordata','Urochordata','Vertebrata','Arthropoda','Tardigrada','Nematoda','Annelida','Brachiopoda','Mollusca','Orthonectida','Platyhelminthes','Rotifera'))
hbxplot <- ggplot(hbx, aes(x=species, y=family, fill=class, group=grouping))
hbxplot <- hbxplot + geom_point(aes(size=value, colour=class, group=grouping))
hbxplot <- hbxplot + theme_minimal()
hbxplot <- hbxplot + theme(axis.text.x = element_text(angle=90, size=10))
#hbxplot <- hbxplot + facet_grid(class~grouping, scales="free", space="free", switch="both")
hbxplot <- hbxplot + facet_grid(class~grouping, scales="free", space="free")
hbxplot <- hbxplot + theme(strip.text.y = element_text(size=10, angle=0))
hbxplot <- hbxplot + theme(strip.text.x = element_text(size=10, angle=90))
hbxplot <- hbxplot + theme(legend.position="none") + theme(axis.title.x=element_blank(), axis.title.y=element_blank())
hbxplot <- hbxplot + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.background = element_blank())
hbxplot <- hbxplot + theme(strip.background = element_rect(color="white", fill="thistle"))
hbxplot <- hbxplot + scale_size_continuous(range = c(-1, 6)) + theme(plot.margin = margin(20, 20, 20, 20))
hbxplot
ggsave("/home/cristig/Desktop/Homeodomains/hbxPlot1.pdf", width = 13, height = 24)