sim_lhs | R Documentation |
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
sim_lhs(truth, predicted)
truth |
a vector of genotypes in 0/1 encoding, the truth |
predicted |
a vector of genotyptes in 0/1 encoding, predicted from rhapsodi |
to_return an integer, the largest haplotype segment
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.