fill_na: A function to fill in missing data from each gamete

View source: R/fill_na.R

fill_naR Documentation

A function to fill in missing data from each gamete

Description

This function fills in missing data (NAs) on each gamete. For each gamete, it fills the NA values with the nearest haplotype. If the two adjacent haplotypes are not the same (i.e., at a recombination breakpoint), it leaves the values as NA.

Usage

fill_na(imputed_gametes, col_index, fill_ends = TRUE)

Arguments

imputed_gametes

Output of run_hmm which assigned a donor haplotype to each segment of each gamete

col_index

Each column of imputed_gametes, pulled via apply function

fill_ends

a boolean; if TRUE, fills the NAs at the terminal edges of chromosomes with the last known or imputed SNP (for end of chromosome) and the first known or imputed SNP (for beginning of chromosome); if FALSE, leaves these genotypes as NA; default = TRUE

Value

gamete_sample_imputed Column with each gamete's imputed haplotypes


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