Split phased haplotypes deterministically into African and European ancestry-specific dosage matrices. Each haplotype's allele is added to whichever ancestry pool matches its local ancestry call; haplotypes with unrecognised ancestry codes contribute nothing to either pool.
split_haplotype(
gt_hap0,
gt_hap1,
anc_hap0,
anc_hap1,
pop_codes = c(AFR = 0L, EUR = 1L)
)Integer matrix (variants x samples) of haplotype-0 alleles (0/1).
Integer matrix (variants x samples) of haplotype-1 alleles (0/1).
Integer matrix (variants x samples) of haplotype-0 ancestry codes.
Integer matrix (variants x samples) of haplotype-1 ancestry codes.
Named integer vector of length 2 giving the AFR and EUR
ancestry codes as used in the MSP file. Defaults to
c(AFR = 0L, EUR = 1L) (RFMix convention).
List with two numeric matrices:
African ancestry-specific dosage (variants x samples)
European ancestry-specific dosage (variants x samples)