From 9345a3ce358179ee263bb763ce1829591c4cb54e Mon Sep 17 00:00:00 2001 From: Foivos Gypas Date: Thu, 17 Jun 2021 21:03:46 +0200 Subject: [PATCH] Option to run on all transcripts (#10) * Option to run the script on all transcripts --- scripts/gtf2bed12 | 2 +- setup.py | 2 +- zgtf/zgtf.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/gtf2bed12 b/scripts/gtf2bed12 index 5f8fc4e..d3d16d8 100755 --- a/scripts/gtf2bed12 +++ b/scripts/gtf2bed12 @@ -34,7 +34,7 @@ def main(): parser.add_argument( "--transcript_type", dest="transcript_type", - help="Transcript type [Default: protein_coding]", + help="Transcript type [Default: protein_coding]. Please specify `all` for all transcripts.", required=False, default="protein_coding" ) diff --git a/setup.py b/setup.py index bca4a9c..53345ad 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='zgtf', - version='0.1.1', + version='0.1.2', description="gtf conversion utility.", author="Foivos Gypas", author_email='foivos.gypas@unibas.ch', diff --git a/zgtf/zgtf.py b/zgtf/zgtf.py index b4702bf..9a6f7bc 100644 --- a/zgtf/zgtf.py +++ b/zgtf/zgtf.py @@ -24,8 +24,9 @@ def gtf_to_transcript_exons(gtf, transcript_type): sys.stderr.write(f"Problem with: {gtf_line}. Exiting.{os.linesep}") sys.exit(1) - if tr_type != transcript_type: - continue + if transcript_type != "all": + if tr_type != transcript_type: + continue if tr_id not in transcripts: transcripts[tr_id] = [gtf_line]