This guide is a modified version of PyBpod's Installation Guide specific to the Poirazi Lab's Mouse2AFC protocol. For more detail on what PyBpod is and how to use other features please see their wiki here.
Do steps 1-3 from Installation for Developers
NOTE: If using Windows 11:
- Before executing step 2 of the Installation for Developers, open the Windows 10 yml file and delete
sqlite=3.19.3=vc14_1
,jpeg=9b=vc14_2
,qt=5.6.2=vc14_1
,matplotlib=2.0.2=np113py36_0
andtk=8.5.18=vc14_0
- After activating the environment in step 3 of the Installatin for Developers:
conda install jpeg=9b qt=5.6.2 matplotlib=2.0.2 tk --channel conda-forge --channel anaconda --channel defaults
conda env list
yields
# conda environments:
#
base /...
pybpod-environment */...
with the asterik *
next to pybpod-environment
pip --version
yeilds
pip 9.0.1 from /home/user/anaconda3/envs/pybpod-environment/lib/python3.6/site-packages/pip (python 3.6)
pip 18.1 from C:\Users\user\miniconda3\envs\pybpod-environment\lib\site-packages\pip (python 3.6)
pip install --upgrade pip
git clone --recurse-submodules -j8 https://github.com/ckarageorgkaneen/pybpod <REPONAME>
Change<REPONAME>
to whatever you like. The repository will be cloned into a new folder called <REPONAME>
cd <REPONAME>
python utils/install.py # may take a few minutes
Clone outside of <REPONAME>
git clone https://github.com/HenryJFlynn/mouse2afc.git mouse2afc
cd mouse2afc
pip install -e .
cd <REPONAME>
python -c 'import pybpodgui_plugin.__main__ as Main; Main.start()'
cd <REPONAME>
python -c "import pybpodgui_plugin.__main__ as Main; Main.start()"
Click Options
then Edit user settings
. Paste the following settings:
SETTINGS_PRIORITY = 0
GENERIC_EDITOR_PLUGINS_LIST = ['pybpodgui_plugin', 'pybpod_gui_plugin_emulator']
PYBPOD_SESSION_PATH = 'PYBPOD_SESSION_PATH'
TARGET_BPOD_FIRMWARE_VERSION = "22"
EMULATOR_BPOD_MACHINE_TYPE = 1
BPOD_BNC_PORTS_ENABLED = [True,True]
BPOD_WIRED_PORTS_ENABLED = [True, True, True, True]
BPOD_BEHAVIOR_PORTS_ENABLED = [True, True, True, False, False, False, False, False]
replace PYBPOD_SESSION_PATH
with the path of the folder you want the session to be saved into. (e.g. Linux: /home/user/Documents/mouse2afc_sessions
, Windows: "C:\\Users\\mouse2afc\\mouse2afc_sessions"
)
Click Save
and close the program.
cd <REPONAME>
python -c 'import pybpodgui_plugin.__main__ as Main; Main.start()'
cd <REPONAME>
python -c "import pybpodgui_plugin.__main__ as Main; Main.start()"
Click Open
and select pybpod-project
located in the mouse2afc
repository folder downloaded previously. Should have something like this:
In the Projects
window, under Users
, double-click on Default-User
to select it
In the Projects
window, go to Bpod boards
, select Default-Box
then in the Details
window select the serial port your Bpod is connected to. For Linux the serial port will look like /dev/tty
, for Windows COM
and click Console
:
In the Projects
window, under Subjects
, click on Default-Subject
. If not already selected, click on the dropdown widget next to Setup
and select the setup you would like this mouse to use:
Similarly, under Default Experiment
, click on Default-Setup
and, if not already selected, select a Board
and Procotol
for the experiment:
In the Subjects
tab, if not already selected, click Add Subject
to select the subject(s) for the experiment:
Click Test Protocol IO
and the following GUI window should pop up:
Click Save
, click Run Protocol
, select the appropriate parameters in the task parameter GUI, click Ok
and the protocol should run. Check the boxes of your choice in the Poke
row to emulate a mouse poking in (checked) and out (unchecked):
When done using, click Stop
or Kill
, and then Save
.
If you wish to test a protocol without connecting to a Bpod:
- Instead of doing step five, check
Emulator mode
- Under
Protocols
, openMouse2AFC_
and edit line 6 to bebpod=Bpod(emulator_mode=True
)
The examples are meant to be run outside of pybpod, inside of your IDE