Preparing the Pecking Test - theunissenlab/lab-documentation GitHub Wiki
Jump straight to Troubleshooting if something's broken and you are trying to fix it. Detailed notes of the setup and configuration of the pecking test in NAF 125 is here.
These instructions are for preparing for a new pecking test experiment. For day to day operation of a pecking test, go to Running the Pecking Tests
-
Make sure the operant boxes are clean, have water, and the box lights and fans work. Check that the perches in front of the pecking buttons are securely fastened.
-
Make sure that each box running the preference tests has a microphone plugged in and hooked up to the Behringer audio interface.
Prepare stimulus files using MATLAB
Do the following on your workstation (currently MATLAB is not installed in 125. TODO to prepare 125 with stim preparation tooling).
-
Acquire MATLAB code in this github project. The file is
Stim_CreaterFET.m
. We'll update this to python... someday. (TODO: also, run apply_filt first?) -
Record and cut the audio into one call per wav file (make sure the wav file is 1 channel)
-
Create two folders, one called
XXXX_raw
and one calledXXXX_out
(You can replace XXXX with whatever) -
In the
XXXX_raw
folder, add the wav files recorded, name them[BIRDNAME]_DC_0.wav
-
In line 46, change the filename template to use DC or SO or whatever prefix you want.
-
Edit the input directory to point to the
XXXX_raw
folder and the output directory toXXXX_out
-
Edit how long you want the stim files to be and how many renditions to scatter throughout each one.
-
Run.
-
TODO: this is out of date for the new computer. Upload the files you made in
XXXX_out
to a new stimulus directory on pumpkin's google drive stimulus folder and chubbyninja's folder too. Make sure your new directory has a unique name! These will be synced automagically to those computers. -
For preference test stimuli (possibly unique per bird), you should create a folder with the subject name under
/data/pecking_test/stimuli/preference/
containing the wav files you want to use for playbacks.
On the Dell Optiplex computer:
-
Open the yaml files
/home/fet/configs/Box*.yaml
. The shortcut command to open the yaml files ispecking-test edit-config
. -
Set the experiment parameters. The important ones are "subject_name", and the stimuli paths. TODO: fill this in
-
Test that the boxes work by running the diagnostics script:
pecking-test diagnostics
. This runs a check that the components are found and working. Part of the diganostics check that the sound is working, the button is working, and the microphones are working. These need to be verified manually but the diagnostics script should guide you. If there are any errors they should be resolved before starting the experiment.
We have USB webcams in each of the boxes that are automatically detected by serial num. and mapped to devices /dev/video$BOX
. We are now using VLC for viewing the webcams.
Open a new terminal and run the command pecking-test webcam
, or if you only want to open the webcam for a single box, use pecking-test webcam -b BOX
. Box 3 is a slightly different brand webcam and you are most likely to have problems with that one. If you do, usually unplugging the webcam and plugging it back in will work after a while.
-
On the day before the first session, you need to fast the subjects see AUP for how long in advance this should be done.
-
Acquire a yellow OLAC cage card for each cage that will need to be fasted.
-
Remove the feeder(s) from the cage(s). Dump out any excess seed in the bottom tray of the cage(s).
-
Initial and date the back of the yellow card, and place it on the cage to notify OLAC that the cage should not receive food.
The shaping procedure originally developed by Julie works quite nicely and takes about 1-2 weeks. Nearly every subject will successfully learn the task (though we've seen that males seem to be slower to explore at the beginning). The original documentation is on Google Drive.
- Make sure some seeds are taped on the button
- Place a pinch of seeds around feeder opening
- Start
ipython
on each chamber terminal and initialize the communication with the box. (Note that when writing code, # acts as a comment sign which means that whatever follows it is not read by the program). A shortcut to doing this ispecking-test shell -b 2|3|5|6
, which will open the ipython shell with the chosen box pre-imported.
In [1]: from pyoperant.tlab.local_tlab import PANELS
In [2]: box5 = PANELS["5"]
- Bring the pecking test cage into room 125. Turn off the room lights and weigh the bird. Bird should not lose more than 10% of their beginning weight! (from first day of fasting)
- Place the bird in operant chamber (don’t forget to weigh them before)
- Put the feeder up using python command
In [3]: box5.feeder.up()
- Let bird acclimate and explore, monitoring their visits to the feeder
- As soon as the bird start to eat, set up the timer so the feeder would go down after 30s
In [4]: box5.feeder.feed(30)
- Feed the bird that way 3 to 5 times waiting 1-2 min minimum between each feed
- Once the bird got that association, quit python (
quit()
) and run a regular shaping test with the reward stimulus set at 100% (edit the yaml file). We now want the bird to come and peck on the bright key and hear the sound each time it pecks and get access to the feeder. - Once the bird fed by itself 5-10 times then, introduce the non rewarded stimulus by changing the weight on the yaml file to 20% of unrewarded stim (80% rewarded).
- Once the bird fed itself for 5-10 times increase the percentage of unrewarded stim to 50% (50% rewarded)
- Once it fed for 5 times, increase the percentage of unrewarded stim to 80% (20% rewarded).
- At this point we want a test where the subject is significantly interrupting nonrewarded stimuli compare to the reward. Use
pecking_test data
or check the Jupyter notebook to find out. When that test is significant, we can move forward!