Skip to content

ppsp-team/ToMASD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToMASD

Companion code for:

Decision inertia, not mindreading, differentiates autism in a pediatric social game Sarovic D.*, Moses L.*, Dufranne Q., Cassar K., Ligonie P., Badra T., Daunizeau J., Forgeot d'Arc B., Dumas G. Manuscript in preparation (2026).

This repository hosts the statistical-analysis code and the model-fitting scripts used to produce the results reported in the manuscript. Individual-level data are not redistributed here.


Contents

ToMASD/
├── data/
│   ├── data_dictionary.md        # Variable schemas
│   ├── demographics.csv          # Group-level summary statistics
│   ├── performance.csv
│   ├── phenotypes.csv
│   └── clinical_scales.csv
├── code/
│   ├── statistical_tests.R       # Group stats, regressions, figures (R)
│   ├── aggregate_stats.py        # Build the four data/*.csv files (Python)
│   ├── fit_models.m              # MATLAB: fit VBA model space to BrainUs exports
│   ├── build_evidence_matrix.m   # MATLAB: assemble evidence matrix + RFX-BMC
│   └── plot_results.m            # MATLAB: per-group plots
├── LICENSE                       # BSD 3-Clause
└── README.md

The MATLAB pipeline is adapted from the precursor adult study (Forgeot d'Arc et al., 2020, PLoS Comput Biol); reproducing the manuscript statistics only requires the R script and the per-subject phenotype CSVs.


How to use

Aggregated statistics (Python)

data/ contains the group-level summaries reported in the manuscript (per-group N, age, sex; performance per framing × opponent; sophistication, flexibility, perseveration; clinical-scale means). Variable schemas are in data/data_dictionary.md. To regenerate the four CSVs from the per-subject source CSVs (not in this repo):

TOMASD_SOURCE_DIR=/path/to/source/csvs python3 code/aggregate_stats.py

Cells with N < 5 are masked to limit re-identification risk.

Statistics (R)

The script expects eight per-subject CSV files (schema in data/data_dictionary.md). Place them in a folder and point the script at it:

TOMASD_SOURCE_DIR=/path/to/source/csvs Rscript code/statistical_tests.R

R packages required:

install.packages(c("dplyr","tidyverse","ggplot2","gridExtra","ggpubr",
                   "rstatix","car","broom","BayesFactor","sm","jtools",
                   "ggstance","broom.mixed"))

Note on figures. Figure 2 (group-level estimated model frequencies via RFX-BMC) is produced by the MATLAB pipeline (VBA_groupBMC in code/build_evidence_matrix.m), not by the R script. The R script reproduces the inferential statistics, regressions, and per-subject distributions that underlie Figures 3–4 and the reported ANOVAs/correlations. The script also contains substantial exploratory analyses beyond what is in the manuscript.

Computational models (MATLAB)

The MATLAB scripts under code/ document the model space and the group-level Bayesian model comparison used in the paper. They are included as a reference; they are not runnable as-is because the extraction utilities (goThroughHSfiles, goThroughPCfiles0, fitLearningAllModels) and the raw BrainUs CSV exports are not in this repository.

To inspect or adapt the pipeline you will need MATLAB with the VBA toolbox on the path:

addpath(genpath('/path/to/VBA-toolbox'));
addpath(genpath('code'));

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors