Skip to content

feat: implement variant association analysis#1272

Open
31puneet wants to merge 5 commits intomalariagen:masterfrom
31puneet:variant-association-685
Open

feat: implement variant association analysis#1272
31puneet wants to merge 5 commits intomalariagen:masterfrom
31puneet:variant-association-685

Conversation

@31puneet
Copy link
Copy Markdown
Contributor

@31puneet 31puneet commented Apr 3, 2026

Closes #685

Adds variant_association() performs Fisher's Exact Test between a specific SNP and resistance phenotype. Uses phenotypes_with_snps() internally, filters missing data, and returns odds ratio + p-value.

How it works

  1. Fetches aligned phenotype + genotype data via phenotypes_with_snps() for a single coordinate (not the whole chromosome)
  2. Filters by insecticide/dose/phenotype if specified
  3. Removes samples with missing phenotypes (NaN) or missing genotype calls (-1)
  4. Builds a 2x2 contingency table (has_alt/has_ref × alive/dead)
  5. Runs scipy.stats.fisher_exact() and returns odds ratio + p-value
image

@31puneet
Copy link
Copy Markdown
Contributor Author

31puneet commented Apr 3, 2026

Hi @jonbrenas PTAL, meanwhile when you get time see #1051

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.

Resistance association testing for specific variants

1 participant