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

View source: R/close_matching_samples.R

close_matching_samplesR Documentation

check for matching (or close to matching) genotypes in a data frame

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

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

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

benmoran11/rubias documentation built on Feb. 1, 2024, 10:52 p.m.