Instructions on how to run the code to reproduce results from the paper
"From movement to cognitive maps: recurrent neural networks reveal
how locomotor development shapes hippocampal spatial coding"

The code has never been tested on Windows machines! On Linux and Macos
should run just fine.

The code is supposed to be run from the folder "/home/USER/vr_to_pc" on
Linux or "/Users/USER/vr_to_pc" on Macos. If that's not possible change the
BASE_DIR variable before running the scripts.
All notebooks contain output so you can go through the output without
having to run the code yourself.

Simulated data is available at

https://zenodo.org/records/15496128

You can download it and place it in the directory "/media/data/vrtopc" or
change the DATA_DIR variable before running scripts.

Then, you need to install Python and Conda, to create a new
environment with

conda env create -f environment.yml

Now you are ready to go through the code. See below for specific information
about the different parts of the code.


CLUSTERING ANALYSIS

The clustering analysis and associated trajectory simulations are in the
folders "real_data_exploration/group_behaviours" and "simulation", respectively.

To completely run this, you would need the experimental data, which is
not released with our work. I already ran the notebooks and
one can go through the outputs I previously generated. Notebooks are
numbered based on the order in which they were run, from _1 to _4.

Once the clustering was done, the configurations file "simulation/config.yaml"
was populated with the parameters of each locomotion stage. Simulations
can be run with the "run_multiple_simulations.sh" Bash script.
Depending on how many locomotion stages are simulated, this might take
from an hour to multiple hours. To run this one needs a portable
installation of Blender in the home directory
(such as "/home/USER/blender-3.6.19-linux-x64"), we used
Blender 3.6.19.


RECURRENT NEURAL NETWORK

All information about the RNN can be found in the "architectures" folder.
RNNs can be trained and the hidden units activity can be analysed and saved
running the "RNN_experiment.py" script. The Bash
script "run_paper_training.sh" contains the commands used to reproduce the
results of the paper.


FIGURES

Figures were generated with notebooks in the format "generate_figureX".
Except for Figure 1, which was generated during the clustering analysis.


LIKELIHOOD TESTS

These are found in the generate_likelihood* notebooks.


STATISTICAL TESTS

Some statistical tests were run through R for convenience, they
can be found in the "R_stats" folder.
