From 4b3b5c39ba1b1bc02d7da1ed068c0ba30350cc52 Mon Sep 17 00:00:00 2001 From: Zhang Yixing Date: Sun, 7 Sep 2025 15:15:40 +0800 Subject: [PATCH 1/2] Update call.py --- scripts/call.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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] From 823e948a5a233be2873278aa39612398ffdcfd59 Mon Sep 17 00:00:00 2001 From: Zhang Yixing Date: Sun, 7 Sep 2025 15:16:33 +0800 Subject: [PATCH 2/2] Update remap.py --- scripts/remap.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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))