Previous changeset 2:b0e04c112633 (2012-03-31) Next changeset 4:a65882e1636c (2012-03-31) |
Commit message:
Uploaded |
modified:
bed_size_stat.py |
b |
diff -r b0e04c112633 -r cce2eabe8b8d bed_size_stat.py --- a/bed_size_stat.py Sat Mar 31 18:50:12 2012 -0400 +++ b/bed_size_stat.py Sat Mar 31 18:50:24 2012 -0400 |
[ |
@@ -6,12 +6,17 @@ inputfile = sys.argv[1] outputfile = sys.argv[2] +log = sys.argv[3] rf = open('tmp.r','w') rf.write("x <- read.table('"+inputfile+"')\n") rf.write("len <- x[,3]-x[,2]\n") rf.write("pdf('"+outputfile+"')\n") -rf.write("hist(len,breaks=100,xlab='interval size',main=paste('mean=',mean(len),sep=''))\n") +if log == 'log': + rf.write("len <- log10(len+1)\n") + rf.write("hist(len,breaks=100,xlab='interval size',main=paste('mean=',mean(len),sep=''))\n") +else: + rf.write("hist(len,breaks=100,xlab='interval size (log10)',main=paste('mean=',mean(len),sep=''))\n") rf.write("dev.off()") rf.close() os.system("R --vanilla < tmp.r") |