MGDrivE: Inheritance Cube
To model an arbitrary number of genotypes efficiently in the same mathematical framework, we use a 3-dimensional array structure (cube) where each axis represents the following information:
The cube structure gives us the flexibility to apply tensor operations to the elements within our equations, so that we can calculate the stratified population dynamics rapidly; and within a readable, flexible computational framework. This becomes apparent when we define the equation we use for the computation of eggs laid at any given point in time:
In this equation, the matrix containing the number of mated adult females () is multiplied element-wise with each one of the layers containing the eggs genotypes proportions expected from this cross (). The resulting matrix is then multiplied by a binary 'viability mask' () that filters out female-parent to offspring genetic combinations that are not viable due to biological impediments (such as cytoplasmic incompatibility). The summation of the transposed resulting matrix returns us the total fraction of eggs resulting from all the male to female genotype crosses ().
Note: For inheritance operations to be consistent within the framework the summation of each element in the z-axis (this is, the proportions of each one of the offspring's genotypes) must be equal to one.
An inheritance cube in an array object that specifies inheritance probabilities (offspring genotype probability) stratified by male and female parent genotypes. MGDrivE provides the following cubes to model different gene drive systems:
cubeOneLocusTA
: 1 Locus Maternal-Toxin/Zygotic-Antidote SystemcubeTwoLocusTA
: 2 Locus Maternal-Toxin/Zygotic-Antidote SystemcubeClvR
: 1 Locus Cleave and Rescue (ClvR)cubeClvR2
: 2 Locus Cleave and Rescue (ClvR)cubeHoming1RA
: Homing Drive with 1 Resistance AllelecubeHomingDrive
: CRISPR (Clustered Regularly Interspaced Short Palindromic Repeats) with 2 Resistance AllelecubeECHACR
: ECHACR (uh....)cubeECHACRX
: ECHACR, X-LinkedcubeKillerRescue
: Killer-Rescue SystemcubeMEDEA
: MEDEA (Maternal Effect Dominant Embryonic Arrest)cubeReciprocalTranslocations
: Reciprocal TranslocationcubeRIDL
: RIDL (Release of Insects with Dominant Lethality)cubeMendelian
: MendeliancubeSplitDrive
: Split CRISPR drivecubeTGD
: trans-complementing Gene DrivecubeTGDX
: trans-complementing Gene Drive, X-LinkedcubeWolbachia
: WolbachiaWe provide one auxiliary function to operate on cube objects.
cube2csv
: Export slices of a cube to .csv formatUseful links