Skip to content

Commit

Permalink
fix: small fixes in susie defaults (#552)
Browse files Browse the repository at this point in the history
  • Loading branch information
addramir committed Mar 21, 2024
1 parent 650bb2e commit dee3085
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/gentropy/method/susie_inf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def susie_inf( # noqa: C901
ssq_range: tuple[float, float] = (0, 1),
pi0: np.ndarray | None = None,
est_sigmasq: bool = True,
est_tausq: bool = True,
est_tausq: bool = False,
sigmasq: float = 1,
tausq: float = 0,
sigmasq_range: tuple[float, float] | None = None,
Expand Down Expand Up @@ -399,7 +399,7 @@ def g(x: float) -> float:
def cred_inf(
PIP: np.ndarray,
n: int = 100_000,
coverage: float = 0.9,
coverage: float = 0.99,
purity: float = 0.5,
LD: np.ndarray | None = None,
V: np.ndarray | None = None,
Expand Down
10 changes: 7 additions & 3 deletions tests/gentropy/method/test_susie_inf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_SUSIE_inf_lbf_moments(
ld = sample_data_for_susie_inf[0]
z = sample_data_for_susie_inf[1]
lbf_moments = sample_data_for_susie_inf[2]
susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, method="moments")
susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, est_tausq=True, method="moments")
lbf_calc = susie_output["lbf_variable"][:, 0]
assert np.allclose(
lbf_calc, lbf_moments
Expand All @@ -29,7 +29,7 @@ def test_SUSIE_inf_lbf_mle(
ld = sample_data_for_susie_inf[0]
z = sample_data_for_susie_inf[1]
lbf_mle = sample_data_for_susie_inf[3]
susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, method="MLE")
susie_output = SUSIE_inf.susie_inf(z=z, LD=ld, est_tausq=True, method="MLE")
lbf_calc = susie_output["lbf_variable"][:, 0]
assert np.allclose(
lbf_calc, lbf_mle, atol=1e-1
Expand All @@ -41,6 +41,10 @@ def test_SUSIE_inf_cred(
"""Test of SuSiE-inf credible set generator."""
ld = sample_data_for_susie_inf[0]
z = sample_data_for_susie_inf[1]
susie_output = SUSIE_inf.susie_inf(z=z, LD=ld)
susie_output = SUSIE_inf.susie_inf(
z=z,
LD=ld,
est_tausq=True,
)
cred = SUSIE_inf.cred_inf(susie_output["PIP"], LD=ld)
assert cred[0] == [5]

0 comments on commit dee3085

Please sign in to comment.