Summary This dataset contains calcium imaging data from the posterior parietal cortex (PPC) in mice performing a fixed association navigation task. The raw data consists of images, while the processed data consists of fluorescence transients of individual ROIs and behavioral variables (mouse position, view angle, velocity etc.). The data is from five animals and includes 182 recording sessions. Results from the experiments are described in: Driscoll, L. N., Pettit, N. L., Minderer, M., Chettih, S. N., & Harvey, C. D. (2017). Dynamic reorganization of neuronal activity patterns in parietal cortex. Cell, 170(5), 986-999. Conditions for using the data If you publish any work using the data, please cite the Driscoll et al. (2017), publication above and also cite the data set in the following recommended format: Laura N. Driscoll, Noah L. Pettit, Matthias Minderer, Selmaan N. Chettih, and Christopher D. Harvey (2017); Calcium imaging responses from posterior parietal cortex (PPC) neurons of adult mice performing a fixed association navigation task. CRCNS.org. DOI: 10.1016/j.cell.2017.07.021  Methods Experimental model and subject details Mice All experimental procedures were approved by the Harvard Medical School Institutional Animal Care and Use Committee and were performed in compliance with the Guide for the Care and Use of Laboratory Animals. All data were obtained from five male C57BL/6J mice (Jackson Labs), which were 8-10 weeks old at the start of behavioral training, and 14-32 weeks old during imaging. A surgery was performed on each mouse before training to affix a titanium headplate to the skull using dental cement (Metabond, Parkell). At least one day after headplate implantation, mice began a water schedule, in which they received 800 l of water/day. Mouse health was monitored daily. Mice were given additional water if their weight fell below 80% of their pre-schedule weight (mean ± sem 23.2 ± 0.5 g). Mice were housed in pairs of littermates. Method Details Virtual reality system Virtual reality environments were constructed and operated using MATLAB-based ViRMEn software (Virtual Reality Mouse Engine) (Aronov and Tank, 2014; Harvey et al., 2009). A PicoP microprojector (MicroVision Inc.) projected the virtual environment onto the back side of a 24-inch diameter half cylindrical screen. The virtual environment was updated in response to the mouse’s manipulations of an open cell Styrofoam spherical treadmill (8-inch diameter, ~135 g). An optical sensor positioned beneath the spherical treadmill measured movements in pitch and roll of the ball (relative to the mouse’s body axis). These signals controlled forward/backward and rotational movement in VR, respectively. We recorded the mouse’s position in the virtual environment (x/y position), the rotational speed of the spherical treadmill (about the pitch and roll axes), and the mouse’s view angle in the environment. Behavioral training Mice were on the water schedule for at least five days before behavioral training began. Training sessions were performed daily and lasted 45-60 minutes at roughly the same time of day each day. Rewards (4 L of 10% sweetened condensed milk in water) were delivered through a lick spout. Mice were trained to perform the T-maze task using a program of five mazes. For maze training details see Driscoll et al. 2017. Surgical procedures After mice achieved performance greater than 80% correct on the task for five consecutive days, they received ad lib access to water for three days before the cranial window implant surgery. A circular craniotomy with a diameter of 3.1 mm was made over left PPC (stereotaxic coordinates: 2 mm posterior, 1.7 mm lateral of bregma). Three 10nL injections of a virus mixture containing a 4:1 volumetric ratio of tdTomato (AAV2/1-CAG-tdTomato) to GCaMP6m (AAV2/1-synapsin-1-GCaMP6m) (University of Pennsylvania Vector Core Facility) were made near the center of the craniotomy at a depth of ~275 μm below the dura. Injections were slow (5 min/injection) and continuous (custom air pressure injection system). The pipette (15μm tip diameter) was advanced using a micromanipulator (Sutter MP285) at a 30-degree angle relative to horizontal to minimize compression of the brain. A glass plug consisting of a single 5 mm diameter coverslip on top of two 3 mm diameter coverslips (#1 thickness; CS-5R and CS-3R, Warner Instruments) were combined using UV-curable optically transparent adhesive (Norland Optics) and were affixed to the brain with minimal Kwik-Sil (World Precision Instruments) and affixed to the skull using Metabond on the perimeter of the 5mm coverslip lip. The metabond mixture contained 5% vol/vol India ink, to prevent light contamination from the VR display. Additionally, a titanium ring was mounted on top of the headplate. This ring interfaced with the microscope’s objective lens through a cylinder of black rubber, to prevent light contamination (Dombeck et al., 2010). Mice resumed training after at least one day of recovery. Imaging began at least three weeks post-injection and was continued for up to 8 weeks. On a given day, we imaged 100 - 300 neurons simultaneously during approximately 200 trials (Supplementary Figure S2J). Two-photon imaging Two-photon microscope design Data were collected using a custom-built two-photon microscope. A resonant scanning mirror and galvanometric mirror separated by a scan lens-based relay telescope on the scan head allowed fast scanning. An Olympus 25x 1.05 NA objective lens was mounted on a piezo collar (Physik Instrumente) that allowed slower axial scanning. An aluminum box housed collection optics to block light interference from the VR display. Green and red emission light were separated by a dichroic mirror (580 nm long-pass, Semrock) and bandpass filters (525/50 and 641/75 nm, Semrock) and collected by GaAsP photomultiplier tubes (Hamamastu). A Ti:sapphire laser (Coherent) delivered excitation light at 920 nm with an average power of about 35-70 mW at the sample. The microscope was controlled by ScanImage (version 4; Vidrio Technologies). The spherical treadmill was mounted on an XYZ translation stage (Dover Motion) to position the mouse under the objective. Image acquisition Four imaging planes were acquired by volumetric scanning at 5.3Hz with a resolution of 512 x 512 pixels (500μm x 500μm) for each plane. Planes were separated by 25μm axially between 120 and 250μm below the dura. Imaging was continuous over behavioral sessions lasting 45 minutes to 1 hour. Bleaching of GCaMP6m was negligible over this time. Approximately every 20 minutes, slow drifts of the field of view were manually corrected using comparison to a reference image. The imaging frame clock and an iteration counter in ViRMEn were recorded to synchronize imaging and behavioral data. Chronic imaging One field-of-view was acquired for each of the five mice over a period of 3 to 8 weeks. The same plane was identified on consecutive days using coarse alignment based on superficial blood vessels followed by careful alignment to reference images at various levels of magnification in the red channel (using tdTomato expression). AAV-mediated expression of GCaMP6m provides high signal-to-noise compared to other methods; however, viral expression is known to increase over months which can lead to compromised signal over time, which is correlated with nuclear localization of the indicator (Chen et al., 2013; Tian et al., 2009). For this reason, imaging was discontinued when fields-of-view contained several cells with GCaMP6 in the nucleus, and all cells with nuclear localization were excluded from analysis. These methods are in accordance with other long-term imaging studies (Huber et al., 2012). Event rates of all analyzed cells were stable across time along with other properties of the population activity. Moreover, our ability to model and predict neuronal activity using behavioral features remained consistent throughout the duration of this experiment. For these reasons we have no reason to believe cell health was an issue in this work. Pre-processing of imaging data Within-session processing We developed an approach to identify cell bodies in calcium imaging data that combines automated proposals based on image time series statistics with human supervision to provide an efficient but transparent signal extraction procedure. The approach was implemented as part of a custom MATLAB software pipeline for motion correction, definition of putative cell bodies, and extraction of fluorescence traces (https://github.com/HarveyLab/Acquisition2P_class). Following motion correction using the Lucas-Kanade method (Greenberg and Kerr, 2009), candidate locations containing putative cell bodies were selected manually in the mean intensity image of the acquisition. Fluorescence sources within a square neighborhood (60 μm edge width) around the selected location were then identified automatically based on the correlation structure of the pixel time series. Since the fluorescence time series of pixels belonging to the same source are expected to be highly correlated, sources larger than a single pixel appear in the pairwise pixel time series correlation matrix as clusters with strong within-cluster and weaker across-cluster correlation. Formally, the correlation matrix was considered to represent a weighted undirected graph with one vertex per pixel, connected by edges with weights given by the correlation between the fluorescence time series of the pixels at either end. The optimal segmentation of the graph was then found using an eigenvector-based approximation of the normalized cuts criterion (Shi and Malik, 2000), followed by k-means clustering to obtain a binary mask for each source. This criterion maximizes the fraction of within-segment weights (correlations) over total weights. Using segmentations based on pixel time series correlations prevents the segmentation of inactive cells, even when these cells were visible in the mean image. Fluorescence time series were computed by averaging across all pixels within the binary mask. These source proposals were manually classified into cell bodies, non-cell sources (excluded from further analysis), and background (neuropil), based on their appearance in the mean intensity image and their fluorescence time series. Each putative cell was paired with a background source from the same 60 μm neighborhood. Neuropil contamination was removed from the cell fluorescence time series by subtracting the associated background time series, scaled by a contamination factor. The contamination factor was calculated by regressing the cell fluorescence against the background time series using an iteratively re-weighted least squares algorithm (robustfit in MATLAB) that discounts large deviations from the fitted linear relationship, such as fluorescence transients in the cell. Segmentation and neuropil subtraction were manually verified for each putative cell and adjusted when necessary using a graphical user interface that showed the mean intensity image, current segmentation results, and both raw and background-subtracted fluorescence time series. Manual adjustments of the segmentation were usually made to obtain clean background fluorescence traces absent of distinct sources. Manual adjustments of neuropil subtraction were used to correct for an overestimation bias of the re-weighting procedure when a cell’s activity was highly correlated with the neuropil. In such cases, subtraction was adjusted to the highest level that did not result in visually apparent negative-going transients in the neuropil-subtracted trace. The event rate was estimated using a previously described deconvolution algorithm (Pnevmatikakis et al., 2016) to minimize the impact of indicator kinetics. This method estimates the relative firing rate of each neuron over time but cannot be used to confidently identify single spikes. Across-session processing Binary masks for all fluorescence sources were identified on each day separately and then aligned across days using a semi-automated custom tool. The algorithm ranked cells across imaging days with their most likely matches based on proximity after alignment and anatomical image correlation (a 60μm box around the centroid of the cell). Matches were then verified by eye. This method has advantages over other commonly used approaches. Other approaches often use a single map of ROI masks for all days, such that this map is transformed on each day to best fit that day’s imaging alignment. Slight deviations in the axial plane of the image or other sources of in-plane distortion could lead to slight offsets in masks from day-to-day relative to the ideal alignment. Such slight offsets could result in contamination from activity in other cells, dendrites, and axons. Our approach identifies signal sources on each day and thus avoids any potential contamination from other signal sources. We then align the signal sources identified on each day to those from other days. The only error that could result is in incorrectly calling two signal sources as the same across days. However, to prevent such errors we visually compared the anatomical images to make sure the signal sources appeared to correspond to the same cell. If a cell could not be confidently identified on a given day, the data were excluded on that day. As a result, our approach resulted in an incomplete map of all cells across all days. We note that cells had to have some activity (calcium transients) in order to be identified on a given day. This activity requirement for the identification of each cell could potentially result in an underestimation in the extent to which cells gain and lose task related activity. Cells were more likely to have a defined mask on days that were nearby in time due to variable activity and viral expression of the indicator GCaMP6m. Identification of significant peaks of activity Activity was spatially binned into 60 segments in the T-stem. Spatially binned segments typically contained 1 imaging frame each per trial. Data was interpolated to fill in gaps in which a bin contained no imaging frames on a trial. Mean activity across 60 spatial bins were calculated for correct white cue-left turn and black cue-right turn trials. To identify statistically significant peaks of activity, behavior data time courses were circle-shifted by a random amount relative to neuronal activity time courses, and new means were calculated for 1000 random shifts. All locations where the mean activity in the unshifted data was greater than activity in 950 shuffles for three consecutive bins were considered to contain a significant peak of activity. For all analyses where peaks were compared across days, we tracked peaks that were labelled with high confidence (unshifted data was greater than activity in 990 shuffles for three consecutive bins). Peaks were labelled as ‘gained’ or ‘lost’ if in the absent session, there was below 95% significance for a peak at that location. We found this gap between thresholds for the presence or absence of a peak to be important for limiting measurement noise. By these criteria for change, we found peak consistency across odd and even trials within one session to be 83.2 ± 2.1 %. Data files organization Processed data files are in the folder datafiles (in archive file “datafiles.tar.gz”). Each file "mXX_sXX.mat" contains the data from one experimental session (i.e. one behavioral session); (e.g. m01_s01.mat contains data from animal #1 collected on session 1). The data from some mice are divided into two folders, mXXa and mXXb. - A collection of analyses scripts that reproduces a subset of figures in (Driscoll et al., 2017) is included in the folder "analyses_scripts". To run a script see “How to get started” section below. Data format Processed Object File (“.mat”) Each .mat data file contains data from one session. The data is in the format of a matlab structure. Each structure contains the following fields: sessionList: a list of all imaging sessions with the mouse ID and the date (e.g. LD169_140816.mat contains data from animal 169 (m01) collected on August 16th, 2014) deltaDays: the number of days that have passed since imaging began associated with each imaging day numConditions: the number of trial types that were presented on that session (‘2’ indicates black right-turn and white left-turn trials and no novel trial types) confidenceLabel: manual verification label for cells (1-same cell; 2-likely same cell; 3-cannot be confirmed; 4-nuclear fluorescence) timeSeries: This structure contains data that are time series over the entire imaging session. timeSeries.calcium: dF/F and deconvolved calcium signal. timeSeries.virmen: behavior data and labels with units. trials: Data is spatially binned into 21 segments. we binned the data into larger segments (23 cm/bin). Neuronal activity and behavioral parameters were averaged in each bin. Each bin typically contained 2-3 frames/trial. trials.spData: deconvolved calcium signal (trials x spatial bins x cells) trials.virmenData: behavior data (trials x spatial bins x behavioral variables) trials.virmenDataLabels: behavioral variable labels associated with trials.virmenData trials.correct: each row is a separate trial that indicated whether the animal made the correct choice, into the rewarded arm (0-incorrect; 1-correct). trials.trialType: each row is a separate trial with the cue identity (0-black; 1-white). roiInfo: This structure contains information about all regions of interest (ROIs) that were identified on this session. Each row contains information about 4 separate imaging planes that were acquired simultaneously. roiInfo.rawF: raw fluorescence signal for all identified ROIs roiInfo.traceNeuropil: raw fluorescence signal for neuropil associated with all identified ROIs roiInfo.roiIndex: pixel locations for ROIs and associated neuropil, neuropil contamination factor, and reference number for across day alignment roiInfo.roiIndex.id: ROI identification number for this session roiInfo.roiIndex.indBody: ROI pixel coordinates within the 512 x 512 imaging field roiInfo.roiIndex.Neuropil: associated neuropil pixel coordinates within the 512 x 512 imaging field roiInfo.roiIndex.subCoef: The neuropil contamination factor is the slope of the best fit line using bottom 8th percentile of ROI fluorescence. roiInfo.roiIndex.alignID: reference number for across day alignment. This is the identification number for this cell on all sessions (this cell’s index in timeSeries data). refImages.slice: each row contains a reference image for imaging planes 1-4. How to get started We have included the following demo files to get started with this dataset in ‘analysis_scripts’ folder. To run a script, (e.g. "Demo_example_traces.m"): 1) open MATLAB 2) change current folder to the ".\analysis_scripts\" folder 3) type run(' Demo_example_traces.m') Demo_example_traces.m– This file contains code to visualize trial based activity. Demo_example_field_of_view.m– This file contains code to visualize cell locations and identification number from current session and across sessions. Demo_example_behavior.m - This file contains code to visualize neuronal activity and behavior. How to get help To get help with the data set post any questions on the forum at CRCNS.org. References Aronov, D., and Tank, D.W. (2014). Engagement of Neural Circuits Underlying 2D Spatial Navigation in a Rodent Virtual Reality System. Neuron 84, 442–456. Chen, T.-W., Wardill, T.J., Sun, Y., Pulver, S.R., Renninger, S.L., Baohan, A., Schreiter, E.R., Kerr, R. a, Orger, M.B., Jayaraman, V., et al. (2013). Ultrasensitive fluorescent proteins for imaging neuronal activity. Nature 499, 295–300. Dombeck, D.A., Harvey, C.D., Tian, L., Looger, L.L., and Tank, D.W. (2010). Functional imaging of hippocampal place cells at cellular resolution during virtual navigation. Nat. Neurosci. 13, 1433–1440. Greenberg, D.S., and Kerr, J.N.D. (2009). Automated correction of fast motion artifacts for two-photon imaging of awake animals. J. Neurosci. Methods 176, 1–15. Harvey, C.D., Collman, F., Dombeck, D.A., and Tank, D.W. (2009). Intracellular dynamics of hippocampal place cells during virtual navigation. Nature 461, 941–946. Huber, D., Gutnisky, D. a, Peron, S., O’Connor, D.H., Wiegert, J.S., Tian, L., Oertner, T.G., Looger, L.L., and Svoboda, K. (2012). Multiple dynamic representations in the motor cortex during sensorimotor learning. Nature 484, 473–478. Pnevmatikakis, E.A., Soudry, D., Gao, Y., Machado, T.A., Merel, J., Pfau, D., Reardon, T., Mu, Y., Lacefield, C., Yang, W., et al. (2016). Simultaneous Denoising, Deconvolution, and Demixing of Calcium Imaging Data. Neuron 89, 285. Shi, J., and Malik, J. (2000). Normalized cuts and image segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 22, 888–905. Tian, L., Hires, S.A., Mao, T., Huber, D., Chiappe, M.E., Chalasani, S.H., Petreanu, L., Akerboom, J., McKinney, S.A., Schreiter, E.R., et al. (2009). Imaging neural activity in worms, flies and mice with improved GCaMP calcium indicators. Nat. Methods 6, 875–881.