This is the repository for the Matlab codes of the numerical simulations of plasmid dynamics in complex communities. This repository includes five scripts. The scripts can be used to generate the figures in the main text and supplementary information of the article "the persistence potential of plasmids"
Script 1: SimulationExample.m
- This code simulates the steady-state distribution of plasmids in a single community. It can be adapted to generate Fig.1C and Fig.S1B in the article.
Script 2: CompareTwoFrameworks_SinglePlasmid.m
- This code calculates the discrepancy between SCF and PCF for single-plasmid communities, which corresponds to Fig. S2A in the supplementary information.
Script 3: CompareTwoFrameworks_TwoPlasmids.m
- This code calculates the discrepancy between SCF and PCF for two-plasmid communities, which corresponds to Fig. S2B in the supplementary information.
Script 4: PersistencePotential.m
- This code generates the steady-state plasmid abundance as a function of persistence potential, which corresponds to Fig. 3C in the manuscript.
Script 5: PersistencePotentialBeforeSteadyState.m
- This code calculates the plasmid abundance and persistence potential before the system reaches the equilibrium state, which corresponds to Fig. S3 in the supplementary information.