sim_lhs: This function computes the largest haplotype segment

View source: R/sim_lhs.R

sim_lhsR Documentation

This function computes the largest haplotype segment

Description

This function computes the largest haplotype segment in the vector case only First, we find a match 0/1/-1 encoding between the prediction and truth genotypes. 0 = match, 1 | -1 = mismatch Then we use the run length encoding to find the lengths and values of runs of equal values in the match 0/1/-1 encoding, specifically we're interested in stretches of 0's. So we look for values in the run length encoding that are 0 Then from those we extract the corresponding lengths and find the maximum length, or our largest hapltoype segment

Usage

sim_lhs(truth, predicted)

Arguments

truth

a vector of genotypes in 0/1 encoding, the truth

predicted

a vector of genotyptes in 0/1 encoding, predicted from rhapsodi

Value

to_return an integer, the largest haplotype segment


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