haplomat#
- pybrops.core.util.haplo.haplomat(nhaploblk, genomemat, genpos, chrgrp_stix, chrgrp_spix, chrgrp_len, u_a)[source]#
Calculate a haplotype matrix from a genome matrix and model.
- Parameters:
nhaploblk (Integral) – Number of haplotype blocks
genomemat (numpy.ndarray) –
A genome matrix of shape
(m,n,p).Where:
mis the number of chromsome phases.nis the number of individuals.pis the number of markers.
genpos (numpy.ndarray) –
Array of shape
(p,)containing genetic positions of markers across the genome.Where:
pis the number of markers.
Input contraints:
Must be sorted in ascending order.
Must be grouped based on chromosome. The chromosome boundary start and stop indices must be provided in
chrgrp_stixandchrgrp_spix, respectively.
chrgrp_stix (numpy.ndarray) –
Chromosome boundary start indices array of shape
(c,).Where:
cis the number of chromosomes.
chrgrp_spix (numpy.ndarray) –
Chromosome boundary stop indices array of shape
(c,).Where:
cis the number of chromosomes.
chrgrp_len (numpy.ndarray) –
Chromosome length array of shape
(c,).Where:
cis the number of chromosomes.
u_a (numpy.ndarray) –
Array of shape
(p,t)containing additive marker effect estimates.Where:
pis the number of markers.tis the number of traits.
- Returns:
out – A haplotype effect matrix of shape
(m,n,b,t).Where:
mis the number of chromsome phases.nis the number of individuals.bis the number of haplotype blocks.tis the number of traits.
- Return type:
numpy.ndarray