re_recode_gametes: A function to turn a matrix of gamete haplotypes by position...

View source: R/re_recode_gametes.R

re_recode_gametesR Documentation

A function to turn a matrix of gamete haplotypes by position back to the 0/1 reads by position, using the phased donor haplotypes as a guide

Description

This function builds a matrix with position by row and gametes by column such that each cell is a 0 or a 1 or an NA based on whether that cell in the input gamete matrix was from haplotype1, haplotype2, or was an NA. Then the 0 or 1 is found in the complete_haplotypes (phased donors) input at the corresponding positions

Usage

re_recode_gametes(dt, complete_haplotypes)

Arguments

dt

input gamete haplotype data in tibble form

complete_haplotypes

dataframe of phased donors with two columns (h1 and h2) and SNP positions as rows

Value

to_return gamete data in dataframe form with read data (0's and 1's and NAs) instead of haplotype information


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