find_ancestors_and_relatives_of_samples: Find ancestors and relative of each sampled member of a...

Description Usage Arguments Value Examples

View source: R/find_ancestors_and_relatives_of_samples.R

Description

This is a fairly general function that can be applied to pedigree output from any simulation program. It calls a function written in C++ to do all the recursive pedigree searching.

Usage

1

Arguments

P

a tibble that gives the pedigree. It must have the columns kid, pa, ma. These columns must be character vectors of the unique IDs for each individual in the pedigree. Every individual in the pedigree must appear exactly once in the kid column. When founders appear in the pedigree, their pa and ma entries must be "0" (i.e. character zero).

S

a vector of the IDs of the sampled individuals. Obviously, all members of S must appear in P.

n

number of generations back from the sampled individuals to return in each individual's ancestor vector. 0 = self, 1 = back to and including the parents, 2 = back to and including the grandparents, and so on.

Value

A tibble with three columns:

Examples

1
2
3
4
5
6
# get some input variables
P <- three_pops_with_mig_slurped_results$pedigree
S <- three_pops_with_mig_slurped_results$samples$ID
n <- 2
result <- find_ancestors_and_relatives_of_samples(P, S, n)
result

CKMRpop documentation built on July 17, 2021, 5:07 p.m.