Skip to content

A concatenation of two GNNs to decode dynamic clustering on localization datasets

License

Notifications You must be signed in to change notification settings

lucasSaavedra123/dynamic_clustering

Repository files navigation

A supervised Graph-based deep learning algorithm to detect and quantify clustered particles

In this repository, all software related with (Saavedra, 2024) can be found.

Installation

During the whole development of the project, we used different machines with different operating systems. Also, some of these have modern GPUs to train. However, some users may not have special hardware and not be allow to run the code. We provide different YML files to run the software on different machines, depending on the available hardware and software. To install this repository, you will need to have Conda installed. YML files descriptions are below:

  • environment-cpu.yml: Install with this file if you don't have GPUs.
  • environment-titan.yml:Install with this file if you use a GPU (this YML worked with TITAN V).
  • environment-m1-2021.yml:Install with this file if you use a Mac M1 2021 which includes a powerful GPU for Deep Learning.

Run the following command:

conda env create -n dynamic_clustering --file SELECTED_YML_FILE

Then, activate the created environment:

conda activate dynamic_clustering

How to simulate

In order to reproduce datasets, please see generate_datasets.py. This script works as an example and it is the script that we used to generated datasets in our work.

We strongly recommend to run the simulations with cythonbuilder. According to our experience, simulations are faster. Run the following commands to cythonize the code:

mv Cluster.py Cluster.pyx
mv Experiment.py Experiment.pyx
mv Particle.py Particle.pyx
mv hypo.py hypo.pyx
mv ImmobilizationProbabilities.py ImmobilizationProbabilities.pyx
mv TrajectoryDisplacementGenerator.py TrajectoryDisplacementGenerator.pyx
mv utils.py utils.pyx

cythonbuilder build

If you want to recover the original files, run the following commands:

mv Cluster.pyx Cluster.py
mv Experiment.pyx Experiment.py
mv Particle.pyx Particle.py
mv hypo.pyx hypo.py
mv ImmobilizationProbabilities.pyx ImmobilizationProbabilities.py
mv TrajectoryDisplacementGenerator.pyx TrajectoryDisplacementGenerator.py
mv utils.pyx utils.py

rm *.so *.pyi
rm -r ./ext

Docker Image for Dynamic Simulations

The proyect was executed on Windows to avoid Linux virtualizations. However, we noticed that these simulation run faster on Linux systems. We used Docker to run simulations and we used the following code to run it:

docker build -t dynamic_simulations .
docker run -i -v dynamic_simulation_files:/usr/src/app/datasets --name simulation_container -t dynamic_simulations bash

Once the shell is open, follow the instructions of the first part.

Then, to retrieve .csv files, run the following command:

docker cp simulation_container:/usr/src/app/datasets/ ./

Cite us

If you use our software or comment it, please cite us:

@article{RN56,
   author = {Saavedra, Lucas Ariel and Mosqueira, Alejo and Barrantes, Francisco José},
   title = {A supervised graph-based deep learning algorithm to detect and quantify clustered particles},
   journal = {Nanoscale},
   ISSN = {2040-3364},
   DOI = {10.1039/D4NR01944J},
   url = {http://dx.doi.org/10.1039/D4NR01944J},
   year = {2024},
   type = {Journal Article}
}

About

A concatenation of two GNNs to decode dynamic clustering on localization datasets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published