From fdd1a81b5e0b57ec46cdf64de5c7ad13524caa24 Mon Sep 17 00:00:00 2001 From: daikitag <48062118+daikitag@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:14:15 +0900 Subject: [PATCH] DOC: Minor changes Minor changes to documentation --- docs/effect-size.md | 7 ++----- docs/environment.md | 8 ++++---- docs/genetic.md | 3 +-- docs/multi-trait.md | 4 +++- docs/quick-start.md | 6 ++---- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/docs/effect-size.md b/docs/effect-size.md index 37b08d9..f638307 100644 --- a/docs/effect-size.md +++ b/docs/effect-size.md @@ -177,7 +177,6 @@ a normal distribution trait model with 1,000 causal sites. ```{code-cell} import matplotlib.pyplot as plt - model = tstrait.trait_model(distribution="normal", mean=0, var=1) trait_df = tstrait.sim_trait(ts, num_causal=1000, model=model, random_seed=1) trait_df.head() @@ -238,8 +237,8 @@ frequency dependent model. The frequency dependence architecture is still an ongoing research topic. While the frequency dependence model can be used for any trait models in tstrait, it is -suggested that you use the normal distribution with mean 0 as a trait model and -`alpha` to be -1/2 to conduct simulations that are widely used in +suggested that you use the trait model with mean 0 and `alpha` to be -1/2 to conduct +simulations that are widely used in simulation-based research projects (See [Speed et al. (2017)](https://doi.org/10.1038/ng.3865) for details). @@ -266,8 +265,6 @@ it in your trait simulation. ```{code-cell} -import matplotlib.pyplot as plt - # trait.sim_trait(ts, num_causal=1000, model=model, random_seed=1) # also works here trait_df = tstrait.sim_trait(ts, num_causal=1000, model=model, diff --git a/docs/environment.md b/docs/environment.md index e935226..ea0bbf6 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -122,10 +122,10 @@ there are several options available for the user. ### Simulating from the output of {py:func}`genetic_value` -The output of {py:func}`genetic_value` only includes genetic values, and it doesn't -simulate environmental noise. For example, if the user wants to simulate -environmental noise from a normal distribution with mean 0 and variance 1, it -would be possible to run the following code: +The output of {py:func}`genetic_value` only includes relevant information regarding +genetic values, and it doesn't simulate environmental noise. For example, if the +user wants to simulate environmental noise from a normal distribution with mean 0 +and variance 1, it would be possible to run the following code: ```{code-cell} diff --git a/docs/genetic.md b/docs/genetic.md index 2175e43..a78043f 100644 --- a/docs/genetic.md +++ b/docs/genetic.md @@ -35,8 +35,7 @@ After this genetic value page, you will be able to: Genetic value is computed in tstrait by using the trait information in the input trait dataframe. It uses a tree traversal algorithm to count the number of causal allele in each individual and adds -the corresponding effect size to individual's genetic value depending on the presence of causal -mutation in that individual. +the corresponding effect size to individual's genetic value. ## Input diff --git a/docs/multi-trait.md b/docs/multi-trait.md index f359ad0..711e871 100644 --- a/docs/multi-trait.md +++ b/docs/multi-trait.md @@ -57,7 +57,6 @@ import numpy as np model = tstrait.trait_model( distribution="multi_normal", mean=np.zeros(2), cov=np.eye(2) ) -model.name model.num_trait ``` @@ -87,6 +86,9 @@ sim_result = tstrait.sim_phenotype( ) sim_result.phenotype +``` + +```{code-cell} sim_result.trait ``` diff --git a/docs/quick-start.md b/docs/quick-start.md index e36465e..2af9e68 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -94,7 +94,6 @@ Simulated traits from {func}`sim_phenotype` can be extracted through `.trait`. ```{code-cell} trait_df = sim_result.trait -trait_df.columns trait_df.head() ``` @@ -116,9 +115,8 @@ Simulated phenotypes from {func}`sim_phenotype` can be extracted through `.pheno ```{code-cell} - phenotype_df = sim_result.phenotype - phenotype_df.columns - phenotype_df.head() +phenotype_df = sim_result.phenotype +phenotype_df.head() ``` The `phenotype_df` is a {class}`pandas.DataFrame` object that includes the following 5 columns: