Add Satterthwaite and Kenward-Roger fixed-effect tests
This commit is contained in:
@@ -64,14 +64,29 @@ class SpectraRemlCliTests(unittest.TestCase):
|
||||
root.mkdir(parents=True, exist_ok=True)
|
||||
(root / "block_000000.summary.tsv").write_text(
|
||||
"\t".join(cli.SUMMARY_HEADER) + "\n"
|
||||
"0\ttrait_a\tconverged\t2\t0\t0\t0\t1\t1\t0.5\t-1\t4\t8\t1e-8\t\n"
|
||||
"1\ttrait_b\tconverged_boundary\t3\t1\t2\t3\t0\t1\t0\t-2\t3\t6\t1e-9\t\n",
|
||||
"0\ttrait_a\tconverged\t2\t0\t0\t0\t1\t1\t0.5\t-1\t4\t8\t1e-8"
|
||||
"\tsatterthwaite\tok\t0\t0\tnan\tnan\tnan\t\t\n"
|
||||
"1\ttrait_b\tconverged_boundary\t3\t1\t2\t3\t0\t1\t0\t-2\t3\t6\t1e-9"
|
||||
"\tsatterthwaite\tboundary_conditional\t2\t1\t8\t2\t0.2\t\t\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
np.asarray([1, 2, 3, 4, 5], dtype="<f8").tofile(root / "block_000000.beta.f64.bin")
|
||||
np.arange(1, 10, dtype="<f8").tofile(root / "block_000000.cov.f64.bin")
|
||||
np.asarray([0.1, 0.2, 0.3, 0.4, 0.5], dtype="<f8").tofile(
|
||||
root / "block_000000.fixed_se.f64.bin"
|
||||
)
|
||||
np.asarray([1, 2, 3, 4, 5], dtype="<f8").tofile(
|
||||
root / "block_000000.fixed_stat.f64.bin"
|
||||
)
|
||||
np.asarray([10, 10, 8, 8, 8], dtype="<f8").tofile(
|
||||
root / "block_000000.fixed_ddf.f64.bin"
|
||||
)
|
||||
np.asarray([0.5, 0.2, 0.1, 0.05, 0.01], dtype="<f8").tofile(
|
||||
root / "block_000000.fixed_p.f64.bin"
|
||||
)
|
||||
(root / "block_000000.complete").write_text(
|
||||
"format\t{}\nblock\t0\ntasks\t2\nbeta_elements\t5\ncov_elements\t9\n".format(cli.BLOCK_FORMAT),
|
||||
"format\t{}\nblock\t0\ntasks\t2\nbeta_elements\t5\ncov_elements\t9\n"
|
||||
"fixed_test_elements\t5\n".format(cli.BLOCK_FORMAT),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
@@ -127,6 +142,7 @@ class SpectraRemlCliTests(unittest.TestCase):
|
||||
self.assertEqual([row["task_id"] for row in rows], ["trait_a", "trait_b"])
|
||||
self.assertEqual(json.loads(rows[0]["beta_json"]), [1.0, 2.0])
|
||||
self.assertEqual(len(json.loads(rows[1]["covariance_packed_lower_json"])), 6)
|
||||
self.assertEqual(len(json.loads(rows[1]["fixed_effect_p_value_json"])), 3)
|
||||
|
||||
altered = dict(manifest)
|
||||
altered["created_utc"] = "changed"
|
||||
|
||||
Reference in New Issue
Block a user