Figshare+
Browse
1/1
5 files

Python code used for analyses in paper 'Disruption of awake sharp-wave ripples have no effect on the immediate behaviour nor create short-lasting memories'.

software
posted on 2024-04-09, 19:23 authored by Lies DeceuninckLies Deceuninck, Fabian Kloosterman

This project investigates the contribution of awake sharp-wave ripples (aswrs) to short-term memory (stm) using closed-loop electrical disruption of aswrs. For all the details about the behavioural tasks and method of recording we refer to our paper. This item is a software package that contains all the python code that was used to analyse the raw data and is necessary to create the publication figures.

1 Setup a conda environment

Because the code requires several packages that are not standard included in Python, we recommand creating a specific a conda environment.

  • If you don't have conda installed, download it from here
  • download all files in this item, unpack everything and put them in a folder named 'Project_ASWR'.
  • create conda environment by running the following commands in your terminal

`cd /path/to/Project_ASWR`

`conda env create -f fkbase.yaml --name fkbase`


  • Install fklab tools by running in the terminal

`conda activate fkbase`


`cd /path/to/Project_ASWR`

`python setup.py build_ext --inplace`

`pip install -e . --no-deps`


`cd /path/to/Project_ASWR/analyses/scr/fklab-python-core`

`python setup.py build_ext --inplace`

`pip install -e . --no-deps`


`cd ../fklab-python-internal`

`python setup.py build_ext --inplace`

`pip install -e . --no-deps`

2 Download the raw data

The analyses scripts (in the analyses folder) analyse our raw data. So first make sure that you have downloaded the raw data from here.

  • download all raw data folders in the ite,
  • Create a folder 'Project_ASWR/data/raw' and add all the animal folders to it (no subfolders per task).
  • Create an empty folder 'Project_ASWR/data/cache'
  • Create an empty folder 'Project_ASWR/data/analysis'
  • Create an empty folder 'Project_ASWR/data/summary'

3 Setup an analysis context

To run the analyses you first need to set up an analysis context. This will allow you to create a context python object that will handle reading the correct data and saving the results in the right format in the right place.

First, open the context_setup.py file and fill in the project path. This has to be the absolute path to the Project_ASWR folder. Next, you can set the context up by running the following commands in your terminal.

`conda activate fkbase`

`cd /path/to/Project_ASWR`

`python context_setup.py`

When the analysis context is set up, no need to re-run this again because this script will save the path of you analysis folder to .config/Project_ASWR.analysis.

3 Run analyses on the raw data

To run an analysis on a set of sessions you can run the run_analyses.py file. First run it with the -h flag so that you get to know its usage and get more info on which arguments you can pass. With those arguments you can specify which task you want to analyse, or which analysis specifcially you want to run. You can also specify the session and even the epoch. You will always have to provide the root path to the project folder (--path path/to/Project_ASWR)

`cd /path/to/Project_ASWR`

`python run_analyses.py --h`

All the results from the analyses are saved in .hdf5 files.

4 Re-create the summary tables

To re-create the summary tables from the analyses results in the data/analysis folder you can use the following commands. First run it with the -h flag so that you get to know its usage and get more info on which arguments you can pass. You will always have to provide the root path to the project folder (--path path/to/Project_ASWR)

`conda activate fkbase`

`cd /path/to/Project_ASWR/`

`cd analyses/summarize`

`python generate_summary_tables.py -h`

Note: In order for data from a session to be added to the summary table you have run all analyses on that session.

See related materials in Collection at: https://doi.org/10.25452/figshare.plus.c.6835236


Funding

Remember what to do: the contribution of hippocampal activity to short-term memory

Research Foundation - Flanders

Find out more...

Connecting past and future: the contribution of hippocampal memory reactivate during wakefulness to learning behavior

Research Foundation - Flanders

Find out more...

History

Research Institution(s)

KU Leuven, NERF-NeuroElectronics Research Flanders, VIB, Imec

I confirm there is no human personally identifiable information in the files or description shared

  • Yes

I confirm the files and description shared may be publicly distributed under the license selected

  • Yes

Competing Interest Statement

The authors declare no competing interests.

Usage metrics

    Figshare+

    Licence

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC