Skip to contents

Generate the theoretical relationship between the WSMAF (\(\bf{w}\)), the PLMAF (\(\bf{p}\)), and the COI (\(k\)).

Usage

theoretical_coi(
  coi_range,
  plmaf = seq(0, 0.5, length.out = 101),
  coi_method = c("variant", "frequency")
)

Arguments

coi_range

The COIs for which the relationship will be generated.

plmaf

The population-level minor allele frequency over which the relationship will be generated.

coi_method

The method we will use to generate the theoretical relationship. The method is either "variant" or "frequency". The default value is "variant".

Value

A tibble() containing the generated values. Each column is named with the COI used. The last column of the tibble contains the PLMAF.

Examples

theoretical_coi(1:5)
#> # A tibble: 101 × 6
#>    coi_1   coi_2  coi_3  coi_4  coi_5 plmaf
#>    <dbl>   <dbl>  <dbl>  <dbl>  <dbl> <dbl>
#>  1     0 0       0      0      0      0    
#>  2     0 0.00995 0.0149 0.0199 0.0248 0.005
#>  3     0 0.0198  0.0297 0.0394 0.0490 0.01 
#>  4     0 0.0295  0.0443 0.0587 0.0728 0.015
#>  5     0 0.0392  0.0588 0.0776 0.0961 0.02 
#>  6     0 0.0488  0.0731 0.0963 0.119  0.025
#>  7     0 0.0582  0.0873 0.115  0.141  0.03 
#>  8     0 0.0676  0.101  0.133  0.163  0.035
#>  9     0 0.0768  0.115  0.151  0.185  0.04 
#> 10     0 0.0859  0.129  0.168  0.206  0.045
#> # ℹ 91 more rows
theoretical_coi(1:5, coi_method = "frequency")
#> # A tibble: 101 × 6
#>    coi_1   coi_2   coi_3   coi_4   coi_5 plmaf
#>    <dbl>   <dbl>   <dbl>   <dbl>   <dbl> <dbl>
#>  1   NaN NaN     NaN     NaN     NaN     0    
#>  2   NaN   0.500   0.335   0.252   0.202 0.005
#>  3   NaN   0.500   0.337   0.254   0.204 0.01 
#>  4   NaN   0.500   0.338   0.256   0.206 0.015
#>  5   NaN   0.500   0.340   0.258   0.208 0.02 
#>  6   NaN   0.500   0.342   0.260   0.210 0.025
#>  7   NaN   0.50    0.343   0.262   0.212 0.03 
#>  8   NaN   0.5     0.345   0.264   0.214 0.035
#>  9   NaN   0.5     0.347   0.265   0.217 0.04 
#> 10   NaN   0.5     0.348   0.268   0.219 0.045
#> # ℹ 91 more rows