Description Usage Arguments Value Author(s) Examples
A function to simulate phenotypes caused by self and neighbor effects, with the proportion of phenotypic variation explained (PVE) by fixed and random effects controlled.
1 2 3 4 5 6 7 8 9 10 11 12 |
geno |
An individual x marker matrix. Bialleles (i.e., A or a) must be converted into -1 or 1 digit. |
smap |
A matrix showing a spatial map for individuals. The first and second column include spatial points along an x-axis and y-axis, respectively. |
scale |
A numeric scalar indicating the maximum spatial distance between a focal individual and neighbors to define neighbor effects. |
alpha |
Distance decay coefficient α in a dispersal kernel. Default is set at Inf, meaning no distance decay. |
grouping |
A positive integer vector assigning each individual to a group. This argument can be useful when a "smap" contains different experimental replicates. Default setting means that all individuals are belong to a single group. |
kernel |
An option to select a negative exponential |
n_causal |
No. of causal markers in a simulated phenotype |
pveB |
Proportion of phenotypic variation explained by fixed effects. |
pve |
Proportion of phenotypic variation explained by fixed and random effects. |
b_ratio |
A vector composed of two numeric scalars that control the ratio of contributions of self or neighbor effects to a phenotype. The first and second element are for self and neighbor effects, respectively. |
A vector of simulated phenotype values for all individuals
Yasuhiro Sato (sato.yasuhiro.36c@kyoto-u.jp)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | set.seed(1)
g <- matrix(sample(c(-1,1),100*1000,replace = TRUE),100,1000)
gmap <- cbind(c(rep(1,nrow(g)/2),rep(2,nrow(g)/2)),c(1:ncol(g)))
x <- runif(nrow(g),1,100)
y <- runif(nrow(g),1,100)
smap <- cbind(x,y)
grouping <- c(rep(1,nrow(g)/2),rep(2,nrow(g)/2))
pheno <- nei_simu(geno=g,smap=smap,scale=44,grouping=grouping,n_causal=50,pveB=0.4,pve=0.8)
fake_nei <- list()
fake_nei[[1]] <- g
fake_nei[[2]] <- gmap
fake_nei[[3]] <- smap
fake_nei[[4]] <- data.frame(pheno,grouping)
names(fake_nei) <- c("geno","gmap","smap","pheno")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.