23 lines
491 B
Python
23 lines
491 B
Python
|
|
#!/bin/env python3
|
||
|
|
import sys
|
||
|
|
import os
|
||
|
|
|
||
|
|
|
||
|
|
fn = sys.argv[1]
|
||
|
|
n_all = 0
|
||
|
|
n_direct = 0
|
||
|
|
n_direct_start_len = 0
|
||
|
|
n_seed_len = 0
|
||
|
|
|
||
|
|
with open(fn, 'r') as f:
|
||
|
|
for line in f:
|
||
|
|
dat = line.strip().split('\t')
|
||
|
|
if dat[0] == "start":
|
||
|
|
n_all += 1
|
||
|
|
if (len(dat) == 2):
|
||
|
|
n_direct += 1
|
||
|
|
n_direct_start_len += int(dat[0])
|
||
|
|
n_seed_len += int(dat[1])
|
||
|
|
|
||
|
|
print(n_all, n_direct, n_direct / n_all, n_direct_start_len / n_direct, n_seed_len / n_direct)
|