
Simulation of genomic data is a key tool in population genetics, yet, to date, there is
no forward-in-time simulator of bacterial populations that is both computationally effi-
cient and adaptable to a wide range of scenarios. Here we demonstrate how to simulate
bacterial populations with SLiM, a forward-in-time simulator built for eukaryotes. SLiM
has gained many users in recent years, due to its speed and power, and has extensive
documentation showcasing various scenarios that it can simulate. This paper focuses
on a simple demographic scenario, to explore unique aspects of modeling bacteria in
SLiM’s scripting language. In addition, we illustrate the flexibility of SLiM by simulating
the growth of bacteria on a Petri dish with antibiotic. To foster the development of bac-
terial simulations based upon this recipe, we explain the inner workings of its code. We
also validate the simulator, by extensively testing the results of simulations against ex-
isting simulators, and against theoretical expectations for some summary statistics. This
protocol, with the flexibility and power of SLiM, will enable the community to simulate
bacterial populations efficiently under a wide range of evolutionary scenarios.