Analysis package for the paper Haley, Hampton, and Marder (2018)
These codes were written and used to analyze intracellular waveforms and extracellular nerve recordings from bursting neurons. Custom violin and stacked bar graph plotting scripts are included. This package is comprehensive and includes all codes used for this paper. Some of these codes are only useful for this particular set of experiments and will need to be adapted for other uses.
I used the following software for analysis and figure production:
- pClamp 10.5
- Spike2 v6.04
- MATLAB 2018a
- R v3.5.0
- RStudio 1.1.456
- Adobe Illustrator CC 2017
Read .abf files in MATLAB
abfload.m: reads a.abffile (produced in pClamp) and produces a basic MATLAB structureLoadabf.m: wrapper forabfload.m; produces a more organized MATLAB struture for reading.abffiles
Analyze extracellular bursts in Spike2 and MATLAB
batchImp.s2s: given.abffiles of type - ABF1(Integer) - which can be designated by exporting files in Clampfit, converts files to.smr, which is readable by other Spike2 scriptsspikenburst.s2s: given a folder of.smrfiles, the gui walks you through defining bursts and spikes on extracellular traces using thresholding of membrane potential; produces.txtfiles for further anlaysis of spikes and burstsreadSpikeOutput.m: given theburst.txtfiles produced byspikenburst.s2s, parces the data and produces simple measures of activity (e.g. frequency, spikes per burst, duration, duty cycle, start times, end times, and file numbers) for each burstextracellularAnalysis.m: for a particular experiment, this code usesreadSpikeOutput.mandconvertpH.mto pool and separate data into separate conditions; this function assumes that every condition was recorded in a separate.abffile; saves analysis as a structuredata.mat
Analyze intracellular waveforms in MATLAB
analyzeWaveform.m: given the waveform, sampling frequency, and default parameters, analyzes the slow wave and spiking activity of intracellular neuronsintracellularAnalysis.m: for a particular experiment, this code usesanalyzeWaveform.mto pool data for all conditions; this function assumes that every conditon was recorded in a separate.abffile; analyzes only the last minute of data; saves analysis as a structuredata.mat
Plotting data in MATLAB
violinPlots.m: given a 2D data matrix (columns are different conditions), creates violin plots; assumes 13 pH conditions, but code is simple and can be adapted for other purposesviolinPlotsControl.m: similar toviolinPlots.m, but assumes a 2D data matrix with columns as different preparationsstackedBarPlots.m: produces stacked bar plots for state analysisrectanglePlots.m: produces colored boxes with saturation giving measure of rhythmicitycomparisonBarPlots.m: produces colored boxes with saturation giving measure of rhythmicity for individual preparations at acid, base, and control
Pool all experiments and plot in MATLAB
pHCumulative.m: accumulates all of the information from thedata.matfiles for each extracellular experiment included in the paper; produces all of the extracellular figures, saves data used in figures as.csvfor statisticspHCumulativePTX.m: accumulates all of the information from thedata.matfiles for each intracellular PTX experiment included in the paper; produces all of the intracellular figures, saves data used in figures as.csvfor statistics
Statistical analyses in R/RStudio and MATLAB
statistics.R: code to compute a One-Way Repeated Measures ANOVA with post-hoc Paired Samples T-Tests (Bonferonni-corrected) or a Two-Way Multivariate ANOVA with post-hoc Independent Samples T-Tests (Bonferonni-corrected); reads.csvfiles outputed frompHCumulative.morpHCumulativePTX.mand saves statistical analyses as new.csvfilesformatStatTables.m: reformats the.csvfiles produced in R to be more legible for figures; requires some tweeking in Microsoft Excel before being saved as an Adobe PDF for further cosmetic changes in Adobe Illustrator; no substantive utility
- Paper: https://elifesciences.org/articles/41877
- Data Repository: https://osf.io/r7aes/
- Git Repository: https://github.com/jesshaley/haley_hampton_marder_2018
- Related projects: https://github.com/marderlab
If you are having substantial issues or have questions about the code, please contact jess.allison.haley at gmail.com.