/usr/share/doc/seqprep/examples/seqlens.py is in seqprep-data 1.3.2-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/usr/bin/env python
from collections import defaultdict
from operator import itemgetter
seqlens = defaultdict(int)
from sys import stdin
next_line_seq = False
count = 0
for line in stdin:
count += 1
if line.startswith("@"):
count = 0
next_line_seq = True
if next_line_seq and count == 1:
next_line_seq == False
seqlens[len(line)] += 1
for (length,count) in sorted(seqlens.iteritems(), key=itemgetter(0),reverse=True):
print("%d\t%d"%(length,count))
|