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:

    • m is the number of chromsome phases.

    • n is the number of individuals.

    • p is the number of markers.

  • genpos (numpy.ndarray) –

    Array of shape (p,) containing genetic positions of markers across the genome.

    Where:

    • p is 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_stix and chrgrp_spix, respectively.

  • chrgrp_stix (numpy.ndarray) –

    Chromosome boundary start indices array of shape (c,).

    Where:

    • c is the number of chromosomes.

  • chrgrp_spix (numpy.ndarray) –

    Chromosome boundary stop indices array of shape (c,).

    Where:

    • c is the number of chromosomes.

  • chrgrp_len (numpy.ndarray) –

    Chromosome length array of shape (c,).

    Where:

    • c is the number of chromosomes.

  • u_a (numpy.ndarray) –

    Array of shape (p,t) containing additive marker effect estimates.

    Where:

    • p is the number of markers.

    • t is the number of traits.

Returns:

out – A haplotype effect matrix of shape (m,n,b,t).

Where:

  • m is the number of chromsome phases.

  • n is the number of individuals.

  • b is the number of haplotype blocks.

  • t is the number of traits.

Return type:

numpy.ndarray