Skip to content

Code used to simulate bacterial biofilms and process data outputted by an agent-based simulation.

License

Notifications You must be signed in to change notification settings

harrylipscomb/The-Effect-of-Geometry-on-Modelling-Electrical-Signals-in-Biofilms

Repository files navigation

The-Effect-of-Geometry-on-Modelling-Electrical-Signals-in-Biofilms

Code used to simulate bacterial biofilms using an agent-based model in Java and process the data from this using Python scripts. Please note, I (Harry Lipscomb) completed this project with Emily Gillott. The Java code is always a form of modification to the original code, written by Victor Carneiro Da Cunha Martorelli and all Python code was produced by the two of us. Significant contributions during the project also came from our supervisor, Dr Thomas Waigh, and Emmanuel Akabuogu. Below is a brief description of each document.

'DSA_generator_and_box_counting.py': Python code used to generate undulating surfaces using the diamond-square algorithm (DSA). A box-counting method is then used to determine the fractal dimension of the surfaces generated. Fractal dimension, surface roughness (a parameter used within the DSA), root-mean square of the bacteria heights and kurtosis are all plotted together.

'Harry Lipscomb MPhys Report.pdf': My final masters report following 1 semester of research. This includes an introduction to the field with motivations for the study, the theory behind the project and signalling within bacterial biofilms, an overview of the computational setup during the investigation and a discussion of the results found with a full reference list and appendix to conclude.

'Menger_shapes.py': Python code used to generate arrays of values to be used within our Java simulation. This forms [x, y, z] coordinates of Menger sponges of a given dimensionality and size where the 3D Menger sponge can be made to have holes in either one or 3 orthogonal directions.

'simulation_cross_section_of_data.java': Java script used within the bsim 2.0. environment where the class 'BSimChemicalField' is modified. In this environment, stationary bacteria follow a fire-diffuse-fire model in which a bacteria will 'fire' a specific concentration of chemical into the surrounding space if the concentration at that bacterias position reaches some threshold value. The term fire-diffuse-fire model is used here as a spatially propagating wave can be generated through a bacteria biofilm if one bacteria is initially fired. This causes the consequential firing of adjacent bacteria (if specific conditions are met e.g. bacteria density) and hence a wave. Within this file, a cross section of concentrations is written to an Excel file at discrete time intervals. This was then visualised using Python to see a propagating wave across our simulation in video form. Here, a cuboidal biofilm with a cuboidal hole in its center is generated.

'simulation_points_from_csv.java': Java script used to read in a .csv file of bacteria positions and generate these within the fire-diffuse-fire model. This was used in conjunction with the Menger and DSA bacteria positions generated by the above Python code.

'simulation_random_points.java': Based Java script written by Victor to simulate bacterial biofilms. This is included to demonstrate the initial code given to Emily and I (where the only modification we have made is in adding a central hole to the cuboidal biofilm).

'wavefront_finder.py': Basic code formed with the function of plotting wave position against time. Here, the instantaneous position of the wavefront is found using a defined threshold to convert an array of concentrations (within a radius) to a binary '1' (standing for the wavefront has passed this point) or a 0 if the wavefront is yet to reach this radius. Once a 1 has been achieved, only the next radius is considered etc. The consequenting wave is then fitted with uncertainties a best-fit line (with corresponding parameters) is generated.

About

Code used to simulate bacterial biofilms and process data outputted by an agent-based simulation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published