From 2ce616647ba42a5870fb38e971406a35b155495a Mon Sep 17 00:00:00 2001 From: Sarah Bastkowski Date: Fri, 13 Dec 2019 11:42:09 +0000 Subject: [PATCH] Added print statement in case no genes are sig in gene report. --- albatradis/BlockInsertions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/albatradis/BlockInsertions.py b/albatradis/BlockInsertions.py index b50a64a..b405b28 100644 --- a/albatradis/BlockInsertions.py +++ b/albatradis/BlockInsertions.py @@ -247,6 +247,7 @@ def gene_statistics(self, forward_plotfile, reverse_plotfile, combined_plotfile, all_genes.append(g) if len(all_genes) == 0 and len(intergenic_blocks) == 0: + print("No significant genes found for chosen parameters.\n") return [] self.write_gene_report(all_genes, intergenic_blocks) @@ -259,6 +260,7 @@ def gene_statistics(self, forward_plotfile, reverse_plotfile, combined_plotfile, def write_gene_report(self, genes, intergenic_blocks): block_filename = os.path.join(self.prefix, "gene_report.csv") + with open(block_filename, 'w') as bf: bf.write(str(genes[0].header()) + "\n") if not self.use_annotation: