Simulation code, model files, and data analysis of results presented in:
Shevtosva NA, Lockhart AB, Rybak IA, Magnuson DSK, Danner SM. Reorganization of spinal neural connectivity following recovery after thoracic spinal cord injury: insights from computational modelling. bioRxiv, 2025.05.17.654682; doi: 10.1101/2025.05.17.654682
pip install -r requirements.txt
Note, CPGNetworkSimulator requires Boost headers. Ensure Boost is installed and in your include path.
python simulate_noise.py -y [path to simulation yaml file]
Use bifurcation_diagrams.ipynb. .
sensitivity_run.py: runs parameter-perturbation simulations.
python [-m scoop -n N_processes] sensitivity_run.py -s [sensitivity_yaml]
analyze_sensitivity.ipynb: loads simulation results, fits surrogate model, performs Sobol analysis.
-
data/df_raw.h5: Raw rat data as table with meta data (from Danner et. al 2023) -
data/df_phases.h5: Table of processed rat data, includes phase differences and other locomotion parameters as well as gait classifcation (from Danner et. al 2023) -
data/df_intact_sim_8s_final.h5: Saved simulation results of pre-injury/intact model -
data/df_hemi_sim_8s_final.h5: Saved simulation results of hemisection injury case -
data/df_contusion_sim_8s_final.h5: Saved simulation results of contusion injury case
-
models/RM_final.txt: Neural network configuration file (for CPGNetworkSimulator) of pre-injury model. Model is based on our previous models or mouse spinal locomotor circuitry (Danner et al. 2017; Zhang et al. 2022). -
models/*.yaml: Simulation configuration files for the various cases [intact/pre-injury, hemisection (including partial manipulations), contusion]. These files specify simulation paramters and patch connection weights and drive parameters of the model config file (RM_final.txt) to simulate injury conditions.
-
sensitivity/*.yaml: Configuration files for the sensitivity analysis. They define parameter-perturbation settings (which parameters to vary, ranges, model setup) and store the computed sensitivity indices produced during analysis. -
sensitivity/*.npz: Saved simulation results from the parameter-perturbation runs (generated bysensitivity_run.pyand loaded byanalyze_sensitivity.ipynbfor surrogate fitting and Sobol analysis).
-
yaml_sim.py: Helper functions to read yaml files and update/modify network parameters. -
classify_gaits.py: Calculates gait classifiction based on phase differences and duty factors -
simulate_noise.py: Main simulation script -
analyze_results.ipynb: Jupyter notebook containing data analysis and presentation of both modelling results and experimental data. Creates most plots included in the paper. -
bifurcation_diagrams.ipynb: Jupyter notebook containing simulation code to run bifurcaton diagrams presented in the paper. -
sensitivity_run.py: sensitivity simulation runner. -
analyze_sensitivity.ipynb: surrogate modeling, Sobol sensitivity analysis, and respective plots.
Data licensed under Creative Commons Attribution-ShareAlike 4.0 International License
Source code licensed under GNU GPL v3
Danner SM, Shepard CT, Hainline C, Shevtosva NA, Rybak IA, Magnuson DSK. Spinal control of locomotion before and after spinal cord injury. Experimental Neurology. 2016;368, 114496. doi: 10.1016/j.expneurol.2023.114496
Danner SM, Shevtsova NA, Frigon A, Rybak IA. Computational modeling of spinal circuits controlling limb coordination and gaits in quadrupeds. eLife. 2017;6:e31050. doi: 10.7554/eLife.31050
Zhang H, Shevtsova NA, Deska-Gauthier D, Mackay C, Dougherty KJ, Danner SM, Zhang Y, Rybak IA. The role of V3 neurons in speed-dependent interlimb coordination during locomotion in mice. eLife. 2022;11:e73424. doi: 10.7554/eLife.73424