FourWayDHCross#

class pybrops.breed.prot.mate.FourWayDHCross.FourWayDHCross(progeny_counter=0, family_counter=0, rng=RandomState(MT19937) at 0x7F8D0DF4C840, **kwargs)[source]#

Bases: MatingProtocol

Class implementing mating protocols for four-way DH crosses.

Constructor for the concrete class FourWayDHCross.

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

Mate individuals according to a 4-way mate selection scheme.

Attributes

family_counter

Description for property family_counter.

nparent

Number of parents the mating protocol requires.

progeny_counter

Description for property progeny_counter.

rng

Random number generator.

property family_counter: int#

Description for property family_counter.

mate(pgmat, xconfig, nmating, nprogeny, miscout=None, nself=0, **kwargs)[source]#

Mate individuals according to a 4-way mate selection scheme.

Example crossing diagram:

sel = [F2,M2,F1,M1,...], ncross = 2, nprogeny = 2, nself = 2
                                     pgmat
                                       │                        sel = [F2,M2,F1,M1,...]
                                (F2xM2)x(F1xM1)
                       ┌───────────────┴───────────────┐        ncross = 2
                (F2xM2)x(F1xM1)                       ...       duplicate cross 2x
                       │                               │        nself = 2
              S0((F2xM2)x(F1xM1))                     ...       first self
                       │                               │
              S1((F2xM2)x(F1xM1))                     ...       second self
           ┌───────────┴───────────┐               ┌───┴───┐    DH, nprogeny = 2
DH(S1((F2xM2)x(F1xM1))) DH(S1((F2xM2)x(F1xM1)))   ...     ...   final result
Parameters:
  • pgmat (DensePhasedGenotypeMatrix) – A GenotypeMatrix containing candidate breeding individuals.

  • xconfig (numpy.ndarray) –

    Array of shape (ncross,nparent) containing indices specifying a cross configuration. Each index corresponds to an individual in pgmat.

    Where:

    • ncross is the number of crosses to perform.

    • nparent is the number of parents required for a cross.

    Indices are paired as follows:

    • First index is the female parent 2.

    • Second index is the male parent 2.

    • Third index is the female parent 1.

    • Fourth index is the male parent 1.

    Example:

    xconfig = [[ 1, 5, 3, 8 ],
               [ 2, 7, 0, 4 ],
               ...,
               [ F2, M2, F1, M1 ]]
    female2 = [1, 2, ..., F2]
    male2 = [5, 7, ..., M2]
    female1 = [3, 0, ..., F1]
    male1 = [8, 4, ..., M1]
    

  • 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). If None, user defined output is not calculated or stored.

  • nself (int, default = 0) – Number of selfing generations post-cross before double haploids are generated.

  • kwargs (dict) – Additional keyword arguments to be passed to constructor for the output DensePhasedGenotypeMatrix.

Returns:

out – A DensePhasedGenotypeMatrix of progeny.

Return type:

DensePhasedGenotypeMatrix

property nparent: Integral#

Number of parents the mating protocol requires.

property progeny_counter: int#

Description for property progeny_counter.

property rng: Generator | RandomState#

Random number generator.