Get started

There are three ways to use Patchview

Stand-along App

If your operating system is Windows 10, PatchView has a prepackaged app using Pyinstaller. You can download the zip file from its Github releases page. After unzipped it into a folder, you can directly double click the executable file, PatchView.exe, to start the app. No python installation is needed.

To remove the app, just delete the whole folder.

Note

  • It takes about 15 ~ 30 seconds when you run the programme the first time, as compressed libraries needs to be unzipped. It should be much faster for following runs.

  • since Pyinstaller is cross-platform, it is possible to package PatchView for other platform, Mac or Linux. We have not tried these options yet. Contributions are welcome!

Pip install

To install PatchView via pip, We recommend creating a virtual python environment first. If you don’t have pip installed, this Python installation guide can guide you through the process.

If you use conda, you can do this by:

$  conda create -n patchview python=3.10

Note: PatchView requires Python>=3.10

After activating your virtual environment, run this command in your terminal:

$ pip install git+https://github.com/ZeitgeberH/NeuroM@patchview#egg=NeuroM git+https://github.com/ZeitgeberH/dictdiffer#egg=dictdiffer git+https://github.com/jeremysanders/pyemf3#egg=pyemf3

$ pip install patchview

This is the preferred method to install PatchView, as it installs script that can launch the GUI program at a command line by type

(patchview) $ patchview

or in a python environment:

>>> import patchview

To launch the GUI, type:

>>> patchview.pvGUI()

Note 1: PatchView use PyQt5 as its front-end. Pip installation may have compatible issue which may cause the following errors when launch the GUI:

qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "". This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

If this happens, please uninstall PyQt5, PyQt5-sip, pyqtwebengine by:

$ pip uninstall pyqt5 pyqt5-qt5 pyqtwebengine-qt5 pyqt5-sip

then reinstall them via:

$ pip install pyqt5 pyqtwebengine pyqt5-sip

If this does not resolve the issue, please open a PatchView’s github issue.

Note 2 Tested platforms: Windows 10, Ubuntu 18.04 LTS, Mac Catalina. Due to Qt requriment, it won’t work under WSL2 in Windows 10. With enhanced GUI support on WSL2 in Windows 11, it may work (but not tested yet)

MacOS user: Please make sure you have cairo installed. You can install it via brew:

$ brew install cairo pkg-config

From sources

The sources for PatchView can be downloadeded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/zeitgeberH/patchview

Or download the tarball:

$ curl  -OL https://github.com/zeitgeberH/patchview/tarball/master

Once you have a copy of the source, use Conda to create an virtual environment:

$ conda env create -f environment.yml

then activate the environment and run:

$ conda activate patchviewPy3

The following three packages should be installed from their github repo:

$ pip install git+https://github.com/ZeitgeberH/NeuroM@patchview#egg=NeuroM

$ pip install git+https://github.com/ZeitgeberH/dictdiffer#egg=dictdiffer

$ pip install git+https://github.com/jeremysanders/pyemf3#egg=pyemf3

Finally,

$ pip install -r requirement.txt ## install requirement

$ pip install -e .

Configuration

PatchView use a Yaml file for its basic configuration.

  • If you use the app version, it is located in the patchview\Data\patchview.yaml of the app folder.

  • If you install it via Pip or from source, it is located in user_config_dir generated by appdirs,

    For Windows: it is ‘C:\Users\YOUR-USER-NAME\AppData\Local\Patchview\Patchview’.

    For Linux: it is ‘/home/YOUR-USER-NAME/.config/Patchview’

Open patchview.yaml with any text editor.

  • RootDir is the root directory set for PatchView to list files. Leave it empty (‘’) if you want to include all drives in computer.

  • Protocols are labels you used for series during recording. There are four default categories that PatchView uses to sort recorded series. Add any labels in the corresponding category if it is not already in the list.

After saving your changes, close the app and restart it.

Test dataset

Test dataset can be downloaded from Patchview’s Github repo, under tests/data folder (You can set RootDir to that folder for easy browsing).

Epy. recordings:

test.abf: a whole-cell recording session in Axon binary file format (ABF).

test_singleFP.dat: Ephy. recordings with one firing pattern session

test_couplingRatio.dat: Ephy. recordings with eight patched neurons.

test_FP_Spon.dat: Ephy. recordings with firing pattern, EPSP, EPSC recordings. This can be used to test the automatic sorting functionality of patchview

connection_tests: In this folder, there are eight files from a series of multi-patching experiments in which eight neurons were patched and recorded simultaneously. In each experiment, one of the neurons was simulated and the rest were recorded in current clamped mode. This is a protocol for testing synaptic connections between those neurons.

Morphology:

test.ASC: a morphology file in neurolucida format. It contains reconstruction of an interneuron in hippcampus.

test_multiSoma.ASC: a morphology file in neurolucida format. It contains reconstruction of multiple neurons from a single brain slice.

NWB file:

test.nwb: a recording file in neurodata-without-borders format.

Tests

Run pytest in the tests folder

$ python -m pytest .