This iPython notebook illustrates how you can use gene duplication within StochPy's cell division module. We use an extended immigration-death model which consists of two different mRNAs that are both transcribed from a different part of the genome. Gene duplication doubles the transcription rate of the corresponding mRNA. Written by TR Maarleveld, Amsterdam, The Netherlands E-mail: tmd200@users.sourceforge.net Last Change: August 10, 2015 import stochpy # required for iPython Notebook inline plotting %matplotlib inline We start using this model without adding gene duplication. We set both genes as non-dividing species to ensure that the gene is passed from mother to daughter for each generation. cmod = stochpy.CellDivision(IsQuiet=True) cmod.Model("gene_duplication.psc") cmod.SetGrowthFunction(0.1) cmod.SetNonDividingSpecies(["G1","G2"]) cmod.DoCellDivisionStochSim(end=3,method="direct") cmod.PlotSpeciesTimeSeries() cmod.DoCellDivisionStochSim(end=4000,mode="generations") cmod.PrintSpeciesMeans() We do not observe any significant changes between the mRNA copy number levels. This is expected because we use the same set immigration and death rate for mRNA1 and mRNA2. Now we add gene duplication for mRNA1 and mRNA2 which occur as 25% and 75% of the interdivision time, respectively. We expect that in steady state mRNA1 > mRNA2. cmod.Model("gene_duplication.psc") cmod.SetGrowthFunction(0.2) cmod.SetGeneDuplications(["G1","G2"],[0.25,0.75]) # at 25% and 75% of the interdivision time cmod.DoCellDivisionStochSim(end=3,method="direct") cmod.PlotSpeciesTimeSeries() cmod.DoCellDivisionStochSim(end=10000,mode="generations") cmod.PrintSpeciesMeans() cmod.PlotSpeciesOverview("mRNA1") cmod.PlotSpeciesOverview("mRNA2")