Temporally structured motor and auditory representations in covert syllable production.
The 14 matches
- [1] § Materials and Methods › Decoding in Source Space. ↔ scripts/extract_vals_ROIs.py, lines 124 to 140 · score 0.86 · dorsal motor, pSTG, pSTS, aparc_sub, ventral motor, pars · Report a mismatch
- [2] § Results › Motor and Auditory Representations During Inner Speaking. ↔ scripts/extract_vals_ROIs.py, lines 124 to 140 · score 0.79 · aSTG, dorsal motor, pSTG, pSTS, ventral motor, SMG · Report a mismatch
- [3] § Results › Motor and Auditory Representations During Inner Speaking. ↔ scripts/Fig3GH.py, lines 33 to 40 · score 0.75 · p.Tri, aSTG, pSTG, pSTS, INS, op · Report a mismatch
- [4] § Materials and Methods › Decoding in Source Space. ↔ scripts/Source_space_decoding.py, lines 400 to 460 · score 0.71 · logistic regression, cross validation, source space, solver, stratified, classifier · Report a mismatch
- [5] § Materials and Methods › Cosine Similarity Analysis. ↔ scripts/Fig1E_cosine_similarity.py, lines 295 to 386 · score 0.70 · sided sign flip, cosine, template, separability, topographies, diagonal · Report a mismatch
- [6] § Materials and Methods › Temporal Generalization. ↔ scripts/Source_space_decoding.py, lines 400 to 460 · score 0.68 · logistic regression, cross validation, folds, solver, stratified, class · Report a mismatch
- [7] § Materials and Methods › Decoding in Source Space. ↔ scripts/Fig3C.py, lines 22 to 24 · score 0.66 · pSTG, pSTS, ventral motor, vMC, ROI, Figure 3 · Report a mismatch
- [8] § Results › A Sequence of Neural Processes Underlies Inner Speaking. ↔ scripts/Fig1E_cosine_similarity.py, lines 529 to 588 · score 0.66 · hybrid matrix, upper triangle, lower triangle, cosine, topographies, permutation · Report a mismatch
- [9] § Results › A Sequence of Neural Processes Underlies Inner Speaking. ↔ scripts/Fig1F_decoding_source_cluster_peaks_Covert.py, lines 32 to 41 · score 0.57 · 356–433 ms, 356 ms, covert, peak, decoded, Figure 1 · Report a mismatch
- [10] § Results › Passive Viewing vs. Covert Speech: Shared and Distinct Neural Processes. ↔ scripts/Fig1F_decoding_source_cluster_peaks_Covert.py, lines 32 to 41 · score 0.57 · 356–433 ms, 356 ms, Covert, peak, decoding, Figure 1 · Report a mismatch
- [11] § Results › Passive Viewing vs. Covert Speech: Shared and Distinct Neural Processes. ↔ scripts/Fig1D_evokeds.py, lines 59 to 77 · score 0.56 · 356–433 ms, 356 ms, Covert, peak, Figure 1 · Report a mismatch
- [12] § Results › A Sequence of Neural Processes Underlies Inner Speaking. ↔ scripts/Fig1D_evokeds.py, lines 59 to 77 · score 0.56 · 356–433 ms, 356 ms, peak, covert, Figure 1 · Report a mismatch
- [13] § Materials and Methods › Temporal Generalization. ↔ scripts/Sensor_space_decoding.py, lines 90 to 98 · score 0.53 · logistic regression, lbfgs, solver, classifier, decoding · Report a mismatch
- [14] § Results › Passive Viewing vs. Covert Speech: Shared and Distinct Neural Processes. ↔ scripts/Sensor_space_decoding.py, lines 291 to 350 · score 0.51 · space decoding, cross validation, ROC AUC, shuffled, stratified, diagonal · 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
Python · 853 lines · 25 KB · no license · 2 matches
- from pathlib import Path
- import numpy as np
- import pandas as pd
- import mne
- from mne import compute_source_morph
- from mne.stats import permutation_cluster_1samp_test
- from scipy import stats
- # ============================================================
- # DATASET SELECTION
- # ============================================================
- # Options:
- # "consonants"
- # "vowels"
- dataset_name = "vowels"
- # ============================================================
- # DATASET-SPECIFIC SETTINGS
- # ============================================================
- dataset_configs = {
- "consonants": {
- "mri_path": Path(
- "/.../mri_consonants" # <-- specify path to mri_consonants folder
- ),
- "data_file": Path(
- "/.../result_Covert.npy" # <-- specify path to result_Covert.py
- ),
- "out_dir": Path(
- "/.../" # <-- specify output folder
- ),
- "subject_codes": [
- "S01", "S02", "S03", "S04", "S05", "S06", "S07", "S08", "S09", "S10", "S11",
- "S12", "S13", "S14", "S15", "S16", "S17", "S18", "S19", "S20", "S21", "S22"
- ],
- "peaks_interest": [3, 4],
- "condition_label": "Covert",
- "contrast_labels": ["pa_vs_ta", "pa_vs_ka", "ta_vs_ka"],
- },
- "vowels": {
- "mri_path": Path(
- "/.../mri_vowels" # <-- specify path to mri_vowels folder
- ),
- "data_file": Path(
- "/.../result_tatuti_Covert.npy" # <-- specify path to result_tatuti_Covert.py
- ),
- "out_dir": Path(
- "/.../" # <-- specify output folder
- ),
- "subject_codes": [
- "S01", "S02", "S03", "S04", "S05", "S06", "S07", "S08", "S09"
- ],
- # Zero-indexed peak indices.
- "peaks_interest": [1, 2],
- "condition_label": "tatuti_Covert",
- "contrast_labels": ["ta_vs_tu", "ta_vs_ti", "tu_vs_ti"],
- },
- }
- if dataset_name not in dataset_configs:
- raise ValueError(
- f"dataset_name must be one of {list(dataset_configs.keys())}, "
- f"but got {dataset_name}"
- )
- cfg = dataset_configs[dataset_name]
- mri_path = cfg["mri_path"]
- data_file = cfg["data_file"]
- out_dir = cfg["out_dir"]
- subject_codes = cfg["subject_codes"]
- peaks_interest = cfg["peaks_interest"]
- condition_label = cfg["condition_label"]
- original_contrast_labels = cfg["contrast_labels"]
- out_dir.mkdir(parents=True, exist_ok=True)
- mne.set_config("SUBJECTS_DIR", str(mri_path), set_env=True)
- # ============================================================
- # GENERAL SETTINGS
- # ============================================================
- # Dataset shape expected:
- # subjects x peaks x contrasts x sources
- expected_n_sources = 5124
- # Set to True to average across contrasts before statistics/extraction.
- # Set to False to compute everything separately for each contrast.
- average_across_contrasts = False
- # Source-space settings
- subject_spacing = "ico4"
- fsaverage_stats_spacing = "ico6"
- # Statistics
- chance_level = 0.5
- p_threshold = 0.05
- cluster_pval_thresh = 0.05
- n_permutations = 1000
- cluster_seed = 23
- n_jobs = 5
- # Hemisphere / parcellation
- hemi = "lh"
- annotation = "aparc_sub"
- # Optional ROI visualization.
- # Keep False during extraction. If True, use fresh fsaverage labels for plotting.
- plot_rois = False
- # ============================================================
- # ROI DEFINITIONS
- # ============================================================
- # These are label indices in fsaverage aparc_sub, left hemisphere.
- aparc_dict = {
- "pSTS": [0, 1, 2],
- "insula": np.arange(42, 49),
- "pars triang": [104, 105, 106],
- "pars operc": [98, 99, 100, 101],
- "ventral SS": np.arange(111, 116),
- "dorsal SS": np.arange(116, 124),
- "ventral motor": np.arange(129, 136),
- "dorsal motor": np.arange(136, 144),
- "pSTG": [201, 204, 205, 206, 207, 208],
- "aSTG": [202, 203, 209, 210, 211],
- "SMG": np.arange(212, 222),
- "Aud": [223, 224],
- }
- roi_names = list(aparc_dict.keys())
- # ============================================================
- # LOAD SOURCE DECODING DATA
- # ============================================================
- if not data_file.exists():
- raise FileNotFoundError(f"Could not find data file: {data_file}")
- print("=" * 80)
- print(f"Dataset: {dataset_name}")
- print(f"MRI path: {mri_path}")
- print(f"Data file: {data_file}")
- print(f"Output directory: {out_dir}")
- print(f"Average across contrasts: {average_across_contrasts}")
- all_scores = np.load(data_file)
- print(f"\nLoaded data shape: {all_scores.shape}")
- if all_scores.ndim != 4:
- raise ValueError(
- f"Expected 4D array with shape "
- f"(subjects, peaks, contrasts, sources), got {all_scores.shape}"
- )
- if all_scores.shape[0] != len(subject_codes):
- raise ValueError(
- f"Subject mismatch: data has {all_scores.shape[0]} subjects, "
- f"but subject_codes has {len(subject_codes)} entries."
- )
- if all_scores.shape[-1] != expected_n_sources:
- raise ValueError(
- f"Source mismatch: expected {expected_n_sources} sources, "
- f"but data has {all_scores.shape[-1]} sources."
- )
- if max(peaks_interest) >= all_scores.shape[1]:
- raise ValueError(
- f"peaks_interest includes index {max(peaks_interest)}, "
- f"but data only has {all_scores.shape[1]} peaks."
- )
- n_original_contrasts = all_scores.shape[2]
- if len(original_contrast_labels) != n_original_contrasts:
- original_contrast_labels = [
- f"contrast_{i}" for i in range(n_original_contrasts)
- ]
- if average_across_contrasts:
- # Shape: subjects x peaks x 1 x sources
- all_scores_for_analysis = all_scores.mean(axis=2, keepdims=True)
- contrast_labels = ["mean_across_contrasts"]
- else:
- # Shape: subjects x peaks x contrasts x sources
- all_scores_for_analysis = all_scores.copy()
- contrast_labels = original_contrast_labels
- n_contrasts_for_analysis = all_scores_for_analysis.shape[2]
- print(f"Data used for analysis: {all_scores_for_analysis.shape}")
- print(f"Contrast labels: {contrast_labels}")
- print(f"Peaks of interest: {peaks_interest}")
- # ============================================================
- # SET UP FSAVERAGE SOURCE SPACES
- # ============================================================
- print("\nSetting up fsaverage source spaces...")
- src_fsaverage_ico4 = mne.setup_source_space(
- subject="fsaverage",
- spacing="ico4",
- subjects_dir=mri_path,
- add_dist=False,
- verbose="error",
- )
- src_fsaverage_ico6 = mne.setup_source_space(
- subject="fsaverage",
- spacing="ico6",
- subjects_dir=mri_path,
- add_dist=False,
- verbose="error",
- )
- n_sources_hemi = len(src_fsaverage_ico6[0]["vertno"])
- n_sources_fsaverage_ico6 = (
- len(src_fsaverage_ico6[0]["vertno"]) +
- len(src_fsaverage_ico6[1]["vertno"])
- )
- print(f"fsaverage ico6 sources per hemisphere: {n_sources_hemi}")
- print(f"fsaverage ico6 total sources: {n_sources_fsaverage_ico6}")
- adjacency_lh = mne.spatial_src_adjacency(
- src_fsaverage_ico6[:1],
- dist=None,
- verbose=None,
- )
- # ============================================================
- # READ LABELS FOR UNKNOWN/NONCORTICAL MASKING
- # ============================================================
- print("\nReading fsaverage aparc_sub labels for unknown/noncortical masking...")
- labels_lh_for_unknown = mne.read_labels_from_annot(
- subject="fsaverage",
- parc=annotation,
- hemi="lh",
- subjects_dir=mri_path,
- )
- labels_rh_for_unknown = mne.read_labels_from_annot(
- subject="fsaverage",
- parc=annotation,
- hemi="rh",
- subjects_dir=mri_path,
- )
- unknown_lh = [
- label for label in labels_lh_for_unknown
- if label.name == "unknown-lh"
- ]
- unknown_rh = [
- label for label in labels_rh_for_unknown
- if label.name == "unknown-rh"
- ]
- if len(unknown_lh) != 1:
- raise RuntimeError(f"Expected one unknown-lh label, found {len(unknown_lh)}")
- if len(unknown_rh) != 1:
- raise RuntimeError(f"Expected one unknown-rh label, found {len(unknown_rh)}")
- # ------------------------------------------------------------
- # Deal with unknown/noncortical labels
- # ------------------------------------------------------------
- print("\nMorphing unknown/noncortical labels to fsaverage6...")
- noncortical_lh = unknown_lh[0].morph(
- subject_from="fsaverage",
- subject_to="fsaverage6",
- smooth=0,
- grade=None,
- subjects_dir=mri_path,
- n_jobs=n_jobs,
- verbose=None,
- )
- noncortical_rh = unknown_rh[0].morph(
- subject_from="fsaverage",
- subject_to="fsaverage6",
- smooth=0,
- grade=None,
- subjects_dir=mri_path,
- n_jobs=n_jobs,
- verbose=None,
- )
- to_remove_lh = noncortical_lh.vertices[
- noncortical_lh.vertices < n_sources_hemi
- ]
- to_remove_rh = noncortical_rh.vertices[
- noncortical_rh.vertices < n_sources_hemi
- ]
- to_remove_all = np.concatenate(
- [
- to_remove_lh,
- to_remove_rh + n_sources_hemi,
- ]
- )
- print(f"Unknown/noncortical LH sources to remove: {len(to_remove_lh)}")
- print(f"Unknown/noncortical RH sources to remove: {len(to_remove_rh)}")
- # ============================================================
- # READ FRESH LABELS FOR ROI EXTRACTION AND MORPH TO FSAVERAGE6
- # ============================================================
- print("\nRe-reading fsaverage LH aparc_sub labels for ROI extraction...")
- labels_lh_for_extraction = mne.read_labels_from_annot(
- subject="fsaverage",
- parc=annotation,
- hemi="lh",
- subjects_dir=mri_path,
- )
- print("\nMorphing LH aparc_sub ROI labels to fsaverage6...")
- for label in labels_lh_for_extraction:
- label.morph(
- subject_from="fsaverage",
- subject_to="fsaverage6",
- smooth=0,
- grade=None,
- subjects_dir=mri_path,
- n_jobs=n_jobs,
- verbose=None,
- )
- n_labels_lh = len(labels_lh_for_extraction)
- print(f"Number of LH labels for extraction: {n_labels_lh}")
- # ============================================================
- # OPTIONAL ROI VISUALIZATION
- # ============================================================
- if plot_rois:
- Brain = mne.viz.get_brain_class()
- labels_lh_for_plotting = mne.read_labels_from_annot(
- subject="fsaverage",
- parc=annotation,
- hemi="lh",
- subjects_dir=mri_path,
- )
- brain = Brain(
- "fsaverage",
- "lh",
- subjects_dir=mri_path,
- cortex="low_contrast",
- background="white",
- size=(800, 600),
- )
- rng = np.random.default_rng(0)
- for roi_name, label_indices in aparc_dict.items():
- color = rng.random(3)
- for label_idx in label_indices:
- brain.add_label(
- labels_lh_for_plotting[label_idx],
- borders=False,
- color=color,
- )
- # ============================================================
- # PREALLOCATE OUTPUT ARRAYS
- # ============================================================
- n_subjects = len(subject_codes)
- n_peaks_interest = len(peaks_interest)
- n_rois = len(aparc_dict)
- # Subject-level values per aparc_sub label.
- # Shape: subjects x peaks_interest x contrasts x labels
- all_data_labels = np.full(
- (n_subjects, n_peaks_interest, n_contrasts_for_analysis, n_labels_lh),
- np.nan,
- dtype=float,
- )
- # Number of significant decoding sources per aparc_sub label.
- # Shape: peaks_interest x contrasts x labels
- num_dec_sources_label = np.zeros(
- (n_peaks_interest, n_contrasts_for_analysis, n_labels_lh),
- dtype=float,
- )
- # Percent significant sources per ROI.
- # Shape: peaks_interest x contrasts x ROIs
- final_results_percent = np.full(
- (n_peaks_interest, n_contrasts_for_analysis, n_rois),
- np.nan,
- dtype=float,
- )
- # Mean decoding values per ROI.
- # Shape: subjects x peaks_interest x contrasts x ROIs
- value_results = np.full(
- (n_subjects, n_peaks_interest, n_contrasts_for_analysis, n_rois),
- np.nan,
- dtype=float,
- )
- # ============================================================
- # CLUSTER-BASED SOURCE STATISTICS AND LABEL EXTRACTION
- # ============================================================
- t_threshold = -stats.distributions.t.ppf(
- p_threshold / 2.0,
- n_subjects - 1,
- )
- print("\nCluster-forming t-threshold:")
- print(f" p_threshold = {p_threshold}")
- print(f" t_threshold = {t_threshold:.4f}")
- for peak_out_idx, peak_idx in enumerate(peaks_interest):
- for contrast_out_idx, contrast_label in enumerate(contrast_labels):
- print("\n" + "=" * 80)
- print(
- f"Processing peak index {peak_idx} "
- f"({peak_out_idx + 1}/{n_peaks_interest}) | "
- f"{contrast_label}"
- )
- all_sts_data = []
- # ----------------------------------------------------
- # Morph each subject's ico4 source data to fsaverage ico6
- # ----------------------------------------------------
- for subject_idx, subject_code in enumerate(subject_codes):
- print(
- f" Morphing subject {subject_idx + 1}/{n_subjects}: "
- f"{subject_code}"
- )
- src_subject = mne.setup_source_space(
- subject=subject_code,
- spacing=subject_spacing,
- subjects_dir=mri_path,
- add_dist=False,
- verbose="error",
- )
- subject_values = all_scores_for_analysis[
- subject_idx,
- peak_idx,
- contrast_out_idx,
- :
- ]
- stc_subject = mne.SourceEstimate(
- subject_values,
- vertices=[
- src_subject[0]["vertno"],
- src_subject[1]["vertno"],
- ],
- tmin=0,
- tstep=1,
- subject=subject_code,
- verbose=None,
- )
- morph = compute_source_morph(
- src_subject,
- subject_from=subject_code,
- subject_to="fsaverage",
- spacing=6,
- subjects_dir=mri_path,
- verbose="error",
- )
- stc_fsaverage = morph.apply(stc_subject)
- all_sts_data.append(stc_fsaverage.data)
- all_sts_data = np.squeeze(np.asarray(all_sts_data, dtype=float))
- print(f" Morphed data shape: {all_sts_data.shape}")
- if all_sts_data.shape != (n_subjects, n_sources_fsaverage_ico6):
- raise RuntimeError(
- f"Unexpected morphed data shape: {all_sts_data.shape}. "
- f"Expected {(n_subjects, n_sources_fsaverage_ico6)}"
- )
- # ----------------------------------------------------
- # Remove unknown/noncortical sources by setting them to chance
- # ----------------------------------------------------
- all_sts_data_clean = all_sts_data.copy()
- all_sts_data_clean[:, to_remove_all] = chance_level
- # Data for statistics is centered on chance.
- stc_fsaverage_allsubj_4stats = all_sts_data_clean - chance_level
- # ----------------------------------------------------
- # LH statistics
- # ----------------------------------------------------
- data_lh = stc_fsaverage_allsubj_4stats[:, :n_sources_hemi].copy()
- # Avoid NaNs in permutation_cluster_1samp_test.
- # Removed sources are set to 0, so they should not pass the positive threshold.
- data_lh[:, to_remove_lh] = 0.0
- print(" Running LH cluster test...")
- t_obs_lh, clusters_lh, cluster_pv_lh, h0_lh = permutation_cluster_1samp_test(
- data_lh,
- n_permutations=n_permutations,
- out_type="indices",
- threshold=t_threshold,
- adjacency=adjacency_lh,
- tail=1,
- seed=cluster_seed,
- verbose=True,
- )
- good_cluster_inds_lh = np.where(cluster_pv_lh < cluster_pval_thresh)[0]
- print(f" Significant LH clusters: {good_cluster_inds_lh}")
- # ----------------------------------------------------
- # Collect significant source indices
- # ----------------------------------------------------
- sig_sources_lh = []
- for cluster_idx in good_cluster_inds_lh:
- sig_sources_lh.append(clusters_lh[cluster_idx][0])
- if len(sig_sources_lh) == 0:
- print(" No significant LH sources for this peak/contrast.")
- continue
- sig_sources_lh = np.unique(np.concatenate(sig_sources_lh))
- print(f" Number of significant LH source indices: {len(sig_sources_lh)}")
- # ----------------------------------------------------
- # Extract label-wise values
- # ----------------------------------------------------
- for label_idx, label in enumerate(labels_lh_for_extraction):
- label_vertices = label.vertices
- within_label_idx = np.intersect1d(
- label_vertices,
- sig_sources_lh,
- )
- n_intersect = len(within_label_idx)
- num_dec_sources_label[
- peak_out_idx,
- contrast_out_idx,
- label_idx,
- ] = n_intersect
- if n_intersect > 0:
- # Add chance level back because data_lh is centered on chance.
- all_data_labels[
- :,
- peak_out_idx,
- contrast_out_idx,
- label_idx,
- ] = np.nanmean(
- data_lh[:, within_label_idx] + chance_level,
- axis=1,
- )
- print(
- f" Label {label_idx:03d} | {label.name:35s} | "
- f"n significant sources = {n_intersect}"
- )
- # ============================================================
- # ROI-LEVEL PERCENT SIGNIFICANT SOURCES
- # ============================================================
- print("\n" + "=" * 80)
- print("Computing ROI-level percent significant sources...")
- for peak_out_idx, peak_idx in enumerate(peaks_interest):
- for contrast_out_idx, contrast_label in enumerate(contrast_labels):
- for roi_idx, roi_name in enumerate(roi_names):
- label_indices = np.asarray(aparc_dict[roi_name], dtype=int)
- label_percents = []
- for label_idx in label_indices:
- n_label_vertices = len(labels_lh_for_extraction[label_idx].vertices)
- if n_label_vertices == 0:
- continue
- label_percent = (
- num_dec_sources_label[
- peak_out_idx,
- contrast_out_idx,
- label_idx,
- ] / n_label_vertices
- )
- label_percents.append(label_percent)
- if len(label_percents) > 0:
- # This matches the original script: mean of sublabel percentages.
- final_results_percent[
- peak_out_idx,
- contrast_out_idx,
- roi_idx,
- ] = np.nanmean(label_percents)
- print(
- f" Peak {peak_idx} | {contrast_label:22s} | {roi_name:15s} | "
- f"percent = "
- f"{final_results_percent[peak_out_idx, contrast_out_idx, roi_idx]:.4f}"
- )
- # ============================================================
- # ROI-LEVEL DECODING VALUES
- # ============================================================
- print("\n" + "=" * 80)
- print("Computing ROI-level decoding values...")
- for peak_out_idx, peak_idx in enumerate(peaks_interest):
- for contrast_out_idx, contrast_label in enumerate(contrast_labels):
- for roi_idx, roi_name in enumerate(roi_names):
- label_indices = np.asarray(aparc_dict[roi_name], dtype=int)
- value_results[
- :,
- peak_out_idx,
- contrast_out_idx,
- roi_idx,
- ] = np.nanmean(
- all_data_labels[
- :,
- peak_out_idx,
- contrast_out_idx,
- label_indices,
- ],
- axis=1,
- )
- print(
- f" Peak {peak_idx} | {contrast_label:22s} | {roi_name:15s} | "
- f"group mean value = "
- f"{np.nanmean(value_results[:, peak_out_idx, contrast_out_idx, roi_idx]):.4f}"
- )
- # ============================================================
- # SAVE OUTPUTS
- # ============================================================
- contrast_mode_label = (
- "contrast_average"
- if average_across_contrasts
- else "contrast_separate"
- )
- base = f"roi_extraction_{dataset_name}_{condition_label}_{contrast_mode_label}"
- np.save(out_dir / f"{base}_all_data_labels.npy", all_data_labels)
- np.save(out_dir / f"{base}_num_dec_sources_label.npy", num_dec_sources_label)
- np.save(out_dir / f"{base}_percent_sig_sources.npy", final_results_percent)
- np.save(out_dir / f"{base}_roi_values.npy", value_results)
- np.savez(
- out_dir / f"{base}_all_outputs.npz",
- all_data_labels=all_data_labels,
- num_dec_sources_label=num_dec_sources_label,
- roi_percent_sig_sources=final_results_percent,
- roi_values=value_results,
- peaks_interest=np.asarray(peaks_interest),
- roi_names=np.asarray(roi_names, dtype=object),
- subject_codes=np.asarray(subject_codes, dtype=object),
- contrast_labels=np.asarray(contrast_labels, dtype=object),
- dataset_name=dataset_name,
- condition_label=condition_label,
- average_across_contrasts=average_across_contrasts,
- )
- # ------------------------------------------------------------
- # Save percent-significant sources, long format
- # ------------------------------------------------------------
- percent_rows = []
- for peak_out_idx, peak_idx in enumerate(peaks_interest):
- for contrast_out_idx, contrast_label in enumerate(contrast_labels):
- for roi_idx, roi_name in enumerate(roi_names):
- percent_rows.append(
- {
- "dataset": dataset_name,
- "condition": condition_label,
- "peak_index": peak_idx,
- "contrast": contrast_label,
- "roi": roi_name,
- "percent_sig_sources": final_results_percent[
- peak_out_idx,
- contrast_out_idx,
- roi_idx,
- ],
- }
- )
- percent_long_df = pd.DataFrame(percent_rows)
- percent_long_df.to_csv(
- out_dir / f"{base}_percent_sig_sources_long.csv",
- index=False,
- )
- # ------------------------------------------------------------
- # Save group-mean ROI values, long format
- # ------------------------------------------------------------
- value_group_rows = []
- value_group_mean = np.nanmean(value_results, axis=0)
- # Shape: peaks x contrasts x ROIs
- for peak_out_idx, peak_idx in enumerate(peaks_interest):
- for contrast_out_idx, contrast_label in enumerate(contrast_labels):
- for roi_idx, roi_name in enumerate(roi_names):
- value_group_rows.append(
- {
- "dataset": dataset_name,
- "condition": condition_label,
- "peak_index": peak_idx,
- "contrast": contrast_label,
- "roi": roi_name,
- "group_mean_value": value_group_mean[
- peak_out_idx,
- contrast_out_idx,
- roi_idx,
- ],
- }
- )
- value_group_df = pd.DataFrame(value_group_rows)
- value_group_df.to_csv(
- out_dir / f"{base}_roi_values_group_mean_long.csv",
- index=False,
- )
- # ------------------------------------------------------------
- # Save subject-level ROI values, long format
- # ------------------------------------------------------------
- rows = []
- for subject_idx, subject_code in enumerate(subject_codes):
- for peak_out_idx, peak_idx in enumerate(peaks_interest):
- for contrast_out_idx, contrast_label in enumerate(contrast_labels):
- for roi_idx, roi_name in enumerate(roi_names):
- rows.append(
- {
- "dataset": dataset_name,
- "condition": condition_label,
- "subject": subject_code,
- "peak_index": peak_idx,
- "contrast": contrast_label,
- "roi": roi_name,
- "value": value_results[
- subject_idx,
- peak_out_idx,
- contrast_out_idx,
- roi_idx,
- ],
- }
- )
- value_long_df = pd.DataFrame(rows)
- value_long_df.to_csv(
- out_dir / f"{base}_roi_values_subject_level_long.csv",
- index=False,
- )
- # ============================================================
- # SUMMARY
- # ============================================================
- print("\n" + "=" * 80)
- print("Done.")
- print("\nSaved outputs to:")
- print(out_dir)
- print("\nMain output arrays:")
- print(f" all_data_labels: {all_data_labels.shape}")
- print(f" num_dec_sources_label: {num_dec_sources_label.shape}")
- print(f" roi_percent_sig_sources: {final_results_percent.shape}")
- print(f" roi_values: {value_results.shape}")
- print("\nContrast labels:")
- for i, label in enumerate(contrast_labels):
- print(f" {i}: {label}")
extract_vals_ROIs.py, no license · at the source
Overview
- Department of Neuroscience, Georgetown University Medical Center, Washington, DC 20057
- Department of Psychology, New York University, New York, NY 10003
- Department of Engineering Science, Oxford University, Oxford OX1 3PJ, Oxfordshire, United Kingdom
- Institute of Neurobiology, National Autonomous University of Mexico, Juriquilla 76230, Querétaro, Mexico
- Center for Language, Music and Emotion, New York University, New York, NY 10003
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 14 matches between paragraphs and lines of code.
OSF 3vmek
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
14 files
- scripts/
Fig1BC_Fig2AB_TG_diags_s , Python, 883 linesylls.py - scripts/
Fig1D_evokeds.py , Python, 439 lines, 2 matches - scripts/
Fig1E_cosine_similarity. , Python, 930 lines, 2 matchespy - scripts/
Fig1F_decoding_source_cl , Python, 617 lines, 2 matchesuster_peaks_Covert.py - scripts/
Fig2C_decoding_source_cl , Python, 609 linesuster_peaks_Passive.py - scripts/
Fig2D_crosscondition_dec , Python, 610 linesoding.py - scripts/
Fig2E_TG_conditions.py , Python, 208 lines - scripts/
Fig3C.py , Python, 321 lines, 1 match - scripts/
Fig3E_make_canonical_vow , Python, 65 linesels.py - scripts/
Fig3F.py , Python, 210 lines - scripts/
Fig3GH.py , Python, 244 lines, 1 match - scripts/
Sensor_space_decoding.py , Python, 487 lines, 2 matches - scripts/
Source_space_decoding.py , Python, 561 lines, 2 matches - scripts/
extract_vals_ROIs.py , Python, 853 lines, 2 matches
The paper's code and data availability statement is in the Data section.
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;
- 14 scripts, each with its path and the digest of its content;
- 14 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.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: OSF 3vmek
Read it in the paper: doi.org/10.1073/pnas.2536563123.
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, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 5 keywords, 11 MeSH terms, 2 funders, 58 references.
Cite
This paper
Orpella, J., Mantegna, F., Oderbolz, C., Assaneo, M. F., & Poeppel, D. (2026). Temporally structured motor and auditory representations in covert syllable production. Proceedings of the National Academy of Sciences of the United States of America, 123(37), e2536563123. https://
BibTeX
@article{orpella2026temp
author = {Orpella, Joan and Mantegna, Francesco and Oderbolz, Chantal and Assaneo, M Florencia and Poeppel, David},
title = {{Temporally structured motor and auditory representations in covert syllable production}},
journal = {Proceedings of the National Academy of Sciences of the United States of America},
year = {2026},
month = aug,
volume = {123},
number = {37},
pages = {e2536563123},
publisher = {National Academy of Sciences},
issn = {0027-8424},
doi = {10.1073/
url = {https://
pmid = {42673473},
pmcid = {PMC13578806}
}
RIS
TY - JOUR
AU - Orpella, Joan
AU - Mantegna, Francesco
AU - Oderbolz, Chantal
AU - Assaneo, M Florencia
AU - Poeppel, David
TI - Temporally structured motor and auditory representations in covert syllable production
T2 - Proceedings of the National Academy of Sciences of the United States of America
J2 - Proc Natl Acad Sci U S A
PY - 2026
DA - 2026/
VL - 123
IS - 37
SP - e2536563123
SN - 0027-8424
PB - National Academy of Sciences
DO - 10.1073/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1073/
"type": "article-journal",
"title": "Temporally structured motor and auditory representations in covert syllable production",
"container-title": "Proceedings of the National Academy of Sciences of the United States of America",
"author": [
{
"family": "Orpella",
"given": "Joan"
},
{
"family": "Mantegna",
"given": "Francesco"
},
{
"family": "Oderbolz",
"given": "Chantal"
},
{
"family": "Assaneo",
"given": "M Florencia"
},
{
"family": "Poeppel",
"given": "David"
}
],
"container-title-short":
"volume": "123",
"issue": "37",
"page": "e2536563123",
"DOI": "10.1073/
"PMID": "42673473",
"PMCID": "PMC13578806",
"ISSN": "0027-8424",
"publisher": "National Academy of Sciences",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
31
]
]
}
}
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.1038/s42003-025-07464-7 [code]
- Learning to operate an imagined speech Brain-Computer Interface involves the spatial and frequency tuning of neural activity.Journal: Communications biologyIn common: cognitive, 10 references
- [2] doi:10.3390/brainsci14030196 [code]
- Adaptive LDA Classifier Enhances Real-Time Control of an EEG Brain-Computer Interface for Decoding Imagined Syllables.Journal: Brain sciencesIn common: MNE-Python, scikit-learn, SciPy, 2 other tools, cognitive, 7 references
- [3] doi:10.1016/j.cell.2025.06.015
- Inner speech in motor cortex and implications for speech neuroprostheses.Journal: CellIn common: 9 references
- [4] doi:10.1162/nol_a_00138 [code]
- Reactive Inhibitory Control Precedes Overt Stuttering Events.Journal: Neurobiology of language (Cambridge, Mass.)In common: MNE-Python, pandas, SciPy, 2 other tools, MEG, cognitive, 2 references, author Joan Orpella
- [5] doi:10.1038/s42003-025-07862-x [code]
- Whole-brain dynamics of articulatory, acoustic and semantic speech representations.Journal: Communications biologyIn common: scikit-learn, pandas, SciPy, 1 other tool, cognitive, 7 references
- [6] doi:10.1038/s41598-024-62230-9 [code]
- Feasibility of decoding covert speech in ECoG with a Transformer trained on overt speech.Journal: Scientific reportsIn common: scikit-learn, pandas, SciPy, 2 other tools, cognitive, 6 references
- [7] doi:10.1371/journal.pbio.3002128 [code]
- Distinct neural encoding of glimpsed and masked speech in multitalker situations.Journal: PLoS biologyIn common: MNE-Python, statsmodels, scikit-learn, 4 other tools, cognitive, 5 references
- [8] doi:10.3389/fnhum.2025.1637174 [code]
- Neural signals, machine learning, and the future of inner speech recognition.Journal: Frontiers in human neuroscienceIn common: MNE-Python, scikit-learn, SciPy, 2 other tools, cognitive, 5 references
- [9] doi:10.1371/journal.pbio.3002836 [code]
- Impaired motor-to-sensory transformation mediates auditory hallucinations.Journal: PLoS biologyIn common: MNE-Python, scikit-learn, pandas, 3 other tools, 5 references
- [10] doi:10.1073/pnas.2300255120 [code]
- Distributed feedforward and feedback cortical processing supports human speech production.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: scikit-learn, pandas, SciPy, 2 other tools, cognitive, 6 references
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, 14 scripts, and 14 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:528efa0ae35aa0b4…
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.1073/pnas.2536563123)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1073/pnas.2536563123.svg
:target: https://openscicode.org/badge/doi/10.1073/pnas.2536563123
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1073/pnas.2536563123"><img src="https://openscicode.org/badge/doi/10.1073/pnas.2536563123.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->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)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
