Mercurial > repos > xuebing > bed_size_stat
comparison bed_size_stat.py @ 5:e9bc2ab48dd5 default tip
Uploaded
author | xuebing |
---|---|
date | Sat, 31 Mar 2012 18:55:56 -0400 |
parents | cce2eabe8b8d |
children |
comparison
equal
deleted
inserted
replaced
4:a65882e1636c | 5:e9bc2ab48dd5 |
---|---|
12 rf.write("x <- read.table('"+inputfile+"')\n") | 12 rf.write("x <- read.table('"+inputfile+"')\n") |
13 rf.write("len <- x[,3]-x[,2]\n") | 13 rf.write("len <- x[,3]-x[,2]\n") |
14 rf.write("pdf('"+outputfile+"')\n") | 14 rf.write("pdf('"+outputfile+"')\n") |
15 if log == 'log': | 15 if log == 'log': |
16 rf.write("len <- log10(len+1)\n") | 16 rf.write("len <- log10(len+1)\n") |
17 rf.write("hist(len,breaks=100,xlab='interval size (log10)',main=paste('mean=',mean(len),sep=''))\n") | |
18 else: | |
17 rf.write("hist(len,breaks=100,xlab='interval size',main=paste('mean=',mean(len),sep=''))\n") | 19 rf.write("hist(len,breaks=100,xlab='interval size',main=paste('mean=',mean(len),sep=''))\n") |
18 else: | |
19 rf.write("hist(len,breaks=100,xlab='interval size (log10)',main=paste('mean=',mean(len),sep=''))\n") | |
20 rf.write("dev.off()") | 20 rf.write("dev.off()") |
21 rf.close() | 21 rf.close() |
22 os.system("R --vanilla < tmp.r") | 22 os.system("R --vanilla < tmp.r") |
23 os.system('rm tmp.r') | 23 os.system('rm tmp.r') |