haplobin_bounds#
- pybrops.core.util.haplo.haplobin_bounds(haplobin)[source]#
Calculate haplotype bin boundaries and lengths.
- Parameters:
haplobin (numpy.ndarray) –
Array of shape
(p,)containing haplotype bin assignments for each marker across the genome. Bins are assigned starting at0and strictly increase as the index in the array increases.Where:
pis the number of markers.
Example input:
[0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3]
- Returns:
out – A tuple of length 3 containing
(hstix, hspix, hlen).Where:
hstixis anumpy.ndarraycontaining haplotype bin boundary start indices.hspixis anumpy.ndarraycontaining haplotype bin boundary stop indices.hlenis anumpy.ndarraycontaining haplotype bin lengths.
- Return type:
tuple