pairsimu {KINSIMU}R Documentation

Pairwise simulation

Description

Generating genotype combinations of multiple individual pairs with specific relationships on an autosomal marker, ignoring mutaion

Usage

pairsimu(af, ss, delta, allelename = FALSE)

Arguments

af

name of allele frequency matrix, a data.frame of 1 column containing frequencies with allele names being row names, which can be loaded with "EvaluatePanel" function, not necessary if Parent is not NULL

ss

sample size, i.e., how many individual pairs do you want simulate

delta

distribution of IBD or Jacquard coefficient of specific relationship, i.e., kappa(0-2) or Delta(1-9), respectively. Which should be input in form of single row of data with c() function. It should be noted that the data should be in order of kappa0 to kappa2 or Delta1 to Delta9.

allelename

if TRUE, outputing the names of alleles, otherwise, the positions of them in the af matrix

Value

A data.frame with four columns and ss rows, consisting of the alleles of the first individual in the first two columns and the alleles of the second individual in the remaining two columns.

Examples

# Take the first STR in the 42 STR as example
af = FortytwoSTR$afmatrix[[1]]
# simulating 10,000 unrelated pairs
a<-pairsimu(af = af,ss = 10000,delta = c(1,0,0),allelename = FALSE)
# simulating 10,000 parent-child pairs
b<-pairsimu(af = af,ss = 10000,delta = c(0,1,0),allelename = FALSE)
# simulating 10,000 full-sibling pairs
c<-pairsimu(af = af,ss = 10000,delta = c(0.25,0.5,0.25),allelename = FALSE)


[Package KINSIMU version 0.1.2-2 Index]