get_bvibd: Get Between-Host Identity by Descent from forward simulations

View source: R/forward_sWF.R

get_bvibdR Documentation

Get Between-Host Identity by Descent from forward simulations

Description

Given an object swf, which is the result of forward simulation using the function sim_swf(), walks backwards through the ancestry and calculate the between host identity by descent. The IBD calculation is based on Verity et. al 2020, Nat Comms, PMC7192906 and assumes relatedness if there are any IBD among the haplotypes between hosts at a given loci (i.e. a loci is considered to be in IBD if there is any between host IBD among the strains, regardless of COI. This means that as COI increases, IBD may be overestimated, which has been shown to be a conservative estimand).

Usage

get_bvibd(swf, host_index = NULL, haplo_index = NULL)

Arguments

swf

result of forwards simulation using the function sim_swf()

host_index

a vector of target hosts. Defaults to all hosts

haplo_index

a list of target haplotypes within the hosts specified by host_index. Defaults to all haplotypes within the specified hosts.


nickbrazeau/polySimIBD documentation built on Sept. 26, 2024, 5:29 p.m.