Mercurial > repos > nml > metaspades
view write_tsv_script.py @ 15:99ecfdafc64f draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/spades commit f53f7f297e551bf58e753752edd0dae5205bbc77
author | iuc |
---|---|
date | Mon, 15 Apr 2024 19:39:03 +0000 |
parents | 606b09cc9860 |
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))