Skip to content

Create co-detection method for p-values - #375

Open
newmana wants to merge 7 commits into
masterfrom
newmana/issue_374
Open

newmana wants to merge 7 commits into
masterfrom
newmana/issue_374

Conversation

@newmana

@newmana newmana commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Instead of randomly picking LR genes - most of which are not found on sparse, single cell data, we test each spot against its co-detected pairs instead.

The null argument is added to st.tl.cci.run and perform_spot_testing:

  • "codetected" (new default): only the random pairs that score above 0 at that spot are selected and p = (n_greater + 1) / (n_codetected + 1)
  • "random" (previous default): all n_pairs are used and p = max(n_greater, 1) / n_pairs.

For sparse data random pairs aren't detected at a given spot and score 0 - therefore any score above 0 looks significant - and unrelated genes maybe called. Co-detection brings that back to chance. The two nulls give nearly the same p-values when random is combined with gridding.

A fix for #374

Pay special attention to the following tests:

  • test_random_counts_every_pair
  • test_codetected_counts_detected_pairs
  • test_pvals_from_background

@newmana newmana changed the title Create co-detection for p-values Create co-detection method for p-values Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant