Scripts used for Christina's Ph.D. thesis on neural mechanisms underlying learned and non-learned gaping.
src/- Source code for analysis modulesCM_scripts/- Core analysis pipeline scriptscombine_classifier_files.py- Combines Blech EMG Classifier segment filescreate_tau_dict.py- Combines tau, spike trains, and changepoint datainitialize_dataframe.py- Adds important metrics to dataframeextract_emg_from_transition.py- Calculates behavior frequency per sessionextract_emg_from_transition_aggregate.py- Aggregates behavior frequency across sessionsneural_behavior_correlations_aggregate.py- Neural-behavior correlation analysis
gape_temporal_difference/- Temporal analysis of gaping behaviorgapes_temporal_features.py- Feature extraction for gape analysis
lfp_analysis/- Local field potential analysiscollect_data.py- Data collection for LFP analysiscross_trial_analysis.py- Cross-trial LFP analysisplot_LFP_spectrogram.py- LFP spectrogram visualizationdata_dirs_LFP.txt- Configuration file for LFP data directoriesnotes.txt- Analysis notes and documentation
multibehavior_transition/- Multi-behavior transition analysismultibehavior_transition.py- Main transition analysis scriptDEPENDENCIES.md- Dependencies documentationNOTE.txt- Analysis notes and documentation
data/- Processed data fileschangepoint_gapes/- Changepoint detection data for gapesgapes_cp02_df.pkl- Changepoint 0-2 dataframegapes_cp23_df.pkl- Changepoint 2-3 dataframe
artifacts/- Generated analysis artifactschangepoint_gapes/- Sorted features and labels (numpy arrays)sorted_X.npy- Sorted feature matrixsorted_y.npy- Sorted labels
lfp_analysis/- LFP analysis artifactspre_stim_data/- Pre-stimulus LFP data for individual sessions
plots/- Generated visualization outputschangepoint_gapes/- Gape-related plotsbinned_temporal_evolution_features.png- Binned temporal feature evolutionbinned_temporal_evolution_features_cutoff_200ms.png- Binned temporal evolution with 200ms cutoffbinned_temporal_evolution_individual_features_cutoff_200ms.png- Individual feature evolution with cutoffpca_explained_variance_smoothed_binned_features.png- PCA variance explainedtemporal_evolution_features.png- Temporal feature evolutiontemporal_evolution_individual_features_cutoff_200ms.png- Individual feature temporal evolution
lfp_analysis/- LFP analysis plotsmedian_diff_z_power_pre_post_changepoint.png- Median power difference pre/post changepointpre_post_changepoint_spectrograms.png- Spectrograms pre/post changepointtaste_averaged_band_power_pre_post_changepoint.png- Taste-averaged band powerpre_stim_spectrograms/- Individual session pre-stimulus spectrograms
multibehavior_transition/- Behavior transition plotstwo_test_changepoint_plots/- Individual session changepoint visualizations
Initial set-up:
- Run each session recording through Pytau, Blech_EMG_Classifier, and BlechClust packages before running this package.
- Run create_tau_dict.py # combines tau, spike trains, and num cps from cp model into dictionary
- Run combine_classifier_files.py # puts all Blech EMG Classifier segments files into one dataframe
- Run initialize_dataframe.py # Adds important metrics to dataframe
Behavior-only analyses:
- Run extract_emg_from_transition.py # calculates frequency of each behavior across trials, plots, and saves artifacts for each session
- Run extract_emg_from_transition_aggregate.py # plots frequency of each behavior across trials, averages across all sessions