SubsetSelectionConfiguration#

class pybrops.breed.prot.sel.cfg.SubsetSelectionConfiguration.SubsetSelectionConfiguration(ncross, nparent, nmating, nprogeny, pgmat, xconfig_decn, rng=None, **kwargs)[source]#

Bases: SampledSelectionConfigurationMixin, SelectionConfiguration

docstring for SubsetSelectionConfiguration.

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 in pgmat.

  • rng (numpy.random.Generator, numpy.random.RandomState, None) – Random number source.

  • kwargs (dict) – Additional keyword arguments.

Methods

sample_xconfig

Sample a cross configuration from the decision vector and set it as the xconfig value.

Attributes

ncross

Number of cross configurations to consider.

nmating

Number of times an individual cross configuration is executed.

nparent

Number of parents in a given cross configuration.

nprogeny

Number of progeny to derive from a mating event.

pgmat

Genome matrix for the parental candidates.

rng

A random number source.

xconfig

xconfig.

xconfig_decn

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=False)[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 if return_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.