Skip to content

A repository containing additional tools for the curation of neurophysiological data using phy (https://github.com/cortex-lab/phy). Also contains a modified version of phy for use with these plugins.

Notifications You must be signed in to change notification settings

mswallac/phytools

Repository files navigation

phytools

Repository containing modified cortex-lab/phy clone and additional scripts

Installation/Configuration of phy and phytools

  1. Download https://github.com/mswallac/phytools/blob/master/phytools.zip
  2. Extract this file to a stable directory (this is where your installation of phy will 'live')

To install Anaconda:

  1. Download Anaconda here: https://docs.conda.io/en/latest/miniconda.html
  2. Launch the executable and follow the installation process
  3. Launch Anaconda Prompt

In Anaconda prompt run the following commands:

  1. conda create -n phy2 python=3.7 pip numpy matplotlib scipy scikit-learn h5py pyqt cython pillow -y
  2. conda activate phy2
  3. cd path/to/phytools/phy
  4. pip install -e .
  5. cd ../phylib
  6. pip install -e .

Done!

Next, you'll want to navigate to your data directory (containing params.py), and run: phy template-gui params.py

To use splitter/outlier rejection modules:

  • Make sure the IPythonView is open in phy!
  • Hit 'A' at least once for splitter to work.
  • Shortcut key bindings in phy are as follows:
  1. Outlier rejection plugin (single cluster only)
  2. Splitter plugin (single cluster only)

To enable EventView:

  1. Place event_view.py in C:/Users/(Your Username)/.phy/plugins.
  2. Edit C:/Users/(Your Username)/.phy/phy_config.py and add 'EventPlugin' to c.TemplateGUI.plugins like so: c.TemplateGUI.plugins = ['EventPlugin'] or c.TemplateGUI.plugins = ['EventPlugin','CCPlugin'] for multiple plugins

For more details on using plugins: https://github.com/cortex-lab/phy/blob/dev/docs/plugins.md

Running Phy:

Data directory:

To generate a data directory to use with phy one may use:

  1. Kilosort output
  2. JRClust export

Either of these options should produce a bunch of .npy files (x16). You could also add events.csv to enable eventView. params.py should also have been generated using either option. phy.txt is a log file and may also be there.

To launch Phy:

First, launch the Anaconda prompt.

Next, enter the following commands in the Anaconda prompt:

  1. cd C:/path/to/params.py
  2. conda activate phy2 (or whatever the environment name is)
  3. phy template-gui params.py

Additional Information:

Example params.py:

dat_path = [r'D:\dl59\20181207\dl59_g0_t100.imec.ap.bin_concat.bin']

n_channels_dat = 385

dtype = 'int16'

offset = 0

sample_rate = 30000.

hp_filtered = False

About

A repository containing additional tools for the curation of neurophysiological data using phy (https://github.com/cortex-lab/phy). Also contains a modified version of phy for use with these plugins.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages