From 71b652f5ff534d0ce495eee142b8124e68156c5d Mon Sep 17 00:00:00 2001 From: Andrey Prjibelski Date: Fri, 1 Sep 2023 15:27:07 +0300 Subject: [PATCH] do not print . transcripts --- isoquant.py | 3 +++ src/graph_based_model_construction.py | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/isoquant.py b/isoquant.py index 364716c6..c50c51c6 100755 --- a/isoquant.py +++ b/isoquant.py @@ -140,6 +140,9 @@ def add_hidden_option(*args, **kwargs): # show command only with --full-help parser.add_argument('--check_canonical', action='store_true', default=False, help="report whether splice junctions are canonical") + add_additional_option("--keep_noncanonical", help="report transcripts for which the strand cannot be detected " + "using canonical splice sites", + action='store_true', default=False) parser.add_argument("--sqanti_output", help="produce SQANTI-like TSV output", action='store_true', default=False) parser.add_argument("--count_exons", help="perform exon and intron counting", action='store_true', default=False) diff --git a/src/graph_based_model_construction.py b/src/graph_based_model_construction.py index 7e94114c..b0251a04 100644 --- a/src/graph_based_model_construction.py +++ b/src/graph_based_model_construction.py @@ -374,9 +374,14 @@ def construct_fl_isoforms(self): #logger.debug("uuu Novel isoform %s has coverage: %d cutoff = %d, component cov = %d, max_coverage = %d" # % (new_transcript_id, count, novel_isoform_cutoff, component_coverage, self.intron_graph.max_coverage)) if count < novel_isoform_cutoff: - pass #logger.debug("uuu Novel isoform %s has low coverage: %d\t%d" % (new_transcript_id, count, novel_isoform_cutoff)) + # logger.debug("uuu Novel isoform %s has low coverage: %d\t%d" % (new_transcript_id, count, novel_isoform_cutoff)) + pass elif len(novel_exons) == 2 and (not polya_site or transcript_ss_strand == '.'): - pass #logger.debug("uuu Avoiding single intron %s isoform: %d\t%s" % (new_transcript_id, count, str(path))) + # logger.debug("uuu Avoiding single intron %s isoform: %d\t%s" % (new_transcript_id, count, str(path))) + pass + elif transcript_strand == '.' and not self.params.keep_noncanonical: + logger.info("Avoiding unreliable transcript with %d exons" % len(novel_exons)) + pass else: if self.params.use_technical_replicas and \ len(set([a.read_group for a in self.path_storage.paths_to_reads[path]])) <= 1: