oscar_colony.breeding_scheme.BreedingScheme#

class oscar_colony.breeding_scheme.BreedingScheme(parent_1_genotype, parent_2_genotype)[source]#

Class representing a particular breeding scheme, i.e. the breeding of two specific parent genotypes.

__init__(parent_1_genotype, parent_2_genotype)[source]#

Create a breeding scheme with two parent genotypes.

Parameters:
  • parent_1_genotype (tuple[Genotype, ...] | str) – Genotype of parent 1 either as a tuple of Genotypes or as a string representation like het_hom_het

  • parent_2_genotype (tuple[Genotype, ...] | str) – Genotype of parent 2 either as a tuple of Genotypes or as a string representation like het_hom_het

Raises:

ValueError – If the parent genotypes don’t have the same length

Methods

__init__(parent_1_genotype, parent_2_genotype)

Create a breeding scheme with two parent genotypes.

mendelian_ratio()

Calculate the theoretical mendelian ratio for this breeding scheme.

mendelian_ratio()[source]#

Calculate the theoretical mendelian ratio for this breeding scheme.

Returns:

Returns a dictionary with keys being the possible genotypes of offspring, and values the expected proportion of offspring of that genotype.

Return type:

dict[tuple[Genotype, ...], float]