Mercurial > repos > galaxyp > metagene_annotator
diff convert_mga.py @ 1:17c7ab82bfbc draft default tip
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/metagene_annotator commit f66aa9a65aaf45ac4888ca26f5af661f73b46fdc
author | galaxyp |
---|---|
date | Mon, 18 Mar 2024 12:34:58 +0000 |
parents | b04960a7abf5 |
children |
line wrap: on
line diff
--- a/convert_mga.py Wed Mar 21 17:15:25 2018 -0400 +++ b/convert_mga.py Mon Mar 18 12:34:58 2024 +0000 @@ -35,7 +35,7 @@ 'complete/partial', 'gene score', 'used model', 'rbs start', 'rbs end', 'rbs score'])) - gc_rbs_pat = '# gc = (-?[0-9]*[.]?[0-9]+), rbs = (-?[0-9]*[.]?[0-9]+)' + gc_rbs_pat = '# gc = (-?[0-9]*[.]?[0-9]+), rbs = (-?[0-9]*[.]?[0-9]+)' seq_count = 0 gene_count = 0 for i, line in enumerate(input_rdr): @@ -46,12 +46,12 @@ try: m = re.match(gc_rbs_pat, line.strip()) seq_gc, seq_rbs = m.groups() - except: + except ValueError: seq_gc = seq_rbs = '' elif line.startswith('# self:'): seq_type = re.sub('# self:', '', line.rstrip()) elif line.startswith('# '): - seq_name = re.sub('# (\S+).*$', '\\1', line.rstrip()) + seq_name = re.sub(r'# (\S+).*$', '\\1', line.rstrip()) seq_count += 1 else: fields = line.split('\t')