ThreeWayCross#
- class pybrops.breed.prot.mate.ThreeWayCross.ThreeWayCross(progeny_counter=0, family_counter=0, rng=None, **kwargs)[source]#
Bases:
MatingProtocol
Class implementing mating protocols for three-way crosses.
Constructor for the concrete class ThreeWayCross.
- Parameters:
progeny_counter (Integral) – Progeny counter. This helps create progeny names.
family_counter (Integral) – Family counter. This helps label groups of progenies as originating from the same family.
rng (numpy.random.Generator, numpy.random.RandomState) – Random number source.
kwargs (dict) – Additional keyword arguments.
Methods
Mate individuals according to a 3-way mate selection scheme.
Attributes
Description for property family_counter.
Number of parents the mating protocol requires.
Description for property progeny_counter.
Random number generator.
- property family_counter: Integral#
Description for property family_counter.
- mate(pgmat, xconfig, nmating, nprogeny, miscout=None, nself=0, **kwargs)[source]#
Mate individuals according to a 3-way mate selection scheme.
- Parameters:
pgmat (DensePhasedGenotypeMatrix) – A GenotypeMatrix containing candidate breeding individuals.
xconfig (numpy.ndarray) –
A 1D array of indices of selected individuals of shape
(k,)
.Where:
k
is the number of selected individuals.
Indices are paired as follows:
First index is the recurrent parent.
Second index is the female parent.
Third index is the male parent.
Example:
xconfig = [1,5,3,8,2,7] recurrent = 1,8 female = 5,2 male = 3,7
nmating (numpy.ndarray) – Number of cross patterns to perform.
nprogeny (numpy.ndarray) – Number of doubled haploid progeny to generate per cross.
miscout (dict, None, default = None) – Pointer to a dictionary for miscellaneous user defined output. If
dict
, write to dict (may overwrite previously defined fields). IfNone
, user defined output is not calculated or stored.s (int, default = 0) – Number of selfing generations post-cross.
kwargs (dict) – Additional keyword arguments to be passed to constructor for the output DensePhasedGenotypeMatrix.
- Returns:
out – A DensePhasedGenotypeMatrix of progeny.
- Return type:
- property nparent: Integral#
Number of parents the mating protocol requires.
- property progeny_counter: Integral#
Description for property progeny_counter.
- property rng: Generator | RandomState#
Random number generator.