Mercurial > repos > xuebing > sharplab_interval_analysis
view intervalSize.py @ 24:8dd2a3f51c42 draft default tip
Deleted selected files
author | xuebing |
---|---|
date | Wed, 09 May 2012 10:53:44 -0400 |
parents | 16ba480adf96 |
children |
line wrap: on
line source
''' plot histogram of interval size ''' import os,sys inputfile = sys.argv[1] outputfile = sys.argv[2] 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") rf.write("dev.off()") rf.close() os.system("R --vanilla < tmp.r") os.system('rm tmp.r')