make_dist_mat_known: Make distance matrix for samples to known genotypes

View source: R/summarize_dataset.R

make_dist_mat_knownR Documentation

Make distance matrix for samples to known genotypes

Description

Compare the genotype of each sample in a given results summary to all known genotypes in the supplied table, and create a sample-to-known-genotype distance matrix.

Usage

make_dist_mat_known(
  results_summary,
  genotypes_known,
  dist_func = calc_genotype_distance
)

Arguments

results_summary

cross-sample summary data frame as produced by analyze_dataset.

genotypes_known

data frame of known genotypes, with one row per individual per locus, and columns "Name", "Locus", "Allele1Seq", "Allele2Seq". See load_genotypes.

dist_func

function to calculate inter-sample distances. Should take two vectors, one for each genotype, with two values per locus corresponding to the two alleles.

Value

matrix of sample-to-individual distance values, with individuals from genotypes_known on rows and samples on columns.


ressy/microsat documentation built on Aug. 24, 2023, 10:09 a.m.