Mercurial > repos > iuc > spades_coronaspades
view write_tsv_script.py @ 7:ff41a00a6745 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/spades commit 35f71aa486d8754ee6a8387659032fc7c93d1be3
author | iuc |
---|---|
date | Wed, 10 Aug 2022 13:17:22 +0000 |
parents | fee85957cebe |
children |
line wrap: on
line source
#!/usr/bin/env python import re import sys search_str = r"^>(NODE|\S+)_(\d+)(?:_|\s)length_(\d+)_cov_(\d+\.*\d*)(.*\$)?" replace_str = r"\1_\2\t\3\t\4" cmd = re.compile(search_str) sys.stdout.write("#name\tlength\tcoverage\n") for i, line in enumerate(sys.stdin): if cmd.match(line): sys.stdout.write(cmd.sub(replace_str, line))