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

1 Preparing for an experiment

Preparing boxes

  • 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.

Preparing stimulus files

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).

  1. 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?)

  2. Record and cut the audio into one call per wav file (make sure the wav file is 1 channel)

  3. Create two folders, one called XXXX_raw and one called XXXX_out (You can replace XXXX with whatever)

  4. In the XXXX_raw folder, add the wav files recorded, name them [BIRDNAME]_DC_0.wav

  5. In line 46, change the filename template to use DC or SO or whatever prefix you want.

  6. Edit the input directory to point to the XXXX_raw folder and the output directory to XXXX_out

  7. Edit how long you want the stim files to be and how many renditions to scatter throughout each one.

  8. Run.

  9. 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.

  10. 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.

Testing components

On the Dell Optiplex computer:

  • Open the yaml files /home/fet/configs/Box*.yaml. The shortcut command to open the yaml files is pecking-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.

Check webcams

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.

2 Preparing the subjects

Fasting the subjects

  • 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.

Shaping (initial training of birds on the task)

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.

  1. Make sure some seeds are taped on the button
  2. Place a pinch of seeds around feeder opening
  3. 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 is pecking-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"]
  1. 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)
  2. Place the bird in operant chamber (don’t forget to weigh them before)
  3. Put the feeder up using python command
In [3]: box5.feeder.up()
  1. Let bird acclimate and explore, monitoring their visits to the feeder
  2. 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)
  1. Feed the bird that way 3 to 5 times waiting 1-2 min minimum between each feed
  2. 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.
  3. 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).
  4. Once the bird fed itself for 5-10 times increase the percentage of unrewarded stim to 50% (50% rewarded)
  5. Once it fed for 5 times, increase the percentage of unrewarded stim to 80% (20% rewarded).
  6. 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!
⚠️ **GitHub.com Fallback** ⚠️