DOI: 10.5281/zenodo.16743428
title: Tracking bacterial inter- and intraspecific competition in pairwise assays using a transient fluorescent dye

description: This repository contains data and code for the manuscript titled:

Tracking bacterial inter- and intraspecific competition in pairwise assays using a transient fluorescent dye

Overview

This manuscript presents a new methodology to track relative abundances of two competing bacterial types based on staining the population of one competitor with a transient fluorescent dye. Competitor identity during the competition is then determined based on single cell fluorescence intensity. Classification of stained and unstained cells is based on fluorescence thresholds determined by Receiver-Opterator Curves (ROC). For the manuscript presented three experiments were performed: a staining test, a competition assay with two genotypes of Pseudomonas fluorescens and a competition assay between Pseudomonas fluorescens and Escherichia coli.

Abstract



Testing inter- and intraspecific competition is essential for understanding the processes that maintain diversity within communities and populations. Pairwise growth assays are well-established methods to study the outcome of competition between bacterial genotypes or species. However, distinguishing bacterial competitors in coculture remains a major challenge due to their small cell size, similar cell morphology and often large population sizes. Current approaches are either labour intensive and require prior morphological and sequence-based characterisation, or genetic modification of the bacteria.

We present a simple assay that tracks the relative abundances of two competing bacterial species or genotypes of the same species through transient staining of one competitor with a fluorescent dye. The use of a transient dye relieves of prior characterisation or genetic modification. Our approach uses a sample-dependent threshold evaluation for the fluorescent intensity, enabling the quantification of bacteria frequencies over generations. The method provides a high accuracy for tracking of competing genotypes and species.

The outcome of competition often depends on frequency-dependent fitness effects and/or environmental variables. Therefore, our method tests across different initial abundances and can also assess the role of a biotic interaction (presence/absence of a predator) on the outcome of competition.

Our method presents a simple and high-throughput assay for competition.  Absence of genetic modifications and applicability to little characterised competitors make it particularly useful for assays involving bacterial isolates from evolving populations. 


Structure of the repository

This repository is split into three zip folders. 

The First ZIP

 "tracking_bacterial_competition-main.zip" contains data for each of the three experiments, each stored in a separate folder. For the staining test there is data for the classification of stained and unstained cells and the measured fluorescence values. For both competition experiment there is data for the classification of stained and unstained cells, data for the evaluation of competitions on growth agar and optical density measurements from the competition cultures.Within the same zip folder, the folder "R scripts" contains programming code (written by Author 1) that processes (e.g. annotates) the raw data in the three experiment folders. The raw data files are those files either extracted from the machine (i.e. the imaging-flow cytometer) or the excel files created for the counting of colonies on growth agar. From these excel files txt files were exported for use in R (this repository contains both file types). The main folder contains three R markdown script that each contain the analyses for one of the three experiements. The scripts can be compiled as html reports. Output from theses script is saved to the "Results" folder.

The second ZIP 

"Thresholding.zip" contains programming scripts in Python written by Author 2 that perfrom and evaluate the fluorescence threshold calculation basesd on ROCs to distinguish stained and unstained bacterial cells on co-culture. The scripts can be used to recreate multiple analysis and plots from the article related to the calculation and performance of thresholds. Probably the most desirable script is "t02_determine_threshold.py" which contains code to estimate the thresholds from a given experiment and also generates a plot + metrics for evaluation. The scripts were fed with raw data extracted from our imaging flow-cytometer. This data is deposited in the third zip folder (see below).Here is a full list of scripts and their purpose:

## t01_staining_concentration.py

This script computes optimal thresholds for different concentrations of the fluorecent dye for different data setups. There were two independent controls of unstained cells against which fluorescent thresholds were computed and evaluated (columns B and G on a 96-well microtiter plate). Threhsolds are named according to which control they wer computed/evaluated. E.g I7_G corresponds to a thrshold of stained I7 against the G control, while i7_B_G corresponds thresholds computed on B while evaluated on G. The ROC Curves are saved as pngs and the results in corresponding txt files.

## t02_accuracy_per_threshold.py

This script computes the accuracies for different thresholds and time points for either I6 being stained, I7 beingstained or the combination of both. One can see that the optimal thresholds for I6 and I7 differ, but a common thresholdstill reaches good accuracy.

## t02_compute_csv_for_threshold.py

Computes the ratios of stained/unstained cells for all wells in the data folder and stores it as a csv.

## t02_determine_threshold.py

This script can be used to compute the optimal threshold for a given setup. The most important function is **compute_roc_threshold(data, classes_training=[identifiers_strained, identifiers_unstained], name="experiment",thresholding_dimension=thresholding_dimension)**, where data is a pandas data frame which contains at least twocolumns, <em>identifyer</em> and the thresholding_dimension e.g. <em>Intensity_MC_Ch11</em>. The function automaticallygenerates a plot of the ROC curve and returns the threshold as well as the true-positive-rate, true-negative-rate andaccuracy for evaluation.

## t02_roc_curves_for_thresholds.py

Computes ROC curves for different time points of an experiemnt, including optimal thresholds.

## t03_roc_curves_for_thresholds.py

Computes ROC curves for different time points of an experiment, including optimal thresholds. It also compares theoptimal threshold (.) per timepoint with the optimal threshold (x) over all time points combined. For better visibilityits zoomed in.

The third ZIP 

This dataset is split into multiple .7z (SevenZip) volumes. Download all parts before extraction. The resulting "Raw_isx_data.zip" contains raw data acquired by our imgaing flow-cytometer (AMNIS ImagesStream Mk2). In a separate folder data for each of the three experiments is stored. Samples were acquired from 96-well microtiter plates. The excel file in the folders illustrates how samples were distributed across these plates. Corresponding to these layouts, there are subfolders for different sampling time points during the experiments. For each sample/well there are four file types: the three proprietary file types of the acquisition software (.daf, .cif, .rif) and a .txt file. The .txt file contains the extracted feature values (such as fluorescence intensity).  These .txt files were used to compute threshold and ROCs with the scripts in "Thresholding.zip" (and where generated by the proprietary IDEAS analysis software).