pullIbdHaplo {AlphaSimR}R Documentation

Pull Identity By Descent (IBD) haplotypes

Description

Retrieves Identity By Descent (IBD) haplotype data

Usage

pullIbdHaplo(pop = NULL, chr = NULL, snpChip = NULL,
  pedigree = NULL, simParam = NULL)

Arguments

pop

an object of Pop-class or RawPop-class. If NULL, haplotypes for the whole ancestral pedigree are retreived. Otherwise, haplotypes just for the pop individuals are retreived. In both cases the base population is controlled by pedigree.

chr

a vector of chromosomes to retrieve. If NULL, all chromosomes are retrieved.

snpChip

an integer. Indicates which SNP array loci are retrieved. If NULL, all sites are retrieved.

pedigree

a matrix with ancestral pedigree to set a base population. It should be of the same form as simParam$pedigree (see SimParam_setTrackPed), i.e., two columns (mother and father) and the same number of rows as simParam$pedigree. Base population can be set by setting parents as 0. If NULL, pedigree from SimParam is taken.

simParam

an object of SimParam

Value

Returns a matrix of haplotypes with Identity By Descent (IBD) coding of locus alleles. The matrix colnames reflect whether all segregagting loci (sites) are retreived or only SNP array loci.

Examples

#Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=10)

#Set simulation parameters
SP = SimParam$new(founderPop)
SP$addTraitA(10)
SP$addSnpChip(5)
SP$setTrackRec(TRUE)

#Create population
pop = newPop(founderPop, simParam=SP)
pullIbdHaplo(pop, simParam=SP)


[Package AlphaSimR version 0.10.0 Index]