Skip to content

Commit

Permalink
explicitly check n_edges_to_split_doublet exists before using sum
Browse files Browse the repository at this point in the history
  • Loading branch information
ptajvar committed Oct 22, 2024
1 parent 63b4ef1 commit fb156c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pixelator/annotate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ def anndata_metrics(adata: AnnData) -> AnnotateAnndataStatistics:
metrics["fraction_potential_doublets"] = adata.obs[
"is_potential_doublet"
].mean()

if "n_edges_to_split_doublet" in adata.obs:
metrics["n_edges_to_split_potential_doublets"] = adata.obs[
"n_edges_to_split_doublet"
].sum()
Expand Down

0 comments on commit fb156c9

Please sign in to comment.