From 6720aca031f6ac5e71b4a554c96b61976cadbc9c Mon Sep 17 00:00:00 2001 From: daikitag <48062118+daikitag@users.noreply.github.com> Date: Mon, 4 Dec 2023 21:39:37 +0900 Subject: [PATCH] CODE: causal_sites Add option to simulate causal sites by indicating the causal site IDs. --- docs/effect-size.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/effect-size.md b/docs/effect-size.md index f638307..909f4f4 100644 --- a/docs/effect-size.md +++ b/docs/effect-size.md @@ -296,3 +296,22 @@ plt.show() We see that rarer variants have increased effect sizes, as expected from the mathematical expression given in [](eq:freq-dep). + +(trait_causal_sites)= + +## Specifying Causal Sites + +Instead of specifying the number of causal sites, users can directly provide the +causal sites as an input of {py:func}`sim_phenotype` and {py:func}`sim_trait`. +When `causal_sites` argument of these functions are provided, tstrait will use +the inputted site IDs as causal sites, instead of randomly selecting causal +site IDs. + +Example: + +```{code-cell} + +trait_df = tstrait.sim_trait(ts, causal_sites=[0, 3, 4], model=model, + alpha=-1/2, random_seed=1) +trait_df +``` \ No newline at end of file