Yamashita M., Kubo R., and Nishimoto. S. 2023, bioRxiv
- 512GB memory system
- MATLAB (confirmed on ver. R2019b, on Ubuntu 18.04.4 LTS.)
- MATLAB Statstics Toolbox
- MATLAB function for 'pca_bootstrap.m' (Gale-Shapley stable marriage algorithm)
- FreeSurfer (confirmed on ver. 6.0)
- PyCortex (confirmed on ver. 1.2)
git clone https://github.com/yamashita-lang/dialogue
Edit 'ProjectDir' in 'load_parameters_proj.m' file to your environment (e.g., /home/projects/open/dialogue/).
We share data on OpenNeuro.
- Derivative data, should be located in derivative subdirectory (e.g., /home/projects/open/dialogue/derivative/).
- Preprocessed fMRI
- e.g., '/derivative/preprocessed_data/sub-OSU01/RespData_sub-OSU01_ses-1_task-dialogue_bold.mat'
- Normalized stimulus features
- e.g., '/derivative/preprocessed_data/sub-OSU01/StimData_CHATGPTNEOX_sub-OSU01_ses-1_task-dialogue.mat'
- Individual fMRI target space
- e.g., '/derivative/preprocessed_data/sub-OSU01/target_sub-OSU01.nii'
- FreeSurfer ROI information
- e.g., '/derivative/fsROI/sub-OSU01/vset_info.mat'
- Stimulus GPT embeddings
- e.g., '/derivative/preprocessed_data/sub-OSU01/Embedding_CHATGPTNEOX_Prod_sub-OSU01.mat'
- Morpheme and syllable counts for each utterance
- e.g., '/derivative/preprocessed_data/sub-OSU01/Lowlevel_Prod_sub-OSU01.mat'
- PyCortex database
- e.g., '/derivative/pycortex_db/sub-OSU01/overlays.svg'
- Transcribed utterances, which include sensitive information and will be shared upon reasonable request.
This demo reproduces key findings. Please refer to Full Analysis section below for a more detailed analysis.
- Sample results for demo, should be located in results subdirectory (e.g, /home/projects/open/dialogue/derivative/results).
ID='sub-OSU08';
mode=1; % for speech production, mode=2 for speech comprehension
ridge_cerebcortex(ID)
Perform ridge regression for same-/cross-modality prediction for each session.
- Expected inputs:
- Preprocessed fMRI
- Normalized stimulus features
- Expected outputs: RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n].mat
- Expected run time: several hours for each session
ridge_cerebcortex_uniqvarpart_reduced(ID)
Perform unique variance partitioning and calculate relative complement for each set of feature
- Expected inputs:
- RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n].mat
- RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n]_MainFeatures.mat
- RidgeResults_CHATGPTNEOX_sub-OSU08_MainFeatures_FDRcorr_mean.mat
- RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n]_SingleFeature_1.mat
- RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n]_SingleFeature_7.mat
- Expected outputs:
- RidgeResults_CHATGPTNEOX_sub-OSU08_SingleFeature_Intersection.nii
- RidgeResults_CHATGPTNEOX_sub-OSU08_SingleFeature_Prod_RC.nii
- RidgeResults_CHATGPTNEOX_sub-OSU08_SingleFeature_Comp_RC.nii
- RidgeResults_CHATGPTNEOX_sub-OSU08_SingleFeature_VarPart.mat
- Expected run time: several tens of minutes
weight_corr(ID)
Calculate semantic weight correlation between production and comprehension for each voxel
- Expected inputs:
- RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n].mat
- RidgeResults_CHATGPTNEOX_sub-OSU08_FDRcorr_mean.mat
- Expected outputs:
- WeightCorr_CHATGPTNEOX_sub-OSU08_FDRcorr.nii
- WeightCorr_CHATGPTNEOX_sub-OSU08_FDRcorr.mat
- Expected run time: several tens of minutes
pca_weights(mode)
Perform principal component analysis for semantic weights combined across participants
- Expected inputs:
- RidgeResults_CHATGPTNEOX_sub-OSU08_ses-[1, ..., n].mat
- RidgeResults_CHATGPTNEOX_sub-OSU08_FDRcorr_mean.mat
- Expected outputs:
- RidgeResults_CHATGPTNEOX_sub-OSU08_meanweight.mat
- Weight_CHATGPTNEOX_sub-OSU08_Prod.mat
- GroupWeight_CHATGPTNEOX_Prod.mat
- PCA_Results_CHATGPTNEOX_Prod.mat
- PCA_Result_CHATGPTNEOX_sub-OSU08_Prod_RGBmap_R.nii
- Expected run time: several hours
ID='sub-OSU08'; % or 'sub-OSU01', …, 'sub-OSU08'
mode=1; % for speech production, mode=2 for speech comprehension
ridge_cerebcortex(ID)
See Demo section
ridge_fdrcorr(ID, mode)
Perform FDR correction for regression results for each session.
- Expected outputs: RidgeResults_CHATGPTNEOX_sub-OSU01_ses-[1, ..., n].mat
- Expected run time: several tens of minutes for each session
ridge_session_average(ID)
Average FDR corrected results across sessions.
- Expected outputs:
- RidgeResults_CHATGPTNEOX_sub-OSU01_same_FDRcorr_mean.nii
- RidgeResults_CHATGPTNEOX_sub-OSU01_cross_FDRcorr_mean.nii
- RidgeResults_CHATGPTNEOX_sub-OSU01_FDRcorr_mean.mat
- Expected run time: several tens of minutes
for rd_idx = 1:11
ridge_cerebcortex_submodel(ID, rd_idx);
end
Perform ridge regression with removing a set of feature
- Expected outputs: RidgeResults_CHATGPTNEOX_sub-OSU01_ses-1_234567891011.mat
- Expected run time: several hours for each session, for each feature
ridge_cerebcortex_uniqvarpart(ID)
Perform unique variance partitioning and calculate relative complement for each set of feature
- Expected outputs:
- 'RidgeResults_CHATGPTNEOX_sub-OSU01_UniqVP_POS_Prod.nii'
- 'RidgeResults_CHATGPTNEOX_sub-OSU01_UniqVP_POS_Prod.mat'
- Expected run time: several tens of minutes for each feature
ridge_cerebcortex_mainfeatures(ID)
Perform ridge regression with semantic features
- Expected outputs: RidgeResults_CHATGPTNEOX_sub-OSU01_ses-1_MainFeatures.mat
- Expected run time: several hours for each session
ridge_cerebcortex_singlefeature(ID, mode)
Perform ridge regression with single-modality semantic features
- Expected outputs: RidgeResults_CHATGPTNEOX_sub-OSU01_ses-1_SingleFeature_1.mat
- Expected run time: several hours for each session
ridge_fdrcorr_mainfeatures(ID)
Perform FDR correction for regression results for each session.
- Expected outputs: RidgeResults_CHATGPTNEOX_sub-OSU01_ses-1_MainFeatures.mat
- Expected run time: several tens of minutes for each session
ridge_session_average_mainfeatures(ID)
Average FDR corrected results across sessions.
- Expected outputs:
- RidgeResults_CHATGPTNEOX_subOSU01_MainFeatures_FDRcorr_mean.nii
- RidgeResults_CHATGPTNEOX_subOSU01_MainFeatures_FDRcorr_mean.mat
- Expected run time: several tens of minutes
ridge_cerebcortex_uniqvarpart_reduced(ID)
See Demo section
best_uniqvarpart_rgb(ID)
Examaine best variance partitioning for each voxel
- Expected outputs:
- RidgeResults_CHATGPTNEOX_sub-OSU01_VarPart_ccs.mat
- RidgeResults_CHATGPTNEOX_sub-OSU01_VarPart_RGB.nii
- Expected run time: several tens of minutes
weight_corr(ID)
See Demo section
pca_weights(mode)
See Demo section
pca_bootstrap(mode, 1)
Perform bootstrap resampling to test significance
- Expected outputs:
- PCA_bootstrap_CHATGPTNEOX_Prod.mat
- PCA_bootstrap_CHATGPTNEOX_Prod_pval.csv
- Expected run time: several hours
pca_bootstrap(mode, 2)
- Expected outputs: PCA_bootstrap_CHATGPTNEOX_Prod.csv
- Expected run time: several minutes
sig_pc=4; for speech production % sig_pc=6; for speech comprehension
pca_stats(mode, sig_pc, 1)
Analyse PCA results
- Expected outputs:
- Uniq_embedding_CHATGPTNEOX_Prod_sub-OSU01.mat
- GroupEmb_Prod_uniq.mat
- PCA_Result_CHATGPTNEOX_Prod_high_PC[1, ..., n].txt
- PCA_Result_CHATGPTNEOX_Prod_low_PC[1, ..., n].txt
- Expected run time: several minutes
pca_stats(mode, sig_pc, 2)
- Expected outputs: PCA_Result_CHATGPTNEOX_Prod_PC_vs_LowLevelFeatures.csv
- Expected run time: several minutes
pca_stats(mode, sig_pc, 3)
- Expected outputs:
- Corr_PCA_vs_POS_CHATGPTNEOX_Prod_sub-OSU01.mat
- GroupMean_Corr_PCA_vs_POS_CHATGPTNEOX_Prod.mat
- Expected run time: several minutes
pca_stats(mode, sig_pc, 4)
- Expected output:
- PCload_CHATGPTNEOX_Prod.mat
- PCload_CHATGPTNEOX_Prod.txt
- PCload_CHATGPTNEOX_Prod_RGB_[R,G,B].txt
- Expected run time: several minutes
pycortex_example.ipynb
make_fig5.ipynb