Skip to contents

Analyze kinship within samples

Usage

find_kinship(samples, order = 4L, experimental = FALSE)

Arguments

samples

sample_family

order

integer

experimental

boolean

Value

A data.frame with the following columns:

  • from, to: sample IDs in integer.

  • path: text representation of the path found between samples; ascending with 1 and descending with 0; the count of the same paths is indicated by _n suffix; e.g., "10_1" and "10_2" means half-sibling and full-sibling pairs, respectively.

  • degree: the number of steps in the path.

  • label: aliases for the path. See https://github.com/heavywatal/tekkamaki/blob/main/data-raw/kinlabels.R for the available labels.

Details

find_kinship() finds kinship below given order.

See also

as_hsp() and as_hsp2() to find half-sibling pairs.

as_pop() and as_pop2() to find parent-offspring pairs.

Examples

set.seed(666)
result = tekka("-y25 -l2 --sa 2,2 --sj 2,2")
samples = result$sample_family[[1L]]
find_kinship(samples, order = 3L)
#> # A tibble: 17 × 5
#>     from    to path  degree label
#>    <int> <int> <chr>  <int> <fct>
#>  1     2    13 10_1       2 HS   
#>  2     2    14 10_1       2 HS   
#>  3     2    15 1_1        1 PO   
#>  4     3     5 100_1      3 HUN  
#>  5     4     7 10_1       2 HS   
#>  6     9    10 10_1       2 HS   
#>  7     9    11 1_1        1 PO   
#>  8     9    14 100_1      3 HUN  
#>  9    11    14 00_1       2 GG   
#> 10    12     5 00_1       2 GG   
#> 11    12     6 00_1       2 GG   
#> 12    12     9 100_1      3 HUN  
#> 13    12    11 10_1       2 HS   
#> 14    13    14 10_1       2 HS   
#> 15    13    16 110_1      3 HUN  
#> 16    15    13 0_1        1 PO   
#> 17    15    14 0_1        1 PO