diff --git a/scripts/call.py b/scripts/call.py index 18cca8c..4fa64a7 100644 --- a/scripts/call.py +++ b/scripts/call.py @@ -203,14 +203,8 @@ def main(args): "pseudogene", # FIXME: do we want all these? ]: # FIXME: we may need to add more chars to the regex - gidx = ( - re.search('gene_id "[A-Za-z0-9_]+";', line[-1]).group(0).split('"')[-2] - ) - tidx = ( - re.search('transcript_id "[A-Za-z0-9_]+";', line[-1]) - .group(0) - .split('"')[-2] - ) + gidx = re.search('gene_id "([^"]+)"', line[-1]).group(1) + tidx = re.search('transcript_id "([^"]+)"', line[-1]).group(1) transcript2gene[tidx] = gidx genestrand[gidx] = line[6] genechr[gidx] = line[0] diff --git a/scripts/remap.py b/scripts/remap.py index 28aea0d..9c37ca0 100644 --- a/scripts/remap.py +++ b/scripts/remap.py @@ -53,11 +53,7 @@ def main(args): if line[2] != "exon": continue - tidx = ( - re.search('transcript_id "[A-Za-z0-9_]+";', line[-1]) - .group(0) - .split('"')[-2] - ) + tidx = re.search('transcript_id "([^"]+)"', line[-1]).group(1) if tidx in transcripts: s, e = int(line[3]), int(line[4]) transcripts[tidx].append((s, e))