comparison write_tsv_script.py @ 2:f1532cb33c75 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/spades commit 2609367ebbce7e0c3f5b4b2d7c60a82d4bd03246"
author iuc
date Tue, 25 Jan 2022 07:56:43 +0000
parents
children 86f66ab58e14
comparison
equal deleted inserted replaced
1:802296acd6d9 2:f1532cb33c75
1 #!/usr/bin/env python
2
3 import re
4 import sys
5
6 search_str = r"^>(NODE|\S+)_(\d+)(?:_|\s)length_(\d+)_cov_(\d+\.*\d*).*\$"
7
8 replace_str = r"\1_\2\t\3\t\4"
9
10 cmd = re.compile(search_str)
11
12 sys.stdout.write("#name\tlength\tcoverage\n")
13
14 for i, line in enumerate(sys.stdin):
15 if cmd.match(line):
16 sys.stdout.write(cmd.sub(replace_str, line))