Skip to content

Commit

Permalink
Updated error message if alignment data frame ends up empty
Browse files Browse the repository at this point in the history
  • Loading branch information
nsapoval authored Jun 27, 2024
1 parent 7ca1992 commit 66ba98a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lemur
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,11 @@ class LemurRunEnv():
'''Workhorse function that runs the EM-algorithm one step at a time and determines when the convergence
criteria has been met, stopping once it has.'''
n_reads = len(set(self.P_rgs_df.reset_index()["Read_ID"]))
self.low_abundance_threshold = 1. / n_reads
if n_reads == 0:
self.log(f"No alignments available for EM algorithm.\nVerify SAM file, {self.self.args.output}P_rgs_df_raw.tsv, and consider lowering --min-aln-len-ratio or --fidelity flags., logging.ERROR)
exit(1)
else:
self.low_abundance_threshold = 1. / n_reads

if self.args.width_filter:
__P_rgs_df = self.P_rgs_df.reset_index()
Expand Down

0 comments on commit 66ba98a

Please sign in to comment.