DOI: 10.5281/zenodo.3938458
title: Photogranulation-quantification

description: This repository contains scripts and associated files to quantify the production of oxygenic photogranules cultivated under static batch conditions. The files are grouped in three folders: (1) for the preparation of a marker image used for photogranule detection (“marker_image”), (2) for the detection and quantification of particle size on the experimental images of a time series (“experimental_images”) and (3) for converting the image data into equivalent diameters and plotting (“photogranulation_quantification”). Note: Because of size limitations, we were unable to upload original experimental images acquired as uncompressed tagged image files (.tif) to GitHub. Instead, jpg files of the images were generated and are used for this demonstration. The use of jpg files leads to different results than the use of tif files. Production of oxygenic photogranules (OPGs) is quantified by time-lapse imaging coupled to automated image analysis. OPGs are produced in statically incubated vials. A scanning image using a desktop scanner is taken periodically through the bottom of the incubation vials over time. During successful photogranulation, the sludge bed that initially covers the entire vial bottom contracts, i.e., reduces in diameter, until it forms a well-contracted OPG. The surface area of particles in the vial, i.e., the contracting biomass, are measured using the image processing software ImageJ, version 1.52a (Schneider et al., 2012) and the MorphoLibJ plugin, version 1.4.0 (Legland et al., 2016). These data are subsequently entered into the software environment R, version 3.6.0 (R Core Team, 2019) to plot the decrease in biomass diameter over experimental time using packages plyr version 1.8.4 (Wickham, 2011) and ggplot2 version 3.2.0 (Wickham, 2016). (1) marker_image<br> The “marker_image” folder contains an ImageJ macro to generate a marker image from an image of the empty experimental setup (background_image.jpg). The marker image is used to remove the grid from the experimental images at (2) “experimental_images” and to identify measured particles from a vial at a specific physical location on each image at (3) “photogranulation_quantification”. The macro can be installed in ImageJ by clicking on ‘plugins’, ‘macros, ‘install’ and selecting the imagej_macro_marker_image.ijm. It can be run by clicking on ‘plugins’, ‘macros’, ‘imagej_macro_marker_image’. During execution of the macro, the output directory to save the created marker image and a background image (e.g., background_image.jpg) have to be manually selected. Thresholding has to be done manually (0,191 to obtain the same result files). The result files after successful execution of the macro should match the files marker_image.jpg, marker_overlay.jpg and results_marker.csv.<br> Note: the values in results_marker.csv does not match the values that will be entered into R in (3) “photogranulation_quantification”, because these were generated using the original background image in tif format. (2) experimental_images<br> The ImageJ macro to treat the experimental time-lapse images can be found in the “experimental_images” folder. This macro measures particle characteristics on an image (in our experiments 72 particles for 72 vials, or one photogranule per vial) on a time-series of images (in our experiment a total of 110 images, acquired every eight hours over six weeks). Three experimental images (first, middle and last image) are presented here as an example to run a demo. The macro can be installed in ImageJ by clicking on ‘plugins’, ‘macros, ‘install’ and selecting the imagej_macro_experimental_images.ijm. It can be run by clicking on ‘plugins’, ‘macros’, ‘imagej_macro_experimental_images’. During execution of the macro, the input directory with raw images (e.g., scanner_image_1/2/3.jpg), output directory to save created images and a marker image (e.g., marker_image.jpg) have to be manually selected. Thresholding has to be done manually (0,140; 0,72; 0,71 for respectively 1, 2, 3 to obtain the same result files). The results from executing this macro should match the scanner_image_1/2/3_final.jpg and scanner_image_1/2/3_results.csv.<br> Note: the values in the result files do not match the values that will be entered into R in (3) “photogranulation_quantification”, because the latter were generated using the original background image in tif format. (3) photogranulation_quantification<br> The “photogranulation_quantification” folder contains the R script to couple measured particle characteristics on experimental time-lapse images to unique samples and experimental conditions using the marker image. Subsequently, surface area of detected particles is converted to equivalent diameter and plotted over time. The plot plot_photogranulation_quantification.pdf can be reproduced by running the R script using results_marker.csv, results_scanner_images.csv, image_acquisition.txt and experimental_conditions.txt as input. The decrease in equivalent diameter per sample is a measure for the progression of photogranulation. Sludge 2 contracted better than sludge 1, resulting in a smaller average diameter. Biomass did not contract well in all 36 replicates per sludge source, hence the large standard deviations around the mean diameters. There is no data available between 354 and 472 hours due to a technical issue. References<br> Legland, D.; Arganda-Carreras, I. and Andrey, P. (2016). MorphoLibJ: integrated library and plugins for mathematical morphology with ImageJ. Bioinformatics 32(22): 3532-3534.<br> R Core Team (2019). R: A language and environment for statistical computing. R Found. Stat Comput, Vienna, Austria.<br> Schneider, C.A., Rasband, W.S.andEliceiri, K.W (2012). ImageJ. Fundam Digit Imaging Med 9(7), 185–188.<br> Wickham, H. (2011). The Split-Apply-Combine Strategy for Data Analysis. J Stat Software 40(1), 1-29.<br> Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York.
description: This work was supported by the French National Research Agency (ANR, grant ANR-16-CE04-0001).