Skip to content

Commit

Permalink
Added print statement in case no genes are sig in gene report.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbastkowski committed Dec 13, 2019
1 parent 9d23aa0 commit 2ce6166
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions albatradis/BlockInsertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 2ce6166

Please sign in to comment.