Early Trajectories of Resting-State EEG power in autistic children: a longitudinal study across language profiles.
The 2 matches
- [1] § Material and methods › Statistical analyses › Cross-sectional classification analysis ↔ rsEEG_ASD.ipynb, lines 36 to 143 · score 0.89 · GridSearchCV, SelectKBest, nested cross validation, feature selection, SVC, SVM · Report a mismatch
- [2] § Material and methods › Statistical analyses › Cross-sectional classification analysis ↔ rsEEG_ASD.ipynb, lines 36 to 143 · score 0.73 · nested cross validation, accuracy scores, confusion matrix, sample predictions, fold, shuffled · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 220 lines · 9.5 KB · no license · 2 matches
- # %%
- ####### --- Imports ---
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- import seaborn as sns
- import warnings
- import os
- import json
- from sklearn.model_selection import StratifiedKFold, GridSearchCV
- from sklearn.svm import SVC
- from sklearn.preprocessing import StandardScaler, LabelEncoder
- from sklearn.pipeline import Pipeline
- from sklearn.feature_selection import SelectKBest, f_classif
- from sklearn.metrics import accuracy_score, confusion_matrix, ConfusionMatrixDisplay
- # %%
- ####### --- Configuration ---
- # Use a dictionary to store parameters for easy modification.
- config = {
- 'load_results_if_exist': False, # Set to True to load saved results instead of re-running
- 'data_dir': '/Users/borghesani/Documents/5_Students/UNIGE_PhD/LATRECHE_Kenza/stats/',
- 'file_4_groups': 'New_NoICA_Cross-Sectional_New.xlsx',
- 'file_asd_td': 'New_NoICA_Cross-Sectional_New_ASD_TD.xlsx',
- 'results_dir': 'results',
- 'n_splits_outer': 5,
- 'n_splits_inner': 3,
- 'n_permutations': 10000,
- 'n_features_to_select': 500
- }
- warnings.filterwarnings('ignore')
- # %%
- ####### --- Helper Functions (Data Loading, ML, Plotting) ---
- def load_data(file_path, target_column='Dx'):
- """Loads data and prepares it for classification."""
- data = pd.read_excel(file_path)
- X = data.drop(columns=['ID', 'Dx', 'Visite']).values
- y_raw = data[target_column]
- le = LabelEncoder()
- y = le.fit_transform(y_raw)
- print(f"Loaded data from {file_path}")
- return X, y, le
- def run_classification(X, y, n_splits_outer, n_splits_inner, n_features):
- """
- Performs nested cross-validation to train and evaluate an SVM.
- Returns mean accuracy and out-of-sample predictions.
- """
- pipeline = Pipeline([
- ('scaler', StandardScaler()),
- ('feature_selection', SelectKBest(f_classif, k=n_features)),
- ('svm', SVC(kernel='linear', random_state=42))
- ])
- param_grid = {'svm__C': [0.01, 0.1, 1, 10, 100]}
- outer_cv = StratifiedKFold(n_splits=n_splits_outer, shuffle=True, random_state=42)
- accuracies = []
- all_y_test = []
- all_y_pred = []
- for train_idx, test_idx in outer_cv.split(X, y):
- X_train, X_test = X[train_idx], X[test_idx]
- y_train, y_test = y[train_idx], y[test_idx]
- inner_cv = StratifiedKFold(n_splits=n_splits_inner, shuffle=True, random_state=42)
- clf = GridSearchCV(estimator=pipeline, param_grid=param_grid, cv=inner_cv, scoring='accuracy')
- clf.fit(X_train, y_train)
- y_pred = clf.predict(X_test)
- accuracy = accuracy_score(y_test, y_pred)
- accuracies.append(accuracy)
- # Store true and predicted labels for the confusion matrix
- all_y_test.extend(y_test)
- all_y_pred.extend(y_pred)
- # Return mean accuracy and the collected out-of-sample labels
- return np.mean(accuracies), np.array(all_y_test), np.array(all_y_pred)
- def run_permutation_test(X, y, true_accuracy, n_permutations, n_splits_outer, n_splits_inner, n_features):
- """Performs a permutation test to assess statistical significance."""
- permutation_accuracies = []
- for i in range(n_permutations):
- print(f"Running permutation {i+1}/{n_permutations}", end="\r")
- y_shuffled = np.random.permutation(y)
- # Call the updated function but only store the accuracy
- perm_accuracy, _, _ = run_classification(X, y_shuffled, n_splits_outer, n_splits_inner, n_features)
- permutation_accuracies.append(perm_accuracy)
- print("\nPermutation testing complete.")
- p_value = np.mean(np.array(permutation_accuracies) >= true_accuracy)
- return p_value, permutation_accuracies
- def plot_permutation_results(true_accuracy, permutation_accuracies, p_value, title, filename=None):
- """Plots the permutation distribution and saves the figure."""
- cleaned_scores = [score for score in permutation_accuracies if score is not None]
- if not cleaned_scores:
- print(f"Warning: Cannot generate plot for '{title}' because no valid permutation scores were found.")
- return
- final_scores = np.array(cleaned_scores, dtype=float)
- fig, ax = plt.subplots(figsize=(10, 6))
- sns.histplot(data=final_scores, bins=30, kde=False, label='Permutation Accuracies', ax=ax)
- ax.axvline(true_accuracy, color='red', linestyle='--', linewidth=2, label=f'True Accuracy = {true_accuracy:.2f}')
- ax.set_title(title)
- ax.set_xlabel('Accuracy')
- ax.set_ylabel('Frequency')
- ax.legend()
- ax.text(0.05, 0.9, f'p-value = {p_value:.4f}', transform=ax.transAxes,
- bbox=dict(boxstyle='round,pad=0.5', fc='wheat', alpha=0.5))
- if filename:
- plt.savefig(filename, bbox_inches='tight')
- print(f"Saved permutation plot to {filename}")
- plt.close(fig)
- def plot_confusion_matrix_for_analysis(y_true, y_pred, display_labels, title, filename=None):
- """ Plots a confusion matrix from pre-computed labels and saves the figure."""
- cm = confusion_matrix(y_true, y_pred)
- disp = ConfusionMatrixDisplay(confusion_matrix=cm, display_labels=display_labels)
- fig, ax = plt.subplots(figsize=(8, 6))
- disp.plot(ax=ax, cmap='Blues')
- ax.set_title(title)
- if filename:
- plt.savefig(filename, bbox_inches='tight')
- print(f"Saved confusion matrix to {filename}")
- plt.close(fig)
- def save_results_to_json(filename, analysis_name, accuracy, p_value, perm_scores, y_true, y_pred, class_labels):
- """ Saves detailed results, including data for the confusion matrix."""
- results_data = {
- 'analysis_name': analysis_name,
- 'true_accuracy': accuracy,
- 'p_value': p_value,
- 'permutation_accuracies': np.array(perm_scores, dtype=float).tolist(),
- 'y_true': y_true.tolist(),
- 'y_pred': y_pred.tolist(),
- 'class_labels': class_labels.tolist()
- }
- with open(filename, 'w') as f:
- json.dump(results_data, f, indent=4)
- print(f"Saved detailed results for '{analysis_name}' to {filename}")
- def load_results_from_json(filename):
- """Loads detailed results from a JSON file."""
- with open(filename, 'r') as f:
- return json.load(f)
- # %%
- def main():
- """Main function to run classification analyses, with option to load existing results."""
- os.makedirs(config['results_dir'], exist_ok=True)
- analyses = [
- {'name': 'ASD_vs_TD', 'file': config['file_asd_td'], 'title': 'ASD vs. TD'},
- {'name': '4_Groups', 'file': config['file_4_groups'], 'title': '4 Language Profiles'}
- ]
- for analysis in analyses:
- print(f"\n--- Starting Analysis: {analysis['title']} ---")
- analysis_name = analysis['name']
- json_path = os.path.join(config['results_dir'], f'results_{analysis_name}.json')
- if config['load_results_if_exist'] and os.path.exists(json_path):
- print(f"Found existing results. Loading from {json_path}...")
- # This part for loading results remains the same
- results = load_results_from_json(json_path)
- print(f"Loaded Results for {results['analysis_name']}: Accuracy={results['true_accuracy']:.4f}, p-value={results['p_value']:.4f}\n")
- plot_permutation_results(
- results['true_accuracy'],
- results['permutation_accuracies'],
- results['p_value'],
- f"Permutation Test Results: {analysis['title']}",
- filename=os.path.join(config['results_dir'], f"permutation_plot_{analysis_name}.png")
- )
- plot_confusion_matrix_for_analysis(
- results['y_true'],
- results['y_pred'],
- results['class_labels'],
- f"Confusion Matrix: {analysis['title']} (from Cross-Validation)",
- filename=os.path.join(config['results_dir'], f"confusion_matrix_{analysis_name}.png")
- )
- print("Plotting complete.")
- else:
- if config['load_results_if_exist']:
- print(f"No results file found at {json_path}. Running full analysis...")
- X, y, le = load_data(os.path.join(config['data_dir'], analysis['file']))
- # Run main analysis and get out-of-sample predictions
- true_accuracy, y_true_cv, y_pred_cv = run_classification(X, y, config['n_splits_outer'], config['n_splits_inner'], config['n_features_to_select'])
- p_value, perms = run_permutation_test(X, y, true_accuracy, config['n_permutations'], config['n_splits_outer'], config['n_splits_inner'], config['n_features_to_select'])
- print(f"Results for {analysis_name}: Accuracy={true_accuracy:.4f}, p-value={p_value:.4f}\n")
- # The block for generating a separate confusion matrix is now removed.
- # We use y_true_cv and y_pred_cv directly.
- # Save all results and plot
- save_results_to_json(json_path, analysis_name, true_accuracy, p_value, perms, y_true_cv, y_pred_cv, le.classes_)
- plot_permutation_results(
- true_accuracy, perms, p_value,
- f"Permutation Test Results: {analysis['title']}",
- filename=os.path.join(config['results_dir'], f"permutation_plot_{analysis_name}.png")
- )
- # Plot confusion matrix using the cross-validated predictions
- plot_confusion_matrix_for_analysis(
- y_true_cv, y_pred_cv, le.classes_,
- f"Confusion Matrix: {analysis['title']} (from Cross-Validation)",
- filename=os.path.join(config['results_dir'], f"confusion_matrix_{analysis_name}.png")
- )
- if __name__ == '__main__':
- main()
- # %%
- # %%
rsEEG_ASD.ipynb at commit ad9bfcf, no license · at the source
Overview
- Autism Brain and Behavior Lab, Faculty of Medicine, University of Geneva,Geneva, Switzerland
- Division of Adult Psychiatry, Department of Psychiatry, University Hospitals of Geneva,Geneva, Switzerland
- Department of Psychiatry, University School of Medicine, Geneva, Switzerland
- Cognitive Neuroimaging Unit, Université Paris Saclay, NeuroSpin center,Gif-sur-Yvette, France
- Department of Developmental Psychology and Socialisation and Department of Neuroscience, University of Padova,Padova, Italy
- Neurobiology of Concepts Expression Laboratory, Faculty of Psychology and Educational Sciences, University of Geneva,Geneva, Switzerland
Abstract
Language development in autism spectrum disorder (ASD) is heterogeneous, ranging from subtle differences to significant delays. In previous work, we identified three autistic language profiles in early childhood: Language Unimpaired (LU), Language Impaired (LI), and Minimally-Verbal (MV). While these profiles show distinct vocabulary, grammar, and pragmatic development, understanding their underlying neural correlates is essential to predict outcomes and develop targeted interventions. Here, we examined whole-brain resting-state EEG power across five canonical frequency bands in a longitudinal sample comprising 66 typically developing (TD) children and 122 autistic children (ages 1.6–6.0 years), yielding 358 time points. Within the ASD group, 61 children belonged to the LU profile, 44 children to LI, and 17 children to MV. Compared to TD peers, autistic children showed increased power in low-frequency (delta, theta) and high-frequency bands (beta, gamma). Gamma power varied by autistic language profile, with the highest levels in MV children. Moreover, gamma power within ASD followed a quadratic trajectory in relation to word combination acquisition, peaking around the time of acquisition and decreasing afterward. This pattern suggests a dynamic, compensatory mechanism supporting the transition to phrase speech, which is a critical milestone toward functional speech that may predict language outcomes in ASD.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 2 matches between paragraphs and lines of code.
NoCe-Lab/rsEEG_ASD
ad9bfcfc4506d6e40745dd862fd5661c55d1047e, 6 July 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
1 file
- rsEEG_ASD.ipynb, Jupyter, 220 lines, 2 matches
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 1 script, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
The datasets analyzed during the current study are not publicly available due to privacy and ethical restrictions but are available from the corresponding author upon reasonable request.
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 6 authors, 2 keywords, 13 MeSH terms, 2 funders, 48 references.
Cite
This paper
Latrèche, K., Godel, M., Flò, A., Journal, F., Borghesani, V., & Schaer, M. (2026). Early Trajectories of Resting-State EEG power in autistic children: a longitudinal study across language profiles. Translational psychiatry, 16(1), 371. https://
BibTeX
@article{latreche2026ear
author = {Latrèche, Kenza and Godel, Michel and Flò, Ana and Journal, Fiona and Borghesani, Valentina and Schaer, Marie},
title = {{Early Trajectories of Resting-State EEG power in autistic children: a longitudinal study across language profiles}},
journal = {Translational psychiatry},
year = {2026},
month = may,
volume = {16},
number = {1},
pages = {371},
publisher = {Nature Publishing Group},
issn = {2158-3188},
doi = {10.1038/
url = {https://
pmid = {42185252},
pmcid = {PMC13385626}
}
RIS
TY - JOUR
AU - Latrèche, Kenza
AU - Godel, Michel
AU - Flò, Ana
AU - Journal, Fiona
AU - Borghesani, Valentina
AU - Schaer, Marie
TI - Early Trajectories of Resting-State EEG power in autistic children: a longitudinal study across language profiles
T2 - Translational psychiatry
J2 - Transl Psychiatry
PY - 2026
DA - 2026/
VL - 16
IS - 1
SP - 371
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Early Trajectories of Resting-State EEG power in autistic children: a longitudinal study across language profiles",
"container-title": "Translational psychiatry",
"author": [
{
"family": "Latrèche",
"given": "Kenza"
},
{
"family": "Godel",
"given": "Michel"
},
{
"family": "Flò",
"given": "Ana"
},
{
"family": "Journal",
"given": "Fiona"
},
{
"family": "Borghesani",
"given": "Valentina"
},
{
"family": "Schaer",
"given": "Marie"
}
],
"container-title-short":
"volume": "16",
"issue": "1",
"page": "371",
"DOI": "10.1038/
"PMID": "42185252",
"PMCID": "PMC13385626",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
25
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1111/cge.70204 [code]
- Phenotypic Characterization of Five Children With PACS1-NDD: Longitudinal Insights Into Development, Behavior, and Brain.Journal: Clinical geneticsIn common: autism, 5 references, 3 authors
- [2] doi:10.7554/elife.109901
- Infants at high and low likelihood for autism show different EEG developmental trajectories in speech tracking and statistical learning.Journal: eLifeIn common: autism, EEG, 8 references, 2 authors
- [3] doi:10.1186/s13229-025-00700-1 [code]
- Resting state aperiodic and periodic EEG activity in preschool-aged autistic children: differences from neurotypical peers and links to language skills.Journal: Molecular autismIn common: seaborn, scikit-learn, pandas, 2 other tools, autism, EEG, 10 references
- [4] doi:10.1186/s11689-026-09685-1 [code]
- Beta power as a neural correlate of sensory features in autistic individuals.Journal: Journal of neurodevelopmental disordersIn common: seaborn, pandas, Matplotlib, 1 other tool, autism, EEG, 6 references
- [5] doi:10.1038/s41398-023-02681-2
- Resting-state EEG power differences in autism spectrum disorder: a systematic review and meta-analysis.Journal: Translational psychiatryIn common: autism, EEG, 7 references
- [6] doi:10.1371/journal.pone.0308388 [code]
- Video-audio neural network ensemble for comprehensive screening of autism spectrum disorder in young children.Journal: PloS oneIn common: scikit-learn, pandas, Matplotlib, 1 other tool, autism, 2 references, author Marie Schaer
- [7] doi:10.1038/s41598-026-42120-y [code]
- Qualitative EEG abnormalities in ASD reflect inhibition-dominated brain dynamics.Journal: Scientific reportsIn common: seaborn, pandas, Matplotlib, 1 other tool, autism, EEG, 5 references
- [8] doi:10.1016/j.dcn.2026.101681 [code]
- Age and gender-related neurophysiological changes in sleep and wake states during childhood.Journal: Developmental cognitive neuroscienceIn common: seaborn, scikit-learn, pandas, 2 other tools, EEG, author Fiona Journal
- [9] doi:10.1186/s11689-022-09456-8
- EEG resting-state functional connectivity: evidence for an imbalance of external/
internal information integration in autism. Journal: Journal of neurodevelopmental disordersIn common: autism, EEG, 6 references - [10] doi:10.1162/imag.a.1256 [code]
- Gamer in the scanner: Event-related analysis of fMRI activity during retro videogame play guided by automated annotations of game content.Journal: Imaging neuroscience (Cambridge, Mass.)In common: seaborn, scikit-learn, pandas, 2 other tools, author Valentina Borghesani
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 1 script, and 2 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:b2b333e5b65a8932…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41398-026-04132-0)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41398-026-04132-0.svg
:target: https://openscicode.org/badge/doi/10.1038/s41398-026-04132-0
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41398-026-04132-0"><img src="https://openscicode.org/badge/doi/10.1038/s41398-026-04132-0.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
