File: remove_lowly_covered_bubbles.py

package info (click to toggle)
kissplice 2.6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,752 kB
  • sloc: cpp: 8,783; python: 1,618; perl: 389; sh: 72; makefile: 18
file content (25 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python
import sys

if len(sys.argv)!=4:
	print("[ERROR] usage:", sys.argv[0], "<file> <count_threshold> <min_nb_files>")
	sys.exit(1)

#read the args
filename = sys.argv[1]
countThreshold = int(sys.argv[2])
minNbFiles = int(sys.argv[3])

#compile the regex
import re
conditionPattern = re.compile("\C\d+\_(\d+)")

with open(filename) as file:
	while True:
		header1, seq1, header2, seq2 = [file.readline().rstrip() for _ in range(4)]

		if header1=="":
			break

		counts = [int(_) for _ in re.findall(conditionPattern, header1)]
		print(counts)