Skip to content

Neuroprosthetics-Lab/srinivasan-speech-modes

Repository files navigation

srinivasan-speech-modes

This repository houses codes related to analyzing intracortical neural activity of speech modes and loudness.

Installation

Requirements: Code has been tested in Python 3.9. Clone the repository and install required libraries.

You can create a conda environment to run the plotting_scripts as follows:

conda create -n speech-modes python=3.9
conda activate speech-modes
pip install -r plotting_requirements.txt

Install other requirements if you want to run the analyses_scripts as follows:

pip install -r analyses_requirements.txt

Generating manuscript results

To generate the results and plots we have reported in the manuscript, you can run the codes in the folder plotting_scripts. The python scripts in the folder read the results we obtained by analyzing the data and generate plots. The folder plotting_data has the results we obtained (such as classification accuracies, firing rates etc.) obtained by analyzing the data as .pkl files (Source Data for manuscript figures). The folder plotting_figures has the figures generated by running the scripts in plotting_scripts and is reported in the manuscript.

Each script in the plotting_scripts folder has an example run command specified at the top which can be used to generate the results/figures for each participant.

Scripts to run for:

  1. Fig. 1, Supp. Fig. 1-3; psths: psth.py
  2. Fig. 1, Supp. Fig.2; significant channels tuned to loudness or words: ch_encoding.py
  3. Fig. 2, Supp. Fig. 5; PCA: pca.py
  4. Fig. 2, Supp. Fig. 5; dPCA: dpca.py
  5. Supp. Fig. 4; spike-sorted single-unit analysis: single_unit_psth_tuning.py
  6. Fig. 3, Supp. Fig. 7-8; open-loop classification performance: ol_classification.py, ol_striding_classification.py
  7. Supp. Fig. 6; breath and speech analyses: speech_breath_analyses.py
  8. Supp. Fig. 9; classification using dPCA projections: dpca_classification.py
  9. Supp. Fig. 10; speech duration: speech_duration.py

Running analyses

To analyze the neural data (firing rate activity, pca, loudness classification, etc.), you can run the codes in the folder analyses_scripts. Please download the data from Dryad (https://datadryad.org/dataset/doi:10.5061/dryad.2547d7x5w), unzip them, and place the unzipped folders in a data directory within this repo. Each script in analyses_scripts folder has an example run command specified at the top which can be used to execute the script.

Scripts (or notebooks) to run for:

  1. Fig. 1, Supp. Fig. 1-3; psths: psth.py
  2. Fig. 1, Supp. Fig.2; significant channels tuned to loudness or words: ch_encoding_loudness.py, ch_encoding_word.py
  3. Fig. 2, Supp. Fig. 5; PCA: t15_pca_electrodes.ipynb, t16_pca_electrodes.ipynb
  4. Fig. 2, Supp. Fig. 5; dPCA: use Kobak et al. dPCA implementation in MATLAB (not included in this repo)
  5. Fig. 3, Supp. Fig. 7-8; open-loop classification performance: ol_classification.py, ol_striding_classification.py
  6. Supp. Fig. 9; speech duration: speech_duration.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors