Skip to content

Commit

Permalink
CODE: causal_sites
Browse files Browse the repository at this point in the history
Add option to simulate causal sites by indicating the causal site IDs.
  • Loading branch information
daikitag authored and mergify[bot] committed Feb 6, 2024
1 parent b2f780e commit b372bdc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/effect-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit b372bdc

Please sign in to comment.