44#include " VectorGene.h"
55#include " VectorGeneDriver.h"
66#include " VectorTraitModifiers.h"
7+ #include " VectorMaternalDeposition.h"
78#include " RANDOM.h"
89#include " Exceptions.h"
910#include " Log.h"
@@ -17,6 +18,7 @@ namespace Kernel
1718 : m_pGenes ( nullptr )
1819 , m_pTraitModifiers ( nullptr )
1920 , m_pGeneDrivers ( nullptr )
21+ , m_pMaternalDepositions ( nullptr )
2022 {
2123 }
2224
@@ -26,11 +28,13 @@ namespace Kernel
2628
2729 void VectorFertilizer::Initialize ( const VectorGeneCollection* pGenes,
2830 const VectorTraitModifiers* pTraitModifiers,
29- const VectorGeneDriverCollection* pGeneDrivers )
31+ const VectorGeneDriverCollection* pGeneDrivers,
32+ const VectorMaternalDepositionCollection* pMaternalDepositions )
3033 {
3134 m_pGenes = pGenes;
3235 m_pTraitModifiers = pTraitModifiers;
3336 m_pGeneDrivers = pGeneDrivers;
37+ m_pMaternalDepositions = pMaternalDepositions;
3438 }
3539
3640 InitialGenomeData VectorFertilizer::DetermineInitialGenomeData ( RANDOMBASE* pRNG, uint32_t total )
@@ -144,6 +148,13 @@ namespace Kernel
144148 GermlineMutation ( gametes_female );
145149 GermlineMutation ( gametes_male );
146150
151+ // -------------------------------------------------------------------------
152+ // --- Pre-calculating allele changes due to maternal deposition of Cas9
153+ // -------------------------------------------------------------------------
154+
155+ DoMaternalDepostion ( rFemale, gametes_female );
156+ DoMaternalDepostion ( rFemale, gametes_male );
157+
147158 // -------------------------------------------------------------------------
148159 // --- Now that we have the gametes from each parent and the probability of
149160 // --- that gamete generate the possible genomes (i.e. fertilized eggs).
@@ -487,6 +498,23 @@ namespace Kernel
487498 return gppv;
488499 }
489500
501+ void VectorFertilizer::DoMaternalDepostion ( const VectorGenome& rMomGenome, GameteProbPairVector_t& rGametes ) const
502+ {
503+ if ( ( m_pGeneDrivers == nullptr ) || ( m_pGeneDrivers->Size () == 0 ) ||
504+ ( m_pMaternalDepositions == nullptr ) || ( m_pMaternalDepositions->Size () == 0 ) )
505+ {
506+ return ;
507+ }
508+ else
509+ {
510+ m_pMaternalDepositions->DoMaternalDeposition ( rMomGenome, rGametes );
511+ return ;
512+ }
513+
514+ }
515+
516+
517+
490518 void VectorFertilizer::AdjustForNonFertileEggs ( GenomeProbPairVector_t& rPossibilities ) const
491519 {
492520 for ( auto & r_gpp : rPossibilities )
0 commit comments