See here: https://github.com/CollepardoLab/Minimal_Chromatin/blob/main/contacts.py and here: https://github.com/CollepardoLab/lammps_dna/blob/master/setup_scripts/MINIMAL_RECIPES/LLPS/uniform_run_from_most_populated/analysis_esmae.py
See here: https://github.com/CollepardoLab/Minimal_Chromatin/blob/main/contacts.py
and here: https://github.com/CollepardoLab/lammps_dna/blob/master/setup_scripts/MINIMAL_RECIPES/LLPS/uniform_run_from_most_populated/analysis_esmae.py