nhaploblk_chrom#

pybrops.core.util.haplo.nhaploblk_chrom(nhaploblk, genpos, chrgrp_stix, chrgrp_spix)[source]#

Given a total number of haplotype blocks to assign across the genome, determine the number of haplotype blocks to give to each chromosome.

Parameters:
  • nhaploblk (int) – Total number of haplotype blocks to assign across the genome.

  • 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.

Returns:

out – Array of shape (c,) containing the number of haplotype blocks assigned to each chromosome.

Where:

  • c is the number of chromosomes.

Return type:

numpy.ndarray