Mercurial > repos > padge > astral
annotate test-data/freqQuadVisualization.R @ 0:66ebc4b19d6c draft default tip
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
author | padge |
---|---|
date | Wed, 13 Apr 2022 15:03:31 +0000 |
parents | |
children |
rev | line source |
---|---|
0
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
1 #!/usr/bin/env Rscript |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
2 red='#d53e4f';orange='#1d91c0';blue='#41b6c4';colormap = c(red,orange,blue) |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
3 require(reshape2);require(ggplot2); |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
4 dirPath = '.'; filePath = paste(dirPath,'/freqQuadCorrected.csv',sep=''); md<-read.csv(filePath,header=F,sep='\t'); md$value = md$V5/md$V6; |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
5 a<-length(levels(as.factor(md$V7)))*3.7; b<-4; sizes <- c(a,b); |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
6 md$V8<-reorder(md$V8,-md$value) |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
7 ggplot(data=md)+aes(x=V8,y=value,fill=V9)+geom_bar(stat='identity',color=1,width=0.8,position='dodge')+theme_bw()+theme(axis.text.x=element_text(angle=90))+scale_fill_manual(values=colormap,name='Topology')+geom_hline(yintercept=1/3,size=0.4,linetype=2)+ylab('relative freq.')+facet_wrap(~V7,scales='free_x')+xlab('') |
66ebc4b19d6c
"planemo upload for repository https://github.com/smirarab/ASTRAL commit 0f93f327c49e93d6af057973d68ba772ba5715dc-dirty"
padge
parents:
diff
changeset
|
8 pdfFile = paste(dirPath,'/relativeFreq.pdf',sep=''); ggsave(pdfFile,width = sizes[1], height= sizes[2]); |