TITLE: Pavlovian Conditioned Approach
AUTHORS: lukehann, cpking, Paul Meyer

[DESCRIPTION]
Through their association with rewards, reward associated stimuli “cues” can acquire incentive motivational properties (aka incentive value), and thus the ability to attract, reinforce, and motivate behavior (Robinson and Berridge 1993; Robinson et al. 2013). However, there are substantial individual differences in the ability of cues to acquire this incentive value. Through the use of a Pavlovian Conditioned Approach (PavCA) paradigm, we have identified subgroups of individuals that differentially attribute incentive value to a food cue. Below, we describe the construction of the PavCA apparatus using modular hardware purchased from Med-Associates, and the procedures used to identify subgroups with high, medium, or low tendencies to attribute incentive value to a food cue (“sign-trackers”, “intermediates”, and “goal-trackers”, respectively.)

OpenBehavior Link (contains info about chamber construction):
https://edspace.american.edu/openbehavior/project/pavca/

GitHub Link (contains all necessary programs):
https://github.com/MeyerLabScience/Pavlovian-Conditioned-Approach

More info on PavCA:
Meyer et al. (2012)
King et al. (2021)

[BEFORE_START]
Prior to beginning any pre-training or experimentation, allow any subjects at least 14 days to habituate to their home cages. Within this period, we give all subjects ad-lib food and water. Additionally, provide a reverse day/night cycle during this habituation to ensure maximum efficiency during testing.

[GUIDELINES]
All programs used during this procedure can be found on the linked GitHub folder. The custom-built chamber's description can be found in the linked OpenBehavior article, which contains a PDF with all specifications.

All conditioning chambers are tested daily to ensure that the equipment is functional.

[STEPS]
SECTION: Reward Habituation
1. Give each subject ~25 banana flavored pellets/day in their home cage for the 2 days preceding the start of the Pre-training.
SECTION: Pre-Training
2. Pre-training consists of a single, ~17.5 minute session (time varies between banana pellets on a VI-30s schedule).
SECTION: Pre-Training
3. Prior to testing, download the .txt file named "PavCA Pre-training.txt" from GitHub and create a program within MED-PC V. Copy the text in this file into the program. Save and compile this program.
SECTION: Pre-Training
4. Go to the computer that operates the conditioning chambers, and ensure PavCA Pre-Training is compiled in Trans. Then, open Med-PC-V (or Med-PC IV for older testing setups).
SECTION: Pre-Training
4.1. Select "Sessions" in the upper left corner, and then "Load Box" (Or press Ctrl + O). A "Load Box" window broken down into 9 columns should appear.

SECTION: Pre-Training
4.2. For all boxes that will contain subjects to pre-train, go to the "Procedure" column, click on the unit that aligns with the desired "Box" # (Chamber #), and select the program containing the aforementioned "PavCA Pretraining.txt" text.
SECTION: Pre-Training
4.3. Select "Ok" at the bottom right of the "Load Box" window.
SECTION: Pre-Training
5. Remove subject from their home cage and place in transportation cart.
SECTION: Pre-Training
6. Transport the rats to the testing room.
SECTION: Pre-Training
7. Place subjects into their assigned testing chambers.
SECTION: Pre-Training
7.1. Ensure both the operant chamber's door and the sound attenuating chamber's door are fully closed.
SECTION: Pre-Training
8. At this point the subjects are prepared to begin, and the program is ready to run. Select the traffic light icon at the top of the MED-PC V window. A pop-up window named "Send Signals to Boxes" will appear.
SECTION: Pre-Training
8.1. Select all boxes that contain subjects, select "Start Command" or "Start" and press "Issue" at the bottom right hand of the "Send Signals to Boxes" window.
SECTION: Pre-Training
9. The subjects are now undergoing the pre-training procedure. 
Description: Within this session the subjects are afforded 5 minutes in the chamber to familiarize themselves, during which the red house-light is off. After this, the light turns on signaling the start to the pre-training period. Throughout this period, the rats are delivered 25 banana-flavored pellets on a 1-30s variable interval (VI) into the food cup. This ensures that they are familiar with the location at which the reward is delivered, along with the general auditory experience they should expect while in the chamber. There are no cues (levers) provided during this session.
SECTION: Pre-Training
10. After the session is done, ensure that within the "Box Status" section the "Progress" column lists all of the boxes/chambers as "Closed".
SECTION: Pre-Training
11. Remove all subjects from their testing chambers and place into a transportation cart.

SECTION: Pre-Training
12. Transport subjects back to their home cage room.
SECTION: Pre-Training
13. Place subjects back into their assigned home cages.
SECTION: Pre-Training
14. Before running additional rats in the same chambers, clean all walls and flooring with a 70% ethanol solution. Ensure any droppings are removed as the floor bars are often too close for them to fall through to the catch-tray.
SECTION: Conditioning Sessions
15. The day following pre-training, the conditioning sessions begin. This occurs for 5 consecutive days.
SECTION: Conditioning Sessions
16. Prior to collecting any subjects, download the .txt file named "PavCA Conditioning.txt" from GitHub and create a program within MED-PC V. Copy the text in this file into the program. Save and compile this program.
SECTION: Conditioning Sessions
17. Go to the computer that operates the chambers.
SECTION: Conditioning Sessions
17.1. Select "Sessions" in the upper left corner, and then "Load Box" (Or press Ctrl + O). A "Load Box" window broken down into 9 columns should appear.
SECTION: Conditioning Sessions
17.2. For all boxes containing subjects to pre-train, go to the "Procedure" column, click on the unit that aligns with the desired "Box" # (Chamber #), and select the program containing the aforementioned "PavCA Conditioning.txt" text.
SECTION: Conditioning Sessions
17.3. Select "Ok" at the bottom right of the "Load Box" window
SECTION: Conditioning Sessions
17.4. Return to the computer, and direct your attention to the "Box Status" section of the MED-PC hub. Confirm that all boxes/chambers are listed as "Closed" under the "Progress" column.
SECTION: Conditioning Sessions
18. Remove subjects from home cages and place them in a transportation cart.
SECTION: Conditioning Sessions
19. Transport the rats to the testing room.
SECTION: Conditioning Sessions
20. Place subjects in their assigned testing chambers.
SECTION: Conditioning Sessions
20.1. Ensure both the operant chamber's door and the sound attenuating chamber's door are fully closed.
SECTION: Conditioning Sessions
21. At this point the subjects are prepared to begin, and the program is ready to run. Select the traffic light icon at the top of the MED-PC V window. A pop-up window named "Send Signals to Boxes" will appear.
SECTION: Conditioning Sessions
21.1. Select all boxes that contain subjects, select "Start Command" and press "Issue" at the bottom right hand of the "Send Signals to Boxes" window.
SECTION: Conditioning Sessions
22. The subjects are now undergoing the conditioning procedure. 
Description: After 1 minute in the chamber, the red house light turns on signaling the start of the procedure. From here, 25 banana-flavored pellets were delivered into the food cup on a 30-150s variable interval (VI). For 8 seconds prior to the pellet being delivered a lever is extended and a white LED light located above the lever is illuminated. After these 8 seconds, the lever retracts, the light turns off, and a pellet is distributed into the adjacent food cup. During this session, the number of lever deflections as well as food cup entries (produced when the photo-beam spanning the cup is broken by rats' heads) are collected. The delivery of food pellets occurs independent of the subjects in-chamber behavior.
SECTION: Conditioning Sessions
23. After ensuring all subjects are finished with their session (session time is no longer increasing and the "Box Status" lists them as closed), remove all subjects from their testing chambers and place into a transportation cart.

SECTION: Conditioning Sessions
24. Transport rats to their home cage room.

SECTION: Conditioning Sessions
25. Place subjects back into their assigned home cage.
SECTION: Data Analysis
26. Make sure to download the MPC2XL program sold by Med Associates. This will be used to export the data collected during conditioning to Microsoft Excel for analysis.
SECTION: Data Analysis
26.1. This program requires a specific, unique row profile for each experiment. Download the "PavCA Med Associates Row Profile" .txt file.
SECTION: Data Analysis
27. Make sure to download the MPC2XL program sold by Med Associates. This will be used to export the data collected during conditioning to Microsoft Excel for analysis.
SECTION: Data Analysis
28. Open the MPC2XL program and a blank Microsoft Excel sheet. 
SECTION: Data Analysis
29. In the "Med-PC to Excel" window, under the "Profile" section, click the "Select" button.
SECTION: Data Analysis
30. Select the previously mentioned "PavCA Med Associates Row Profile" and open the file.
SECTION: Data Analysis
31. Under the "Transfer" section, check the boxes labeled "Column Labels" and "Data" and click the "Transfer!" button.
SECTION: Data Analysis
32. In the "Specify Data Files to Transfer" window that pops-up, navigate to the location where your data is stored and select all data files (no limit) you wish to perform the analysis on.
SECTION: Data Analysis
33. Select the cell that you wish to be the top left data containing cell in your excel sheet. DO NOT DO THIS WITH AN EXCEL SHEET ALREADY CONTAINING DATA AS THE TRANSFER IS IRREVERSIBLE AND ANY DATA OVERWRITTEN CANNOT BE RECOVERED. 
SECTION: Data Analysis
34. In the "Specify Data Files to Transfer" window, select "Done" and all data will be copied into your excel sheet as directed by the row profile.
SECTION: Data Analysis
35. Download the file "PavCA Microsoft Access Data Calculator.accdb" from github and open the file using Microsoft Access.
SECTION: Data Analysis
35.1. IGNORE THE DATA ALREADY IN THE FILE, THIS IS PLACEHOLDER DATA TO MAINTAIN THE CELLS CALCULATIONS.
SECTION: Data Analysis
36. In the left column under the "Unassigned Objects" section, select "PavCA Raw".
SECTION: Data Analysis
37. Go to the tab labeled "External Data" in the tool bar.
SECTION: Data Analysis
37.1. Select "New Data Source" in the top left corner, then select "From File" and finally, select "Excel".
SECTION: Data Analysis
37.2. From here, the program will open a window titled "Get External Data - Excel Spreadsheet" in which you can navigate to  and open the excel sheet created in steps 28 - 34.
SECTION: Data Analysis
37.3. Make sure the option titled "Import the source data into a new table in the current database." is selected before clicking "OK".
SECTION: Data Analysis
38. A window titled "Import Spreadsheet Wizard" will open.
SECTION: Data Analysis
38.1. Make sure the box labelled "First Row Contains Column Headings" is checked, then select "Next >."
SECTION: Data Analysis
38.2. Select "Next >" on the following section.
SECTION: Data Analysis
38.3. Make sure the point labelled "Let access add primary key" is selected in blue, then click "Next >."
SECTION: Data Analysis
38.4. Name the file and select "Finish."
SECTION: Data Analysis
39. You should now see a second unassigned object underneath "PavCA Raw" with the title given in step 38.4.
SECTION: Data Analysis
40. Open both unassigned objects (you will see them in the tabs below the tool bar if they are both open).
SECTION: Data Analysis
41. Right click the "PavCA Raw" tab and select "Design View".
SECTION: Data Analysis
41.1. This will show each column in the sheet and the type of value contained.
SECTION: Data Analysis
42. Scroll to the bottom of the "PavCA Raw" data in design mode.
SECTION: Data Analysis
43. Using the black squares located to the left of the column, select all rows from "Lever Press Probability" to "PavCA Index" and copy. (All of these rows' data type should be listed as "Calculated")
SECTION: Data Analysis
44. Switch to the tab containing the desired collected data imported from Excel. Right-click on the tab and select design mode.
SECTION: Data Analysis
45. Scroll to the bottom of the data and paste the copied lines at the bottom of the data.
SECTION: Data Analysis
46. Right-click on the tab containing your data and select "Datasheet View"
SECTION: Data Analysis
46.1. Make sure to save the changes when prompted or else no values will be calculated.
SECTION: Data Analysis
47. Now, you have calculated a PavCA index which can be found at the end of the dataset.
SECTION: Data Analysis
48. From here, in the "Unassigned Objects" column, right-click the data set just created, and select export to export the data into the desired form (multiple options).