Mercurial > repos > elixir-it > vinyl_score_composition
comparison tool_barp_score.R @ 0:f5f3f1c07cf1 draft default tip
Uploaded
| author | elixir-it |
|---|---|
| date | Thu, 17 Sep 2020 09:34:57 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:f5f3f1c07cf1 |
|---|---|
| 1 #!/usr/bin/env Rscript | |
| 2 args <- commandArgs(trailingOnly = TRUE) | |
| 3 file1=args[1] | |
| 4 scores=as.numeric(args[2]) | |
| 5 ofile=args[3] | |
| 6 bdata=read.table(file1,header=T) | |
| 7 bdata[,1:12]=bdata[,1:12]/rowSums(bdata[,1:12]) | |
| 8 rownames(bdata)=paste("#rank",c(1:nrow(bdata))) | |
| 9 col=c("#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928") | |
| 10 png(ofile,width=1800,height=800) | |
| 11 par(mar=c(10,4,4,25)) | |
| 12 X=barplot(t(bdata[1:scores,1:12]),horiz=F,col=col,legend.text=colnames(bdata)[1:12],args.legend = list(x = "right", bty="n", inset=c(-0.20,0), xpd = TRUE,cex=1.8),space=0.2,cex.axis=1.5,cex.names=2.5,las=2) | |
| 13 dev.off() | |
| 14 | |
| 15 | |
| 16 |
