Code and data for EI Hurst paper
July 2, 2020 · View on GitHub
This code is associated with the paper from Trakoshis et al., "Intrinsic excitation-inhibition imbalance affects medial prefrontal cortex differently in autistic men versus women". eLife, 2020. http://doi.org/10.7554/eLife.55684
Code and data for EI Hurst paper
This repository has all the code and tidy data for the analyses in Trakoshis, Martínez-Cañada et al., Intrinsic excitation-inhibition imbalance affects medial prefrontal cortex differently in autistic men versus women. https://doi.org/10.1101/2020.01.16.909531
The code directory has all of the code for running the primary analyses. The analyses are split into 4 sections A, B, C, and D, and these are denoted at the beginning of each filename. Section A is the code for running in-silico modeling for the Gao model and the recurrent model. The code for the recurrent network model is located here: https://github.com/pablomc88/EEG_proxy_from_network_point_neurons. Section B is for running in-vivo DREADD analyses. Section C is for running analyses on human rsfMRI data. Section D is for the gene expression enrichment analyses. Other code that these main scripts depend on are also in this directory.
Requirements
-
AFNI (https://afni.nimh.nih.gov/) - for preprocessing
-
FSL (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki) - for preprocessing
-
SPM12 (https://www.fil.ion.ucl.ac.uk/spm/software/spm12/) - for convolving simulated LFP to canonical HRF (
spm_conv.m) -
Python 2.7 and 3.6 or higher from the Anaconda distribution (https://www.anaconda.com/distribution/)
-
neurodsp (https://neurodsp-tools.github.io/neurodsp/) - for simulating LFP data based on 1/f and oscillations.
-
nibabel (https://nipy.org/nibabel/) - used by
dvars_se.py.
-
-
R 3.5.1 or higher and RStudio (https://rstudio.com/)
- R libraries
c("here","ggplot2","patchwork","matlabr","nlme","reshape2","readxl","psych","ggseg","heplots","gplots")-
patchwork (https://github.com/thomasp85/patchwork) - for putting together multiple ggplots.
-
ggseg (https://github.com/LCBC-UiO/ggseg) - for making plots of brains.
-
MATLAB R2018b or higher (https://www.mathworks.com/)
-
Brain Wavelet Toolbox (http://www.brainwavelet.org/) - Used in preprocessing for the wavelet denoising step described by Patel et al., (2014).
-
nonfractal (https://github.com/wonsang/nonfractal) - Used for computation of H.
-
EIslope (https://github.com/voytekresearch/EISlope) - Used for running Gao et al., (2017) model that simulates LFP data based on manipulations of excitation and inhibition.
-
PLS toolbox in MATLAB (https://www.rotman-baycrest.on.ca/index.php?section=84) - Used for the PLS analysis on rsfMRI H data.
-
In-silico modeling
-
A_insilico_0_analyze_recurrent_model.pywill run the steps for analyzing the recurrent model data. The data for this step is in thedata/recurrent_modeldirectory. -
A_insilico_1_eisim.mwill run the model from Gao et al., (2017) that manipulates E:I ratio and then compute H on the simulated LFP data. H is computed with thebfn_mfin_mlfunction fromnonfractal. This function saves data into thedata/gao_modeldirectory and is run as follows:EI_ratio = [2:0.2:6]; MAKE_PLOT = 0; result = A_insilico_1_eisim(EI_ratio, MAKE_PLOT); -
A_insilico_2_neural_ts_sim.pywill run the simulations to create LFP data based on 1/f slope. It can be run simply as shown below. This analysis requires python 3.6 or higher and utilizes the neurodsp library (https://neurodsp-tools.github.io/neurodsp/). This is primarily used to simulate the data that gets used in Supplementary Figure 1D.python A_insilico_2_neural_ts_sim.py -
A_insilico_3_boldsim_neuralts_oof.mwill take the simulated LFP data from python in the previous step and will utilize it to compute H. This is primarily used for data going into Supplementary Figure 1D. It needs to be run as follows:`result = A_insilico_3_boldsim_neuralts_oof(0, 'oof');``
In-vivo DREADD mouse rsfMRI analyses
-
B_invivo_1_DREADDpfc_excitation.Rmdruns in RStudio and will call theMATLABscriptB_invivo_1_DREADDpfc_excitation.mas the main code for running sliding window analyses on the DREADD excitation experiment. The remaining parts of theB_invivo_1_DREADDpfc_excitation.Rmdcode will run the statistics and make plots. Running thisB_invivo_1_DREADDpfc_excitation.Rmdwill produce theB_invivo_1_DREADDpfc_excitation.htmlreport found in thecodedirectory. -
B_invivo_2_DREADDpfc_silencing.Rmdruns in RStudio and will call theMATLABscriptB_invivo_2_DREADDpfc_silencing.mas the main code for running sliding window analyses on the DREADD silencing experiment. The remaining parts of theB_invivo_2_DREADDpfc_silencing.Rmdcode will run the statistics and make plots. Running thisB_invivo_2_DREADDpfc_silencing.Rmdwill produce theB_invivo_2_DREADDpfc_silencing.htmlreport found in thecodedirectory.
Autism rsfMRI analyses
-
C_1_preproc.shis a bash script that runs the preprocessing on the rsfMRI data. The main preprocessing script being called isspeedyppX.py. This script calls many AFNI functions to do the main preprocessing. Note thatspeedyppX.pywas written forpython 2.7and may not work well in more recent versions ofpython. It also calls functions from theBrain Wavelet Toolboxto implement the wavelet denoising procedure described by Patel et al., (2014). After the preprocessing framewise displacement and DVARS are computed withfd.pyanddvars_se.py. At the end of this bash script, it also calls aMATLABfunction calledC_1a_parcEst.mwhich will callC_1b_parcellate.mto parcellate the data by the HCP-MMP parcellation and then compute H based on those parcels. -
C_2_AIMS_Hurst_Univariate.Rmdruns in RStudio and does the main univariate analysis on H data. It runs all the stats for the sex-by-diagnosis interaction effect and other main effects, produces plots, and shows the results tables. It produces theC_2_AIMS_Hurst_Univariate.htmlreport that can be found in thecodedirectory. -
C_3_AIMS_Hurst_PLS.Rmdruns in RStudio and will runC_3a_AIMS_Hurst_PLS.minMATLABas the primary analysis of PLS on the rsfMRI data. The rest of theC_3_AIMS_Hurst_PLS.Rmdwill make plots and produces theC_3_AIMS_Hurst_PLS.htmlreport found in thecodedirectory.
Genomic analyses
D_asd_risk_genes_dht_de_overlap.Rmdruns in RStudio and does the main enrichment analyses between autism-associated genes in different cell types and DHT DE genes.
Data
Inside the data directory are subdirectories with the tidy data needed for the different aspects of the analyses. The names and filenames should be pretty self-explanatory and they get used at various points in the code.