# Subway navigational task Analysis Scripts **Repository Path**: qunjunliang/subway-navigational-task-analysis-scripts ## Basic Information - **Project Name**: Subway navigational task Analysis Scripts - **Description**: This repo contains the scripts of data analysis in the Paper "Dynamic Causal Modelling of Hierarchical Planning The Role of Dorsomedial Frontal Cortex in Performance Optimizing". - **Primary Language**: R - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2021-11-12 - **Last Updated**: 2024-05-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # subway_navigation_task For opening all scripts we used in virtual subway navigation study. Here, we are grateful for all the supports given by Peter Zeidman in DCM analysis. ## Introduction of Document Tree ### Task Program We used [Psychopy](https://www.psychopy.org/) v3.0 to present the whole task. You can find the python scripts in **Task_Program_Psychopy/**. Directory named "formal_experiment" contains the program used in formal experiment when fMRI scanning. Directory named "train_stage" contains the program used in the training stage a day before scanning. ### Linear Mixed Model Analysis The linear mixed model which modeling the behavioral data of participants was built using R package [lmerTest](https://cran.r-project.org/web/packages/lmerTest/index.html). You can find the R scritps in **Behavior_analysis/**. **Step-1_Pre-analysis_data_resahpe.R** is the script to shape the data recorded from the tasks which is located in **behav_data_clean/**. And **subway_behaviordata_assumble_DA.csv** is an example of the data after shaping by the pipeline. **Step-2_LMMs_Model_Construction.R** is the script for two aims: (1) Estimating the effect of multiple planning complexities to the participants' RT (please see Fig.3a on our paper), and (2) testing the effect synchronicity of the planning complexities for influencing the RT and brain activity by Pearson's correlation (please see Fig.3c on our paper). **GLM1_roi_behavior/** contains the z-map of brain activity estimated by the GLM1, and the ROIs were identified by the DL modulation. ### fMRI quality control **MRIqc_group/** contains the html report for the quality functional and structural images. ### Universal Analysis of Neural Data To detect the response of brain areas to computational costs, we built a general linear model 1 which contains four costs for parameteric modulation. The GLM1 was conducted using [FSL's](https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/) feat. All *.fsf files in **GLM1_related/** are design files using in run-level, subject-level and group-level. The bash script **BashRun_first_level_GLM1_Feat.sh** is used for batching process of run-level GLM1. The time series could be found in the directory named **TimePointExtraction_GLM1**. ### Dynamic Causal Model Analysis To investgate the neural architecture underlying hierarchical planning and test the connectivity in dorsomedial frontal cortext contributed to the individual difference in planning efficiency, DCM and PEB were performed. The scripts we ued are placed in the directory **DCM_related/**. We first construct a subject-level GLM using SPM. Then we extracted the time series in each VOI, including the dorsomedial prefrontal cortex, the bilateral premotor cortex and the superior parietal cortex. The script used to build GLM and extract VOIs are **Step1_GLM_all_pipeline_concate.m** and **Step2_GLM_pipeline_VOI_extraction.m**. The fist level DCM was specified using **Step3_first_level_DCM.m**. The seond level DCM, including PEB analysis, auto-BMR, cross-validation and family-wise model comparison, was estimated using **Step4_second_level_DCM.m**. DCM result visualization was conducted using R. The script is **Step5_DCM_PEB_visualization.R**. All DCM pipeline was done using [SPM12](https://www.fil.ion.ucl.ac.uk/spm/), following the guidance of [part 1: First level analysis with DCM for fMRI](https://linkinghub.elsevier.com/retrieve/pii/S1053-8119(19)30522-1) and [part 2: Second level analysis with PEB](https://www.sciencedirect.com/science/article/pii/S1053811919305233?via%3Dihub)