Skip to content

Commit

Permalink
Add option to use two sample tests from hypothesis_classical for p va…
Browse files Browse the repository at this point in the history
…lue (#542)

Adds option to parent of origin effect class to use either
srivastava_yanagihara or srivastava two sample tests for fitting p value
  • Loading branch information
IlhaH authored Jun 29, 2024
1 parent 0c7174f commit 682cacb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/python/bystro/rare_variant/parent_of_origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
QuadraticInverseShrinkage,
)
from bystro.random_matrix_theory.rmt4ds_cov_test import two_sample_cov_test
from bystro.covariance.hypothesis_classical import (
srivastavayanagihara_two_sample_test,
srivastava_two_sample_test,
)


class BasePOE:
Expand Down Expand Up @@ -290,6 +294,16 @@ def fit(
elif self.pval_method == "rmt4ds":
result = two_sample_cov_test(X_heterozygotes, X_homozygotes)
self.p_val = result["p_value"]
elif self.pval_method == "srivastavayanagihara":
result = srivastavayanagihara_two_sample_test(
[X_heterozygotes, X_homozygotes]
)
self.p_val = result["p_value"]
elif self.pval_method == "srivastava":
result = srivastava_two_sample_test(
[X_heterozygotes, X_homozygotes]
)
self.p_val = result["p_value"]
else:
raise ValueError(
"Unrecognized p value option %s" % self.pval_method
Expand Down

0 comments on commit 682cacb

Please sign in to comment.