Abstract
Biofilms are now considered to be the most abundant form of microbial life on Earth, playing critical roles in biogeochemical cycles, agriculture, and health care. Phenotypic and genotypic variations in biofilms generally occur in three-dimensional space and time, and biofilms are therefore often investigated using microscopy. However, the quantitative analysis of microscopy images presents a key obstacle in phenotyping biofilm communities and single-cell heterogeneity inside biofilms. Here, we present BiofilmQ, a comprehensive image cytometry software tool for the automated high-throughput quantification and visualization of 3D and 2D community properties in space and time. Using BiofilmQ does not require prior knowledge of programming or image processing and provides a user-friendly graphical user interface, resulting in editable publication-quality figures. BiofilmQ is designed for handling fluorescence images of any spatially structured microbial community and growth geometry, including microscopic, mesoscopic, macroscopic colonies and aggregates, as well as bacterial biofilms in the context of eukaryotic hosts.
Main Text
Microbial biofilm communities shape the Earth by contributing to the biogeochemical cycles in soil, sediments, oceans, and the plant microbiota1. Microbial communities are also an integral part of human health, due to their functions in the intestinal and oral microbiota, as well as in infections, where cells that are bound in biofilms can display a 1000-fold higher tolerance to antibiotics than planktonic cells2. Biofilms are generally three-dimensional (3D) communities that display spatial gradients of nutrients and many other diffusible molecular compounds, as well as spatiotemporal variation in species composition and cellular differentiation3,4. Due to the spatial heterogeneity of phenotypes and genotypes inside biofilms, studies of biofilms often rely on 3D fluorescence imaging, e.g. using confocal microscopy. For biofilm phenotyping, and for characterizing phenotypes of particular cells within biofilms, it is critical to be able to perform image-based quantitative measurements of fluorescent reporters and structural features for particular regions inside the biofilm.
Extracting the desirable information from 3D images relies on non-trivial automated image analysis. The most widely-used tool for biofilm image analysis in the literature is COMSTAT5, which was released almost 20 years ago and provided one of the first tools to objectively determine differences in biofilm morphology. More recent software tools6–8 were released 10 years ago and include a refined threshold-based detection of biofilm biomass, the quantification of more fluorescence channels, and correlation functions. These tools have been tremendously important for biofilm research. However, since their release, there has been an ongoing revolution in image analysis capabilities, and in how quantitative information from biological images is extracted and presented9. The design of biofilm research projects and the discovery of new biofilm behaviours are currently limited by the lack of modern cytometry software tools that allow researchers to measure a comprehensive set of spatially and temporally resolved structural parameters and fluorescent reporters inside biofilms. New methods for the spatial and temporal analysis of biofilm structure, fluorescent reporters, and cytometry are therefore paramount to the field.
Inspired by the powerful and user-friendly tools for bacterial cell biology10–13, we have developed new image analysis algorithms for microbial communities, which we bundled in the form of a user-friendly software tool termed BiofilmQ (https://drescherlab.org/data/biofilmQ). This tool provides a graphical user interface that requires no programming or prior knowledge of image analysis; extensive documentation and video tutorials guide users through each step in the image analysis and data visualization pipeline.
BiofilmQ relies on standard fluorescence microscopy image data that does not need to resolve all individual cells. For 2D imaging, most fluorescence microscopy techniques should result in suitable images for BiofilmQ, while for 3D imaging we recommend using confocal or light sheet fluorescence microscopy to provide an optical resolution in the 3rd dimension that is appropriate for the particular project under investigation. The core concept of the BiofilmQ 3D image analysis (Fig. 1a) is to first perform a 3D segmentation of the biofilm structure based on one of the fluorescence channels, to detect the 3D biofilm volume location, followed by the dissection of this 3D biofilm volume into a cubical grid, whose cubes have a user-defined size that can be chosen to be approximately equal to the cell volume. For further analysis, the individual cubes of this biofilm are then treated as pseudo-cells, for which data can be extracted as if they were single cells. This results in flow-cytometry-like data, but with the additional component of spatial features, without requiring optical single-cell resolution. For each cube, BiofilmQ quantifies as many fluorescence, structural, and textural parameters as desired, in addition to the cube’s spatial context (Fig. 1b). Independently from the pseudo-cell cubes, BiofilmQ computes global morphological, structural, textural, and fluorescence properties of the whole 3D biofilm volume (Fig. 1c). BiofilmQ therefore provides local and global quantifications of many biofilm properties. For the special case of 2D image data input (e.g. from epi-fluorescence, confocal, or any other fluorescence microscopy technique), the biofilm biomass area is segmented into small squares, analogous to the cubes in 3D images, followed by similar analysis steps to the 3D datasets. BiofilmQ thus allows biofilm cytometry and high-throughput phenotyping of biofilms, providing many spatially-resolved structural, textural, and fluorescence readouts that were previously unavailable.
Images of biofilms in any growth geometry and any species can be analysed with BiofilmQ (Fig. 2a) – the only requirement for the BiofilmQ analysis is that the 3D (or 2D) image dataset contains at least one fluorescence channel on which the community segmentation is based. Many commonly used microscopy image formats are supported in BiofilmQ (Fig. 2b), based on the Bio-Formats toolbox14.
An important first step in the quantification of biofilm properties is the segmentation of the biofilm biomass location (Fig. 2d). Biofilm segmentation algorithms have received significant attention in the literature15–21. BiofilmQ therefore offers different segmentation workflows: either semi-manual segmentation supported by immediate visual feedback, or via automatic segmentation algorithms, such as Otsu, Ridler-Calvard, robust background, or maximum correlation thresholding. Several optional pre-processing steps (Fig. 2c) may precede the threshold calculation to improve segmentation results.
Following the segmentation of the whole biofilm volume, the biofilm is dissected into cubes of equal size, which are treated as pseudo-cells for the local parameter calculation (Fig. 1c). This approach permits the spatially-resolved quantification of parameters of interest inside the biofilm (Fig. 2e). Local parameters are quantified for each cube and therefore have a spatial and potentially a temporal dependence. Each cube’s location is given by its centre coordinate (x,y,z), which can be expressed as the distance to the biofilm centre, distance to the biofilm surface, or distance to the substratum. Based on the dissection of the biofilm volume into cubes, numerous structural, textural, and fluorescence properties can be calculated for each cube. For example, cube-internal structural parameters are computed, such as local density and local porosity. Structural parameters also include local biofilm surface properties such as biofilm thickness, surface area, surface roughness coefficient, and surface per substrate area, which are calculated per pillar of cubes sharing the same substrate area, and we assign the same value of these parameters to each cube in a given pillar. Textural parameters are quantified according to Haralick et al.22, for each cube. Fluorescence parameters calculated for each cube are basic fluorescence quantifications for each fluorescence channel, as well as their overlap, their ratio, the Manders’ overlap and Pearsons’ correlation for different fluorescence channels, autocorrelation, and also density correlation values depending on a range chosen by the user. It is also possible to track pseudo-cell cube lineages (see Supplementary Note) to measure clonal cluster sizes and similar properties.
In addition to the local parameters described above, BiofilmQ also calculates global parameters for the whole biofilm (Fig. 2e). Some of these parameters characterize the size and morphology of the whole biofilm, including its volume, mean thickness, surface area, roughness coefficient, or area covered on the substratum, as well as several combinations of these values, such as the surface-to-volume ratio. A subset of these parameters is also available in COMSTAT5, for which we chose identical implementation to enable compatibility (Supplementary Table 1, Supplementary Note). In addition to these structural parameters, BiofilmQ offers the possibility to quantify correlations between different fluorescence reporters globally and locally via the Manders’ overlap coefficients, Pearson’s correlation coefficient, volume overlap fractions, and relative abundances of biomass. These parameters enable, e.g., quantitative measures of species cluster sizes and separation distances in multispecies biofilms via 3D correlation functions. Furthermore, the mean (optionally weighted by cube biovolume to account for cubes with different biovolume fraction), median, minimal, maximal as well as percentiles of every local parameter also make up one global parameter each, which are all calculated for the entire biofilm, its core (cubes deep below the biofilm surface), and shell (cubes close to the surface).
After the analysis of a single 3D (or 2D) biofilm image, BiofilmQ can apply the same analysis to a whole time-series (to analyse the temporal variation of a single biofilm), or to a non-time-series collection of biofilm images (to analyse the variation within a population of biofilms). All data analysis operations can be performed in high-throughput through BiofilmQ-inbuilt batch-processing capabilities, and results can be exported to standard formats (Fig. 2f) or directly visualized (Fig. 2g).
After the image analysis, BiofilmQ offers flexible and powerful options to visualize all quantified parameters (Fig. 3), resulting in publication-quality editable figures. In a spatiotemporal kymograph, the spatial dependence of a biofilm-internal property (e.g. a fluorescent reporter or any other cube parameter) can be visualized over time (Fig. 3b). Importantly, different biofilm-internal spatial measures, such as distance-to-surface or distance-to-substrate, can be chosen on the y-axis for these heatmaps, and different temporal measures, such as biofilm volume or surface area, can be also used instead of time on the x-axis. Each column of such kymographs can be plotted as a “1.5D histogram”, in which, for a particular time-point, the biofilm cube parameter of interest can be averaged across cubes within a biofilm and plotted with error bars against a spatial axis of choice (Fig. 3b, inset). If instead of a time series, a population of different biofilms is analysed, choosing the kymograph-plot type will result in a demograph that visualizes variations of the internal spatial structure or fluorescence properties across different biofilms in the population (Fig. 3b)
To visualize a global property as a function of time (Fig. 3c), or any other parameter, a simple “2D scatterplot per frame” may be used. The “2D+colour scatterplot” option does not perform averaging per frame and can therefore be used with the axes chosen more freely, for example including spatial coordinates, and can also colour-code each data point according to another parameter (Fig. 3d). Even more flexibility is provided by the “3D+colour scatterplot” for visualizing the quantified local properties of biofilms (Fig. 3d).
Analogous to flow cytometry, the biofilm image cytometry provided by BiofilmQ allows users to apply gates/filters to their data for each pseudo-cell cube, to effectively select pseudo-cell sub-populations with certain characteristics (Fig. 3d, inset). The different gated populations can then be analysed separately with the BiofilmQ plotting capabilities.
To generate 3D rendered biofilms, for which each cube-parameter can be mapped as colour onto the rendered biomass (Fig. 3f), BiofilmQ can export the image analysis results into vtk-files, which can be loaded into the open-source 3D-rendering software ParaView23.
BiofilmQ closes a critical gap in the toolset for the spatial and spatiotemporal analysis of microbial communities, by providing a comprehensive image analysis platform that is capable of handling any community spatial geometry. BiofilmQ is user-friendly and designed such that it can be used by beginners within minutes, owing to the extensive video tutorial support and technical documentation. Previously inaccessible global and local biofilm parameters can now be extracted to quantify phenotypic differences between strains, species, and growth conditions, enabling the detailed exploration of phenotypic, genotypic, and structural heterogeneity within biofilms and between biofilms. Batch-processing capabilities make BiofilmQ suitable for biofilm phenotyping in high-content screens. BiofilmQ therefore enables new directions for biofilm research, and simultaneously provides a solid quantitative foundation for future studies of spatially structured microbial communities.
Methods
Bacterial biofilm growth
Vibrio cholerae, Bacillus subtilis, and Escherichia coli strains were routinely grown in liquid lysogeny broth (LB-Miller) at 37 °C under shaking conditions. The strains and plasmids used in this study are listed in Supplementary Tables 2 and 3.
Flow chamber biofilm experiments were performed in M9 minimal medium with 0.5% (w/v) glucose for V. cholerae, and tryptone broth (10 g L−1) for E. coli. To grow flow chamber biofilms of V. cholerae and E. coli, microfluidic chambers of 7 mm length and 500 µm × 100 µm cross-section were used18,21, and a flow rate of 0.1 µL min−1 was set using a syringe pump (Pico Plus, Harvard Apparatus). To inoculate flow chambers, overnight cultures were back-diluted 1:200 in LB medium for V. cholerae, and 1:80 in 0.9% (w/v) NaCl for E. coli, and grown to an optical density at 600 nm of OD600 = 0.5. This culture was then used to inoculate the flow chambers. After inoculation, cells were given 1 h to attach to the surface before the constant flow with fresh medium was initiated.
To grow mixed biofilms of V. cholerae strains containing different fluorescent protein markers, cultures of all strains were inoculated in microfluidic chambers in a 1:1 ratio for 2 strains, and 1:1:1 for 3 strains, before the constant flow of fresh medium was started.
Pellicle biofilms of B. subtilis NCBI3610 carrying PtapA-gfp and PtapA-mKate transcriptional reporters on the chromosome, were grown in MSgg medium24 without shaking at the air-liquid interface in 24-well microtiter plates for 48 h at 30°C.
Macrocolony biofilms of E. coli AR3110 were initiated by spotting 5 µL of overnight culture on solid LB medium (1.5% agar, w/v). Plates were sealed with parafilm and incubated for 5 days at 23°C, prior to imaging.
Imaging
For spatiotemporal measurements of different reporters and for separating different populations in flow chambers, biofilms were imaged with a Yokogawa CSU confocal spinning disk unit mounted on a Nikon Ti-E inverted microscope using a Plan Apo 60x oil NA 1.4 objective (Nikon), by exciting fluorescence with a 488 nm laser (for sfGFP) and a 552 nm laser (mRuby2/mRuby3). Images were acquired with an Andor iXon EMCCD camera, cooled to – 80°C, using the EM-gain of the camera. Macrocolony biofilms of E. coli strain (KDE1469) were imaged using the above microscope setup, but with a 4x air NA 0.2 objective, exciting the constitutively expressed sfGFP.
To image a mixed population of strains with different fluorescent reporters, and to image pellicle biofilms, images were captured using a Zeiss LSM 880 point-scanning confocal laser scanning microscope, with a 40x NA 1.2 water objective for V. cholerae and B. subtilis. For E. coli biofilms, the same microscope was used with a 63x NA 1.4 oil objective.
Image analysis
As BiofilmQ is open source software, written in Matlab (MathWorks), it is possible to adapt BiofilmQ to particular user requirements. Algorithms used for biofilm pre-processing, segmentation, parameter quantification, and data visualization are described in detail with examples in the online documentation at https://drescherlab.org/data/biofilmQ. All code is freely available, revealing the exact implementation of each data analysis step.
Author contributions
R.H., H.J., E.J., K.D. conceived and designed the project and the graphical user interface. R.H. developed the algorithms, H.J., E.J. extended algorithms. R.H., H.J., E.J. developed the image analysis and data visualization workflows. H.J., E.J., M.B., S.V. created video tutorials. E.J. wrote the documentation. All authors contributed data, analysis ideas, and important discussions. R.H., H.J., E.J., K.D. wrote the paper and created the figures.
Additional information
Supplementary information is available in the online version of the paper. Video tutorials, a detailed documentation, and downloads are available at https://drescherlab.org/data/biofilmQ.
Competing financial interests
The authors declare no competing financial interest.
Code and data availability
Image data and processed data used in this study are available from the corresponding author upon reasonable request. Software code is available at https://drescherlab.org/data/biofilmQ.
Acknowledgements
We are grateful to Takuya Ohmura, Konstantin Neuhaus, Daniel Rode, and the Drescher lab for comments and help with trouble-shooting BiofilmQ, as well as Ana L. Gallego Hernandez, William DePas, Jin Hwan Park, Jennifer Teschler, and Dianne K. Newman for image data. This work was supported by grants to K.D. from the Max Planck Society, European Research Council (StG-716734), Human Frontier Science Program (CDA00084/2015-C), Deutsche Forschungsgemeinschaft (SFB 987), the Behrens-Weise-Stiftung, and the Minna-James-Heineman-Stiftung.