Skip to content

Commit

Permalink
Failsafe to ensure no negative entries in output
Browse files Browse the repository at this point in the history
  • Loading branch information
sjfleming committed Apr 9, 2024
1 parent 2b11727 commit 411cc39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cellbender/remove_background/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def compute_output_denoised_counts_reports_metrics(posterior: Posterior,
posterior.latents_map['p'],
)

# Failsafe to ensure no negative counts.
assert np.all(denoised_counts.data >= 0), 'Negative count matrix entries in output'

# TODO: correct cell probabilities so that any zero-count droplet becomes "empty"

# Save denoised count matrix.
Expand Down

0 comments on commit 411cc39

Please sign in to comment.