fast-bwa/scripts/sw1.py

24 lines
431 B
Python
Raw Permalink Normal View History

#!/bin/env python3
import sys
import os
fn = sys.argv[1]
n_bsw = 0
n_prun = 0
with open(fn, 'r') as f:
offset = 0
for line in f:
dat = line.strip().split('\t')
if dat[0] == "start":
offset = 1
elif offset == 1:
n_bsw += int(dat[0])
offset = 2
elif offset == 2:
n_prun += int(dat[0])
offset = 3
print(n_prun / n_bsw * 100, 100)