benef_sim: Generate the position of benefitial allele and selection...

View source: R/benef_sim.R

benef_simR Documentation

Generate the position of benefitial allele and selection strength.

Description

Generate the position of benefitial allele and selection strength.

Usage

benef_sim(
  haplotype,
  n_benef = 1,
  min = 0.05,
  max = 0.05,
  fix_sel = 0,
  repli = 1,
  diff_sel_str = FALSE
)

Arguments

haplotype

Binary numeric matrix containing information of haplotype structure. The columns corresponds to the haplotypes and the rows to the SNPs.

n_benef

Non-negative integer, containing information of number of benefitial alleles. 0 corresponds to the scenario of no benifitial alleles.

min

Numeric, minimum selection strength of the benefitial allele, must be between 0 and max.

max

Numeric, maximum selection strength of the benefitial allele, must be between min and 1.

fix_sel

Numeric or numeric vector, whether to fix the number of selected haplotypes to some number. 0 means no fixing, any integer greater than 0 fixes the number of selected haplotypes to the number, any integer lower than 0 means no such number of selected haplotypes (i.e. -1 means no cases of 1 selected haplotypes). Can take numeric vector input, for example c(1,2) will fix the number of selected haplotypes to 1 and 2, c(-1,-2) will disallow number of selected haplotypes as 1 and 2.

repli

Numeric, number of replicated populations.

diff_sel_str

Logical statement, given there are replicates, whether to allow difference in selection strength between replicates.

Value

A list, with the first item being a numeric vector of selective strength for all SNPs, the second item being the position of benefitial alleles, the third item being the number of selected haplotypes.

See Also

haplotest()


xthchen/haplotest documentation built on Nov. 29, 2022, 12:07 p.m.