create_similarityMatrix: Creates a genetic similarity matrix

View source: R/script - gene-match-o-matic 2000.R

create_similarityMatrixR Documentation

Creates a genetic similarity matrix

Description

Compares two dataframes with SNP data (rows=individuals, columns=snp genotypes) and finds the genetics similarity between all individuals in set a and b (total checkups is nrow(samples) x nrow(lookup)). Returns a dataframe that contains all possible combinations between individuals of the sample set and the lookup set together with the similarity between them. Output is then: ID_sample (A given individual from the sample set), ID_match (which individual from lookup it was check against) and similarity (a number from 1 to 0 where 1 is a perfect match)

Usage

create_similarityMatrix(df_samples, df_lookup, naCutoff = 50)

Arguments

df_samples

A dataframe with individuals (rows) and snp genotypces (columns). Must contain a column "ID" that gives each individual a unique ID

df_lookup

The dataframe the df_sample is looked up against. Must be formated like df_samples


Eiriksen/Genotools documentation built on Oct. 1, 2022, 1:40 a.m.