Code accompanying the paper: Shin, J. D. & Jadhav, S. P. (2024). Prefrontal cortical ripples mediate top-down suppression of hippocampal
reactivation during sleep memory consolidation.
Current Biology.
Codes were created in MATLAB 2022a.
./Figure1
jds_CA1_PFCrips_xcorr_M.m - Figure 1D, Figure 6A - CA1-PFC ripple cross-correlation. Can use to compute cross-correlation for other events as well.
jds_ctxrip_plotExample_M.m - Figure 1C - Plots example ripple events.
jds_plotRaster_sleepProject_M.m - Figure 1A - Plots example raster with spikes, LFP, and ripples highlighted.
jds_rippletrig_spindlepwr_M.m - Figure 1G - Compares spindle power during coordinated and independent PFC ripple events.
jds_sleepripplerate_overtime_M.m - Figure 1E-F - Calculates rate of ripples over sleep sessions.
jds_triggered_wavelet_M.m - Figure 1B - Plots the PFC ripple triggered wavelet spectrogram. Uses the tetrode with highest number of ripples.
./Figure2
jds_ripMod_ripPropertiesQuartiles_M.m - Figure 2D - Plots the relationship between PFC ripple features (frequency, amplitude, legnth) and CA1 modulation during independent PFC ripples.
jds_ripTrigModLargerWindow_M.m - Figure 2A-C - Plots ripple triggered modulation for CA1 and PFC. Run DFSjds_getripalignspiking_M.m to generate modulation files aligned to different ripple events.
./Figure3
jds_CA1_rippleBursting_latency_M.m - Figure 3C - Plots bursting and spike latency metrics for CA1 mod cells during SWRs. Also plots the relationship between CA1 modulation index and bursting/spike latency.
jds_CA1mod_bumpPlots_M.m - Figure 3A - Plots example place fields sorted by peak on the maze.
jds_CA1mod_getFieldMetricsPrePost_M.m - Figure 3B - Compares place field metrics for CA1 mod cells (number fields, field width, etc).
jds_CA1mod_spatialinfo_M.m - Figure 3B - Calculates and plot spatial information for CA1 mod cells.
jds_CA1mod_stability_M.m - Figure 3B - Calculates stability of CA1 mod cells for consecutive run sessions.
jds_PPC_thetalockingstrength_M.m - Figure 3B - Calculates theta phase locking strength for CA1 mod cells (pairwise phase consistency-PPC, and kappa concentration parameter).
jds_comparePFCripmod_SWRparticipation_M.m - Figure 3C - Calculates and plots NREM firing rate, firing rate gain during SWRs, etc. for CA1 mod cells.
jds_ripTrigMod_compareRips_scatter_M.m - Figure 3E - Plots the relationship between modulation during coordinated ripples and independent PFC ripples.
./Figure4
jds_GLM_ripplepredictionArea_M.m - Figure 4H - Predicts ripple type (coordinated or independent) in CA1 or PFC using CA1 or PFC population activity, respsectively.
jds_assemblySuppressionReinstatement_M.m - FIgure 4G - Evaluates the relationship between assembly reinstatement and CA1 assembly suppression during independent PFC ripples.
jds_noncoordrippletriggered_assemblystrength_M.m - Figure 4B,D - Ripple triggered assembly reactivation plots.
jds_plotRasterReactivation_sleepProject_M.m - Figure 4A,C - Example assembly reactivation rasters for CA1 and PFC.
jds_rippletriggered_compareStrengthAll_M.m - Figure 4F - Calculates and compares the reactivation strength of assemblies during different ripple events.
./Figure5
jds_CA1_SWRdimensionality_M.m - Figure 5D - Calculates and compares the dimensionality of independent and coordinated SWRs.
jds_PCCmodNonmod_M.m - Figure 5F - Compares per cell comtribution (PCC) for CA1 mod and nonmod cells.
jds_PCCrippleReplayDifference_M.m - Figure 5F - Compares PCC differences between coordinated and independent SWR replay for CA1 mod and nonmod cells.
jds_SWR_rankordercorr_M.m - Figure 5C - Computes rank order correlations for independent and coordinated SWR events.
jds_plotReplayRaster_M.m - Figure 5A - Plots example replay rasters.
jds_sequenceRobustness_withawake_M.m - Figure 5B - Compares and plots sequence degradataion of independent, coordinated, and awake SWR replay events (single cell shuffles).
jds_sequenceScoreIndCoord_M.m - Figure 5E - Compares and plots weighted correlation and jump distance for independent and coordinated events (rZ shuffle method).
./Figure6
jds_SOphaselocking_M.m - Figure 6F - Calculates and plots slow oscillation phase locking of spindles, pfc ripples, and CA1 SWRs.
jds_periSO_eventProbability_M.m - Figure 6E-F - Plots the event occurences of spindles, pfc ripples, and CA1 SWRS surrounding SO troughs (up states).
jds_periSO_eventProbability_ReactivationQuartiles_M.m - Figure 6H - Plots peri-SO CA1 reacvtivation strengths according to quartiles.
jds_periSO_eventProbability_ReactivationSuppression_M.m - Figure 6H - Plots the relationship between peri-SO CA1 reactivation strength and independent PFC ripple triggered CA1 assembly suppression.
jds_periSO_eventProbability_Reactivation_M.m - Figure 6G - Plots SO trough aligned reactivation strength for CA1 and PFC to determine reactivation timing surrounding events.
jds_periSO_eventProbability_bootstrapTiming_M.m - Figure 6E - Resampling of occurence matrix to determine significance of peaks of fold change probability plots.
jds_updown_replayProbabilityCoordNoncoord_M.m - Figure 6C - Calculates the probability of SWR replay events during up and down states of the slow oscillations.
./SupplementalFigures
jds_CA1PFCcoreactivationRates_M.m - Calculates CA1-PFC co-reactivation rates during different ripple types.
jds_CA1relativeSuppression_M.m - Calculates suppression of CA1 assemblies during independent PFC ripples at different points in time (early, middle, late sleep).
jds_GLM_ripplepredictionAreaLeadLag_M.m - Prediction of leading or lagging ripple type based on CA1-PFC activity.
jds_SWS_RepFig_M.m - Plots representative sleep figure.
jds_assemblyContribSpatialCorr_M.m - Calculates the spatial correlation of cell pairs for assembly member and nonmember cells.
jds_cellsactive_rip_M.m - Calculates the proportion of cells active during different ripple events.
jds_compareRipCofiring_coordNoncoord_members_M.m - Calculates the z-scored ripple co-firing of member cell pairs during different ripple types.
jds_compare_pcweights_contribution_M.m - Evaluates the relationship between absolute assembly weight and assembly contribution.
jds_leadlagrippletriggered_assemblystrength_M.m - Plots the leading/lagging ripple triggered assembly strength for CA1 or PFC.
jds_plotSpikeInfo_M.m - Plots clustering information, CA1 PYR and INT separation, and spiking metrics for CA1 neurons.
jds_relativeRippleRate_M.m - Compares ripple rates for first and second half of sleep epochs.
jds_ripTrigMod_modProportions.m - Calculates and plots the proportion of EXC, INH, and modulated cells in CA1 and PFC aligned to different ripple types.
jds_ripplecoordinationtriggered_assemblystrength_M.m - Plots coordinated ripple triggered assembly strength for CA1 and PFC.
jds_rippletrig_crossripplepwr_M.m - Plots the ripple power in the opposing area aligned to either independent or coordinated ripple events.
jds_rippletriggered_CA1PFCassemblies_M.m - Plots ripple triggerend CA1-PFC joint reactivation strength and looks at the relationship between different ripple events.
jds_CA1replay_rippleTypeSeqMetrics_M.m - Compares weighted correlation, jump distances, R2, % reverse replay, and % significant replay for independent and coordinated SWR replay (line fitting decoding method).
jds_sleepEventRates_comparerunsleep_M.m - Plots the rates of sleep oscillations (independent and coordinated ripples, SOs, spindles, run ripples).
jds_sleepripplelengths_overtime_M.m - Calculates ripple lengths over epochs.
jds_sleepripplerate_performance_M.m - Evaluates the relationship between ripple rate and behavioral performance.
jds_theta_phaselocking_modcells_M.m - Plots the preferred theta phase of CA1 mod cells during run.
./ProcessData
DFSjds_getripalignspiking_M.m - Get ripple aligned modulation.
jds_CA1PFCassemblyReactivation_ICA_M.m - Get joint CA1-PFC assemblies.
jds_PCC_replay_decoding_CA1_allcells_M.m - Replay decoding using rZ shuffle and per cell contribution calculations.
jds_assemblyReactivationReinstatement_ICA_M.m - Get CA1 or PFC assemblies for reinstatement analysis.
jds_extractSlowOscillations_M.m - Extract slow oscillations.
jds_getSpikeInfo_M.m - Get cell cluster information for subsequent plotting.
jds_getripples_amp_freq_sleep_M.m - Get frequency and amplitude or ripple events.
jds_reactivation_contribution_M.m - Get contribution to activation/reactivation strength for comparison with assembly weights.
jds_replay_decoding_CA1_M.m - Replay decoding using line fitting and monte carlo method.
jds_replay_spikematrix_ev_singleday_M.m - Get spike matrices during run and sleep using specified time bin sizes.
Justin D. Shin [email protected]