reconstruct_hap: A function to reconstruct the donor haplotypes using data...

View source: R/reconstruct_hap.R

reconstruct_hapR Documentation

A function to reconstruct the donor haplotypes using data from gametes

Description

This function takes gamete data and computes and clusters a distance matrix with a binary method. It anticipates sparse data and replaces NAs with 0.5. It clusters the tree into two groups, i.e., haplotypes. It then categorizes the gamete cells falling into each of the two groups. It reconstructs the original haplotypes by majority vote after inverting the opposite haplotype.

Usage

reconstruct_hap(input_dt, input_positions, window_indices)

Arguments

input_dt

A dataframe of sparse gamete data coded with reference and alt alleles (i.e., 0, 1, or NA)

input_positions

vector of SNP positions

window_indices

A window of the gamete data (using segments generated from split_with_overlap)

Value

inferred_output A tibble with the inferred haplotype sorted by position and window


mccoy-lab/rhapsodi documentation built on July 27, 2022, 3:56 a.m.