Mercurial > repos > xuebing > sharplab_interval_analysis
comparison intervalSize.py @ 20:16ba480adf96
Uploaded
| author | xuebing |
|---|---|
| date | Sat, 31 Mar 2012 08:31:22 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 19:d325683ec368 | 20:16ba480adf96 |
|---|---|
| 1 ''' | |
| 2 plot histogram of interval size | |
| 3 ''' | |
| 4 | |
| 5 import os,sys | |
| 6 | |
| 7 inputfile = sys.argv[1] | |
| 8 outputfile = sys.argv[2] | |
| 9 | |
| 10 rf = open('tmp.r','w') | |
| 11 rf.write("x <- read.table('"+inputfile+"')\n") | |
| 12 rf.write("len <- x[,3]-x[,2]\n") | |
| 13 rf.write("pdf('"+outputfile+"')\n") | |
| 14 rf.write("hist(len,breaks=100,xlab='interval size',main=paste('mean=',mean(len),sep=''))\n") | |
| 15 rf.write("dev.off()") | |
| 16 rf.close() | |
| 17 os.system("R --vanilla < tmp.r") | |
| 18 os.system('rm tmp.r') |
