close_matching_samples: check for matching (or close to matching) genotypes in a data...

Description Usage Arguments Value Examples

View source: R/close_matching_samples.R

Description

Super simple function that looks at all pairs of fish from the data frame and returns a tibble that includes those which shared a fraction >= than min_frac_non_miss of the genotypes not missing in either fish, and which were matching at a fraction >= min_frac_matching of those non-missing pairs of genotypes.

Usage

1
2
3
4
5
6
close_matching_samples(
  D,
  gen_start_col,
  min_frac_non_miss = 0.7,
  min_frac_matching = 0.9
)

Arguments

D

a two-column format genetic dataset, with "repunit", "collection", and "indiv" columns, as well as a "sample_type" column that has entried either of "reference" or "mixture" or both.

gen_start_col

the first column of genetic data in reference

min_frac_non_miss

the fraction of loci that the pair must share non missing in order to be reported

min_frac_matching

the fraction of shared non-missing loci that must be shared between the indivdiuals to be reported as a matching pair.

Value

a tibble ...

Examples

1
2
# one pair found in the interal alewife data set:
close_matching_samples(alewife, 17)

rubias documentation built on Feb. 10, 2022, 1:06 a.m.