Identifies which of a subjects two haplotyes is the maternal haplotype and which is the paternal haplotype.
get_phased_ancestry(sample, haps_matrix)
sample | A dataframe in .sample format. |
---|---|
haps_matrix | A n x p matrix of 0-1. Each row represents one haplotypes.
To convert from indices to haplotype indices, an entry i in |
A data frame with the following elements:
subject: the row ID of the subject. An entry of i corresponds to
rows 2*i -1 and 2*i of haps_matrix
.
chromosome: the chromosome number 1-22.
ancestor_1: the ID of the ancestor corresponding to the first haplotype
of the offspring in haps_matrix
.
ancestor_2: the ID of the ancestor corresponding to the second haplotype
of the offspring in haps_matrix
.