Experiments were performed with two fluorescently labeled strains of wild type Escherichia coli: JEK1036 (W3110 [lacZY::GFPmut2], green) and JEK1037 (W3110 [lacZY::mRFP1], red). These strains are isogenic except for the fluorescent markers inserted in the lac operon . Furthermore, we used the non-chemotactic, smooth-swimming strain JEK1038 (W3110 [lacZY::GFPmut2, cheY::frt], green) which was derived from strain JEK1036 by cheY deletion. Fluorescence expression was induced by adding 1 mM of Isopropyl β-D-1-thiogalactopyranoside (IPTG, Promega) to the culture medium.
Growth conditions, the initial culture, and the inlet hole populations
We use the term initial culture to refer to the specific batch culture used to inoculate a habitat. Different initial cultures of the same strain all originate from the same −80°C glycerol-stock, but have been grown independently following the protocol described below.
Overnight cultures were grown in a shaker incubator for approximately 17 hours at 30°C in 3 ml Lysogeny Broth medium (LB Broth EZMix, Sigma-Aldrich). Cultures were subsequently diluted 1:1000 in 3 ml LB medium supplemented with 1 mM IPTG and grown for another 3.5 hours before inoculating the microfabricated devices.
For devices of types 1 to 4 overnight cultures were started by transferring a sample of the frozen stock to a culture tube using a sterile pipet tip. After 1000× back dilution the cultures were grown for 210 ± 21 min (mean ± sd) to an optical density at 600 nm (OD600) of 0.20 ± 0.07 (mean ± sd).
For experiments performed with mixed initial culture of strains JEK1036 and JEK1037, the two strains were grown overnight independently and mixed in 1:1 ratio during back dilution (volume ratios were determined using the OD600 of the overnight cultures). The mixed culture was subsequently grown for 203 ± 11 min (mean ± sd) before inoculation of the device at a combined OD600 of 0.17.
For devices of type 5 the original −80°C glycerol-stock was split into aliquots, overnight cultures were started by adding 6 uL from a thawed aliquot to a culture tube and were subsequently grown for 17 hours ± 3 min. After 1000× back dilution the cultures were grown for 210 ± 2 min (mean ± sd) to an OD600 of 0.34 ± 0.04 (mean ± sd). All initial cultures (of a given strain) used in the same experiment were started from the same −80°C aliquot.
Imaging and data processing
Time-lapse fluorescence imaging of the bacterial populations was done using computer controlled microscopes. Three microscope setups were used: (i) an Olympus IX81 motorized inverted microscope controlled with the MicroManager 1.4.6 software , equipped with a 10× 0.25NA objective and Hamamatsu ORCA-R2 camera; (ii) a Nikon Eclipse Ti+E inverted microscope controlled with the Nikon Elements AR software, equipped with a 10× 0.45NA objective and an Andor iXon 885 emCCD camera; and (3) an Olympus IX81 motorized inverted microscope controlled with the MicroManager 1.4.14 software , equipped with a 20× 0.75NA objective and Andor Neo sCMOS camera. Devices were scanned every 10 minutes for at least 20 hours. Fluorescence images were cropped, concatenated and rescaled using the software ImageJ 1.45 . Further analysis of the data was done using Matlab 2011b and statistical analysis was done using R 1.15.1 for Mac  and Matlab 2013a.
Devices were fabricated from silicon as described in Keymer et al.  using either a one-step (device types 1,2,4 and 5) or two-step (device type 3) process of photolithography and reactive ion etching. Inlet holes were hand drilled using a sandblaster and have a volume of approximately 200–500 nl (mean ± sd = 311 ± 65 nl, volumes estimated for 44 inlet holes on 6 devices by assuming a truncated-cylinder shape where the depth (=550 μm) is given by the thickness of the silicon wafer and the dimensions of the top and bottom surfaces were estimated from images taken with a stereo-microscope). Devices were sealed with a polydimethylsiloxane (PDMS, SYLGARD 184) covered glass coverslips. Devices were used only once.
Bacteria grow in 100 × 100 × 5 μm3
habitat-patches (patch for short, Figure 1C); habitat-patches are connected to form habitats, which consist of a linear array of 85 patches coupled by connectors of 50 × 5 × 5 μm3 (Figure 1C). Each microfabricated device (device for short, Figure 1A-B) consists of multiple habitats etched in the same piece of silicon and sealed with a common coverslip (see below). Habitats are connected to inlet holes using inlet channels (Figure 1A-B).
Five types of microfabricated devices were used, in all cases the actual habitats are the same, however devices differ in the number of parallel habitats, the arrangement of the inlets and the inoculation procedure.
Each device consists of five independent habitats (Figure 1A). Each habitat is connected on both sides to separate inlet holes by 3.1 mm long, 5 μm wide and 5 μm deep inlet channels (Figure 1A). Habitats are separated by 200 μm of solid silicon and are sealed on the top with a PDMS layer, ensuring that there is no liquid connection between different habitats.
Each device consists of five habitats sharing a single inlet (Figure 1B). A 25 μm wide, 2.6 mm long and 5 μm deep inlet channel branches in five 5 μm wide, 9 mm long and 5 μm deep channels which connect all five habitats to a single inlet hole (Figure 1B). Except for the shared inlet there is no liquid connection between the five habitats.
Each device consists of two independent sets of two diffusionally coupled habitats (Figure 5A). Each set consists of two habitats (i.e. top and bottom habitat) separated by 15 μm that are coupled by 200 nm deep nanoslits of 15 × 15 μm2 that are spaced 5 μm apart (Figure 5A). These nanoslits allow for the diffusion of chemicals but are too thin for cells to swim through , thereby confining cells to a single habitat. The top and bottom habitats are both connected to independent inlet holes by 5 μm wide, 3.5 mm long and 5 μm deep inlet channels.
Identical to type 1, except that only the outer two habitats are used (Additional file 10B). The three inner habitats are completely sealed off, creating a separation of 1.2 mm between the two habitats.
Identical to type 1, except that the central habitat (habitat 3) is sealed off.
Device preparation and imaging conditions
Microfabricated devices were filled with LB medium containing 1 mM IPTG. Habitats were inoculated by pipetting 3 μl of initial culture onto an inlet hole. Excess medium was let to evaporate and the inlet holes were subsequently sealed with PDMS. Lastly, a glass coverslip was applied to cover the back of the device. Inlet holes are inoculated with approximately 105 cells (assuming that cells from the excess medium do not enter the inlet hole). The devices were imaged at 26°C.
The culture medium is not refreshed after sealing the device; therefore the use of a rich medium is required to sustain a sufficient increase in population size. We still observe cells swimming through the habitats four days after inoculation. Furthermore, the location of the boundary between the two populations fronts shifts over time. Together this strongly suggests that nutrients are not fully depleted after the initial colonization of the device and that most of the fluorescence signal observed during the first 18 h originates from living cells.
The experimental scheme for the main datasets is summarized in Additional file 11.
Type-1 devices (6 devices, 24 habitats): On each day a single device was imaged; all habitats on the same device were inoculated from a single set of initial cultures (Devices 1–6, Additional file 11). The kymographs of all successfully invaded habitats are shown in Additional file 2.
Type-2 devices (5 devices, 24 habitats): In all but one case a single device was imaged per day (Devices 7–9, Additional file 11); in the remaining case 2 independent devices, both inoculated from the same set of initial cultures, were imaged in parallel on the same microscope setup (Devices 10 and 11, Additional file 11). In all cases all habitats on the same device were inoculated from a single set of initial cultures. The kymographs of all successfully invaded habitats are shown in Additional file 3.
Type-3 devices (2 devices, 3 sets of coupled habitats): The two sets of diffusionally coupled habitats on the same device were prepared identically by inoculating the upper habitat from the left and the lower habitat from the right from the same initial culture of strain JEK1036 (Figure 5A). The kymographs of all successfully invaded habitats are shown in Figure 5 and Additional file 8.
Type-4 device (1 device, 2 habitats): The two habitats were inoculated from the same cultures set, but in reverse orientation (i.e. red from the left in habitat 1 and from the right in habitat 2, Additional file 10B). The kymographs of all successfully invaded habitats are shown in Additional file 10.
Type-5 devices (8 devices, 14 habitats): Each device was inoculated from two independent overnight cultures which were started from the same −80°C aliquot and grow next to each other in the incubator. Each culture set was inoculated in two habitats, in such a way that neighboring habitats contained different culture sets (i.e. culture set 1 in habitats 1 & 3 and culture set 2 in habitats 2 & 4, Additional file 11). The kymographs of all successfully invaded habitats are shown in Additional file 12.
Control experiments: (i) non-chemotactic strain (3 type-1 devices), see Additional file 4A and the accompanying data set ; (ii) red-green co-culture (1 type-1 and 1-type 2 device), see Figure 4G and Additional file 7; (iii) same initial culture from both sides (1 type-1 device using JEK1036, see Additional file 4B-D; 2 type-5 devices where habitats 1&2 were inoculated on both sides with JEK1036 and habitats 4&5 with JEK1037, see accompanying data set ).
Estimating population densities by calculating patch occupancy
We monitored the bacterial metapopulations using their fluorescence emission. However, the fluorescence intensity per cell is different for the two fluorescent proteins and changes with growth phase, making it an imprecise measure of population density. Instead, we estimated population densities by measuring the area fraction of the patches occupied by bacteria, i.e. the occupancy. A pixel in each color channel of an image is considered to be occupied by bacteria if its intensity is above a dynamically calculated threshold. Thresholds are calculated using a previously published  custom-build Matlab-algorithm which fits a Gaussian distribution to the auto-fluorescence intensity of the culture medium and sets the threshold (within predefined bounds) to a value of 3 to 5 standard deviations above the background intensity. Subsequently, the images are converted to binary images using this threshold and the occupancy value, which ranges from 0 (strain absent from patch) to 1 (strain fully covering patch), is calculated for each color-channel. The result of this procedure can be seen in Figure 2: Figure 2B shows the acquired fluorescence image, while Figure 2A shows the calculated occupancy values for the red channel (top) and green channel (bottom, see also Figure 3). It should be noted that the occupancy is not a linear measure of population density, as it cannot distinguish between mono- and multilayers of cells, causing it to saturate at high bacterial densities. Furthermore, the green channel has typically a higher background fluorescence intensity compared to the red channel, this can lead to differences in the detection of faint or motion blurred cells between the two channels. Nevertheless, we believe that occupancy is a more reliable estimate of population density than fluorescence intensity due to its relative insensitivity to differences in the per-cell fluorescence intensity between fluorescent proteins and with growth phase.
Quantitative similarity measure between spatiotemporal patterns of occupancy
To estimate the degree of similarity between cell distributions in two habitats, the Euclidean distance between their occupancy kymographs is calculated. Each pixel in the occupancy kymographs represents a vector [r(t,k);g(t,k)
] of the occupancies of the green strain (JEK1036, g(t,k)
) and red strain (JEK1037, r(t,k)
) for a given patch (k)
at a given time (t)
. The difference (d)
between kymographs is calculated by taking, for each pixel and color channel, the square of the difference in occupancies between the two habitats and summing this over all pixels:
(t,k) and r
(t,k) are the occupancies of strain JEK1037 in patch k at time t obtained for habitats 1 and 2 respectively. Similarly, g
(t,k) and g
(t,k) are the occupancies of strain JEK1036 in patch k at time t calculated for habitats 1 and 2 respectively. The factor 2 M (where M is the total number of pixels in the kymograph) normalizes d, such that it ranges from 0 for identical patterns to 1 for maximally different patterns. The difference is calculated over the period between 3 and 18 hours after inoculation. The first 3 hours are excluded as this time is required to setup the image acquisition and the end limit of 18 hours is chosen as most patterns have stabilized by this time (Additional files 2, 3 and 12). It should be noted that the Euclidean distance between two patterns is mostly affected by differences in high-density regions occupying large expanses (in space and/or time, e.g., the expansion fronts), it is therefore hardly affected by more subtle aspects of the colonization pattern (e.g., the colonization waves).
To compare two datasets we used the Student’s t-test where possible; when variances were unequal (as determined using a two-sample equal variance test) the unequal variances (Welch’s) t-test was used; for datasets that were not normally distributed (as judged by visual inspection) the Wilcoxon rank-sum (i.e. Mann–Whitney U) or the Wilcoxon signed rank test (for paired samples) was used.
The similarity between cell distributions in different habitats was assessed by calculating for each habitat the average difference to habitats inoculated from the same set of initial cultures (<d
>) and the average difference to habitats inoculated from different sets of initial cultures (<d
>). For devices of types-1 and 2 these differences were calculated using habitats on all devices of a given type, while for devices of type-5 comparisons were only made between habitats located on the same device.
To test whether there is a significant difference between <d
> and <d
> for the devices of types 1 and 2 we used a randomization test. To get a single observable per habitat, the ratio of these two differences was taken: d
= < d
>, when d
is smaller than 1 patterns are less different when they are inoculated from the same set of cultures. The difference between spatiotemporal patterns is a comparative measure; the ratio d
of a given habitat therefore depends on the patterns in all other habitats. To deal with this dependence between data points we assessed significance using a randomization test, where we randomize with respect to the set of initial cultures. For each device type (type 1 and 2) we calculated the average of the log transformed d
]>) by averaging over all habitats, we then recalculated this measure after randomizing the spatiotemporal patterns by assigning each observed spatiotemporal pattern to a randomly chosen habitat. The randomizations were performed 10.000 times and p-values were calculated by taking the fraction of cases where <log[d
]> after randomization was smaller than the <log[d
]> of the original, non-randomized, data set. Two devices of type 2 were both inoculated from the same set of initial cultures (Devices 10 and 11, Additional files 3 and 11), for this analysis the habitats on these devices were grouped together.
Neutrality of the strains during bulk growth has been previously described  and was confirmed here by measuring the average doubling time of cultures during the 3.5 hours of growth before inoculation of the devices. There was no significant difference in the average doubling time of strains JEK1036 (green) and JEK1037 (red, mean ± sd = 35.5 ± 2.0 min and 36.0 ± 2.6 min respectively, paired Student’s t-test, p = 0.06, N = 23). Growth curves for the two strains in bulk conditions are shown in Additional file 1.
To test for marker neutrality during growth in the microfabricated devices, we compared the occupancies of the two strains in the habitats. We determined the habitat-wide average occupancies by averaging the occupancy over all patches in a habitat. Population distributions in habitats inoculated from the same culture set are not independent from each other, therefore we average over all habitats inoculated from the same culture set. Additional file 6D shows the resulting average occupancy as function of time. When comparing the average occupancy at the end of the experiment (t = 18 h), we do not detect a significant difference between the two strains (occupancy = 0.28 (0.14-0.33) for JEK1036 and 0.35 (0.17-0.41) for JEK1037 (median, (25%-75%) quantiles), (paired) Wilcoxon signed rank test, p = 0.29, N = 26, Additional file 6F). However, when comparing the occupancy averaged over the entire colonization process (3 < t < 18 h), we observe a slightly higher occupancy for the red cells (occupancy = 0.22 (0.14-0.31) for JEK1036 and 0.26 (0.21-0.43) for JEK1037 (median, (25%-75%) quantiles), (paired) Wilcoxon signed rank test, p = 0.046, N = 26, Additional file 6F). Despite this difference in the average occupancy obtained in the habitats, both strains are able to reach a majority in a habitat. In Additional file 6E it can be seen that in 9 out of 26 experiments strain JEK1036 (green) occupies the majority of the habitats (p = 0.17, sign-test, N = 26), while in 6 experiments strain JEK1036 obtains a two-third majority (compared to 9 experiments for JEK1037). These last results suggest that the two strains are neutral, even tough strain JEK1037 does appear to obtain higher average occupancies in the habitat. It should be noted that the occupancy is not a direct measure for population densities (as discussed previously). Therefore we performed control experiments where we inoculated habitats with a 1:1 mixture of the two strains. Here we observed that the two strains remain fully mixed (Figure 4G, Additional file 7). Furthermore, we observed that both strains are able to drive the other strain almost completely out of the habitat (e.g. compare device 2, Additional file 2 with device 11, Additional file 3). These last two results, together with the isogenic background of the strains, suggest that the two strains are on average neutral when colonizing the habitats.
Wave velocities were determined manually by fitting a line on waves visible in kymographs of the average fluorescence intensity per patch. If a wave changed velocity it was piecewise fitted using either two or three linear segments, for further analysis only the velocity just after entering the habitat was used. Waves were manually classified as either α, β or γ waves. In all experiments a maximum of two low intensity waves were observed, which were classified as α and β waves (for the first and second wave respectively). The high intensity wave at the leading edge of the expansion front was classified as a γ wave, even if the α and/or β waves were not visible. There is no significant difference between the wave velocities of strains JEK1036 (green) and JEK1037 (v = 46 μm/min (median), N = 126 and v = 48 μm/min, N = 86, respectively, Wilcoxon rank sum test, p = 0.25) and for all further analysis the wave velocities of both strains were combined.