BinarySelectionConfiguration#
- class pybrops.breed.prot.sel.cfg.BinarySelectionConfiguration.BinarySelectionConfiguration(ncross, nparent, nmating, nprogeny, pgmat, xconfig_decn, rng=None, **kwargs)[source]#
Bases:
SampledSelectionConfigurationMixin
,SelectionConfiguration
docstring for BinarySelectionConfiguration.
Constructor for DenseSelectionConfiguration.
- Parameters:
ncross (Integral) – Number of cross configurations to consider. Example:
ncross = 10, nparent = 2
specifies 10 two-way crosses.nparent (Integral) – The number of parents in a given cross configuration. Example:
ncross = 10, nparent = 2
specifies 10 two-way crosses.nmating (Integral, numpy.ndarray) – The number of times an individual cross configuration is executed. This becomes important in four-way crosses with heterozygous parents where initial F1 hybrids are unique and can affect the dihybrid composition.
nprogeny (Integral, numpy.ndarray) – The number of progeny to derive from a mating event.
pgmat (PhasedGenotypeMatrix) – A genome matrix containing parental candidates
xconfig_decn (numpy.ndarray) – A decision vector of shape
(ndecn,)
containing indices corresponding to individuals inpgmat
.rng (numpy.random.Generator, numpy.random.RandomState, None) – Random number source.
kwargs (dict) – Additional keyword arguments.
Methods
Sample a cross configuration from the decision vector and set it as the
xconfig
value.Attributes
Number of cross configurations to consider.
Number of times an individual cross configuration is executed.
Number of parents in a given cross configuration.
Number of progeny to derive from a mating event.
Genome matrix for the parental candidates.
A random number source.
xconfig.
Decision vector for calculating the cross configuration matrix.
- property ncross: Integral#
Number of cross configurations to consider.
- property nmating: ndarray#
Number of times an individual cross configuration is executed.
- property nparent: Integral#
Number of parents in a given cross configuration.
- property nprogeny: ndarray#
Number of progeny to derive from a mating event.
- property pgmat: PhasedGenotypeMatrix#
Genome matrix for the parental candidates.
- property rng: Generator | RandomState#
A random number source.
- sample_xconfig(return_xconfig=True)[source]#
Sample a cross configuration from the decision vector and set it as the
xconfig
value.- Parameters:
return_xconfig (bool) – Whether to return the sampled
xconfig
matrix.- Returns:
out – The sampled
xconfig
matrix ifreturn_xconfig
is true, otherwise return nothing.- Return type:
numpy.ndarray, None
- property xconfig: ndarray#
xconfig.
- property xconfig_decn: ndarray#
Decision vector for calculating the cross configuration matrix.