Mercurial > repos > iuc > spades_metaviralspades
view write_tsv_script.py @ 3:2a10645aeadd draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/spades commit b7b09cff3ddcdf26f27aabfcf41a8ce0a3985d87"
author | iuc |
---|---|
date | Wed, 09 Feb 2022 18:57:42 +0000 |
parents | f1532cb33c75 |
children | 86f66ab58e14 |
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))