OSCR

Accelerated brain ageing in migraine: a multilevel MRI-based brain-age modelling study.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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

MATLAB · 255 lines · 6.9 KB · GPL-3.0

  1. function varargout = permcca(varargin)
  2. % Permutation inference for canonical correlation
  3. % analysis (CCA).
  4. %
  5. % Usage:
  6. % [pfwer,r,A,B,U,V] = permcca(Y,X,nP,Z,W,Sel,partial,Pset)
  7. %
  8. % Inputs:
  9. % - Y : Left set of variables, size N by P.
  10. % - X : Right set of variables, size N by Q.
  11. % - nP : An integer representing the number
  12. % of permutations.
  13. % Default is 1000 permutations.
  14. % - Z : (Optional) Nuisance variables for
  15. % both (partial CCA) or left side
  16. % (part CCA) only.
  17. % - W : (Optional) Nuisance variables for the
  18. % right side only (bipartial CCA).
  19. % - Sel : (Optional) Selection matrix or a selection vector,
  20. % to use Theil's residuals instead of Huh-Jhun's
  21. % projection. If specified as a vector, it can be
  22. % made of integer indices or logicals.
  23. % The R unselected rows of Z (S of W) must be full
  24. % rank. Use -1 to randomly select N-R (or N-S) rows.
  25. % - partial : (Optional) Boolean indicating whether
  26. % this is partial (true) or part (false) CCA.
  27. % Default is true, i.e., partial CCA.
  28. % - Pset : Predefined set of permutations (e.g., that respect
  29. % exchangeability blocks). For information on how to
  30. % generate these, see:
  31. % https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM
  32. % If a selection matrix is provided (for the Theil method),
  33. % Pset will have to have fewer rows than the original N, i.e.,
  34. % it will have as many rows as the effective number of
  35. % subjects determined by the selection matrix.
  36. %
  37. % Outputs:
  38. % - p : p-values, FWER corrected via closure.
  39. % - r : Canonical correlations.
  40. % - A : Canonical coefficients, left side.
  41. % - B : Canonical coefficients, right side.
  42. % - U : Canonical variables, left side.
  43. % - V : Canonical variables, right side.
  44. %
  45. % ___________________________________________
  46. % AM Winkler, O Renaud, SM Smith, TE Nichols
  47. % NIH - Univ. of Geneva - Univ. of Oxford
  48. % Mar/2020 (first version)
  49. % Apr/2021 (this version)
  50. % Read input arguments
  51. narginchk(2,8)
  52. Y = varargin{1};
  53. X = varargin{2};
  54. if nargin >= 3
  55. nP = varargin{3};
  56. end
  57. if nargin >= 4
  58. Z = varargin{4};
  59. else
  60. Z = [];
  61. end
  62. if nargin >= 5
  63. W = varargin{5};
  64. else
  65. W = [];
  66. end
  67. if nargin >= 6
  68. Sel = varargin{6};
  69. else
  70. Sel = [];
  71. end
  72. if nargin >= 7
  73. partial = varargin{7};
  74. else
  75. partial = true;
  76. end
  77. if nargin >= 8
  78. Pset = varargin{8};
  79. else
  80. Pset = false;
  81. end
  82. Ny = size(Y,1);
  83. Nx = size(X,1);
  84. if Ny ~= Nx
  85. error('Y and X do not have same number of rows.')
  86. end
  87. N = Ny; clear Ny Nx
  88. I = eye(N);
  89. % Residualise Y wrt Z
  90. if isempty(Z)
  91. Qz = I;
  92. else
  93. Z = center(Z);
  94. Qz = semiortho(Z,Sel);
  95. end
  96. Y = center(Y);
  97. Y = Qz'*Y;
  98. Ny = size(Y,1);
  99. R = size(Z,2);
  100. % Residualise X wrt W
  101. if isempty(W)
  102. if partial
  103. W = Z;
  104. Qw = Qz;
  105. else
  106. Qw = I;
  107. end
  108. else
  109. W = center(W);
  110. Qw = semiortho(W,Sel);
  111. end
  112. X = center(X);
  113. X = Qw'*X;
  114. Nx = size(X,1);
  115. S = size(W,2);
  116. % Initial CCA
  117. [A,B,r] = cca(Qz*Y,Qw*X,R,S);
  118. K = numel(r);
  119. U = Y*[A null(A')];
  120. V = X*[B null(B')];
  121. % Initialise counter
  122. cnt = zeros(1,K);
  123. lW = zeros(1,K);
  124. % For each permutation
  125. for p = 1:nP
  126. fprintf('Permutation %d/%d: ',p,nP);
  127. % If user didn't supply a set of permutations,
  128. % permute randomly both Y and X.
  129. % Otherwise, use the permtuation set to shuffle
  130. % one side only.
  131. if islogical(Pset)
  132. % First permutation is no permutation
  133. if p == 1
  134. idxY = (1:Ny);
  135. idxX = (1:Nx);
  136. else
  137. idxY = randperm(Ny);
  138. idxX = randperm(Nx);
  139. end
  140. else
  141. idxY = Pset(:,p);
  142. idxX = (1:Nx);
  143. end
  144. % For each canonical variable
  145. for k = 1:K
  146. fprintf('%d ',k);
  147. [~,~,rperm] = cca(Qz*U(idxY,k:end),Qw*V(idxX,k:end),R,S);
  148. lWtmp = -fliplr(cumsum(fliplr(log(1-rperm.^2))));
  149. lW(k) = lWtmp(1);
  150. end
  151. if p == 1
  152. lW1 = lW;
  153. end
  154. cnt = cnt + (lW >= lW1);
  155. fprintf('\n');
  156. end
  157. punc = cnt/nP;
  158. varargout{1} = cummax(punc); % pfwer
  159. varargout{2} = r; % canonical correlations
  160. varargout{3} = A; % canonical weights (left)
  161. varargout{4} = B; % canonical weights (right)
  162. varargout{5} = Qz*Y*A; % canonical variables (left)
  163. varargout{6} = Qw*X*B; % canonical variables (right)
  164. % =================================================================
  165. function Q = semiortho(Z,Sel)
  166. % Compute a semi-orthogonal matrix according to
  167. % the Huh-Jhun or Theil methods. Note that, due to a
  168. % simplification of HJ, input here is Z, not Rz.
  169. if isempty(Sel)
  170. % If Sel is empty, do Huh-Jhun
  171. % HJ here is simplified as in Winkler et al, 2020 (see the Appendix text of the paper)
  172. [Q,D,~] = svd(null(Z'),'econ');
  173. Q = Q*D;
  174. else
  175. % Theil
  176. [N,R] = size(Z);
  177. if isvector(Sel)
  178. % If Sel is a vector of logical or integer indices
  179. if islogical(Sel)
  180. Sel = find(Sel);
  181. end
  182. if Sel(1) > 0
  183. % If Sel is a column of indices
  184. unSel = setdiff(1:N,Sel);
  185. if rank(Z(unSel,:)) < R
  186. error('Selected rows of nuisance not full rank')
  187. end
  188. else
  189. % If Sel is -1 or anything else but empty [].
  190. % First confirm that this is even possible
  191. rZ = rank(Z);
  192. if rZ < R
  193. error('Impossible to use the Theil method with this set of nuisance variables')
  194. end
  195. % Find unique rows; since unique sorts outputs, shuffle to avoid trends
  196. [~,iU,~] = unique(Z,'rows');
  197. pidx = randperm(numel(iU));
  198. iU = iU(pidx);
  199. % Go by trial and error
  200. unSel0 = [];
  201. rnk0 = 0;
  202. for u = iU'
  203. unSel = [unSel0 u];
  204. Zout = Z(unSel,:);
  205. rnk = rank(Zout);
  206. if rnk > rnk0
  207. unSel0 = unSel;
  208. rnk0 = rnk;
  209. end
  210. if rnk == R
  211. break
  212. end
  213. end
  214. Sel = setdiff((1:N),unSel);
  215. end
  216. S = eye(N);
  217. S = S(:,Sel);
  218. else
  219. % Sel is a matrix proper
  220. S = Sel;
  221. end
  222. Rz = eye(N) - Z*pinv(Z);
  223. Q = Rz*S*sqrtm(inv(S'*Rz*S));
  224. end
  225. % =================================================================
  226. function [A,B,cc] = cca(Y,X,R,S)
  227. % Compute CCA.
  228. N = size(Y,1);
  229. [Qy,Ry,iY] = qr(Y,0);
  230. [Qx,Rx,iX] = qr(X,0);
  231. K = min(rank(Y),rank(X));
  232. [L,D,M] = svds(Qy'*Qx,K);
  233. cc = min(max(diag(D(:,1:K))',0),1);
  234. A = Ry\L(:,1:K)*sqrt(N-R);
  235. B = Rx\M(:,1:K)*sqrt(N-S);
  236. A(iY,:) = A;
  237. B(iX,:) = B;
  238. % =================================================================
  239. function X = center(X)
  240. % Mean center a matrix and remove constant columns.
  241. icte = sum(diff(X,1,1).^2,1) == 0;
  242. X = bsxfun(@minus,X,mean(X,1));
  243. X(:,icte) = [];

permcca.m at commit 5046146, under GPL-3.0 · at the source

Overview

Authors: Hung-Yu Liu1,2, Chen-Yuan Kuo3, Pei-Lin Lee4, Yi-Hsuan Liu3,5, Wei-Ta Chen2,6, Shih-Pin Chen2,7,8, Yen-Feng Wang1,2, Ching-Po Lin3,7,9, Kun-Hsien Chou3,7, Shuu-Jiun Wang1,2,7
  1. Department of Neurology, Neurological Institute, Taipei Veterans General Hospital, Taipei 112201, Taiwan
  2. School of Medicine, National Yang Ming Chiao Tung University, Taipei 112304, Taiwan
  3. Institute of Neuroscience, National Yang Ming Chiao Tung University, Taipei 112304, Taiwan
  4. Center for Healthy Longevity and Aging Sciences, National Yang Ming Chiao Tung University, Taipei 112304, Taiwan
  5. Department of Neurology, Columbia University, New York 10032, USA
  6. Department of Neurology, Keelung Hospital, Ministry of Health and Welfare, Keelung 20148, Taiwan
  7. Brain Research Center, National Yang Ming Chiao Tung University, Taipei 112304, Taiwan
  8. Division of Translational Research, Department of Medical Research, Taipei Veterans General Hospital, Taipei 112201, Taiwan
  9. Department of Education and Research, Taipei City Hospital, Taipei 24213, Taiwan
Journal: Brain communications, volume 8, issue 2, article fcag110
Dates: received 14 July 2025; accepted 26 March 2026; published online 28 March 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1093/braincomms/fcag110 · PMID 41958921 · PMCID PMC13056717 · OpenAlex W7141952572
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: structural MRI / diffusion (modality), human (organism), pain (population), clinical / translational (subfield)
Methods: Connectivity, Statistics, Smoothing, state filtering, decompositions, Machine learning, Preprocessing, fMRI & imaging
Keywords: migraine, spatial distribution, MRI, brain age
Topic: Migraine and Headache Studies (Clinical Neurology, Medicine), according to OpenAlex
Funding: National Science and Technology Council (112-2314-B-A49-056-MY3, 114-2314-B-A49-041-MY3, 107-2314-B-075-058-MY3, 111-2314-B-A49-080-MY3, 113-2314-B-A49-070-MY3, 113-2321-B-A49-015-MY3)
Citations: cited by 1 paper (Europe PMC); 38 references in the paper

Abstract

Migraine is increasingly recognized as more than just an episodic headache disorder—it often carries a profound burden marked by emotional and cognitive disturbances. Recent insights point towards a possible link between migraine and accelerated brain ageing, yet the specific brain regions affected and the clinical implications remain poorly understood. We investigated grey matter-based brain age using voxel-based morphometry in 110 preventive treatment–naïve patients with migraine and 70 healthy controls, based on T1-weighted MRI and a validated brain-age prediction framework trained on data from 1318 healthy individuals. Compared with controls, patients with migraine exhibited a significantly higher global brain-age gap [mean difference = 4.24 years; confidence interval (CI, 0.12, 8.36); P = 0.039; ηp² = 0.024]. Regionally, 66 out of 442 brain parcels—primarily within the prefrontal, frontal, cingulate, parietal and temporal cortices and the amygdala—showed elevated ageing patterns. Permutation-based canonical correlation analysis revealed a stable multivariate association between regional brain-age deviations and a combination of migraine-related clinical factors (headache frequency, painkiller usage and depressive symptoms), although individual factor contributions were variable. Functional annotation of the affected regions highlighted their roles in cognitive, emotional and perceptual processing. Together, these findings reveal that migraine is linked to widespread, regionally patterned brain ageing, mirroring the clinical and neurobiological complexity of the disease. This work not only deepens our understanding of migraine’s impact on the brain but also opens new avenues for exploring how timely intervention might protect brain health in this population.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above.

andersonwinkler/PermCCA

License: GPL-3.0
State: the link answers, verified on 30 October 2026
Evidence: files inventoried
Commit: 5046146c4882a68896cac95f92132e62c5628669, 21 August 2024
Languages: MATLAB (7)
Size: 9 files, 7 scripts
Software Heritage: not archived
Found in: the text, “Correlations between brain-age gap and clinical ”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 2 checks, the latest on 30 October 2026: the link answers
  • 30 October 2026: the link answers
  • 30 September 2026: the link answers
9 files

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;
  • 7 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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 data that support the findings of this study are available from the corresponding author upon reasonable request. The analyses in this study were performed using a combination of commercial and open-source software: commercial software, MATLAB (https://www.mathworks.com/); open-source software and toolboxes, SPM12 (https://www.fil.ion.ucl.ac.uk/spm/docs/); Python (https://www.python.org/); Scikit-learn library (https://scikit-learn.org/stable); PermCCA (https://github.com/andersonwinkler/PermCCA); Mango (https://mangoviewer.com/plugin_behavioralanalysis.html).

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, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 10 authors, 4 keywords, 1 funder, 38 references.

Cite

This paper

Liu, H.-Y., Kuo, C.-Y., Lee, P.-L., Liu, Y.-H., Chen, W.-T., Chen, S.-P., Wang, Y.-F., Lin, C.-P., Chou, K.-H., & Wang, S.-J. (2026). Accelerated brain ageing in migraine: a multilevel MRI-based brain-age modelling study. Brain communications, 8(2), fcag110. https://doi.org/10.1093/braincomms/fcag110

BibTeX

@article{liu2026accelerated,
author = {Liu, Hung-Yu and Kuo, Chen-Yuan and Lee, Pei-Lin and Liu, Yi-Hsuan and Chen, Wei-Ta and Chen, Shih-Pin and Wang, Yen-Feng and Lin, Ching-Po and Chou, Kun-Hsien and Wang, Shuu-Jiun},
title = {{Accelerated brain ageing in migraine: a multilevel MRI-based brain-age modelling study}},
journal = {Brain communications},
year = {2026},
month = mar,
volume = {8},
number = {2},
pages = {fcag110},
publisher = {Oxford University Press},
issn = {2632-1297},
doi = {10.1093/braincomms/fcag110},
url = {https://doi.org/10.1093/braincomms/fcag110},
pmid = {41958921},
pmcid = {PMC13056717}
}

RIS

TY - JOUR
AU - Liu, Hung-Yu
AU - Kuo, Chen-Yuan
AU - Lee, Pei-Lin
AU - Liu, Yi-Hsuan
AU - Chen, Wei-Ta
AU - Chen, Shih-Pin
AU - Wang, Yen-Feng
AU - Lin, Ching-Po
AU - Chou, Kun-Hsien
AU - Wang, Shuu-Jiun
TI - Accelerated brain ageing in migraine: a multilevel MRI-based brain-age modelling study
T2 - Brain communications
J2 - Brain Commun
PY - 2026
DA - 2026/03/28
VL - 8
IS - 2
SP - fcag110
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/braincomms/fcag110
UR - https://doi.org/10.1093/braincomms/fcag110
LA - en
ER -

CSL-JSON

{
"id": "10.1093/braincomms/fcag110",
"type": "article-journal",
"title": "Accelerated brain ageing in migraine: a multilevel MRI-based brain-age modelling study",
"container-title": "Brain communications",
"author": [
{
"family": "Liu",
"given": "Hung-Yu"
},
{
"family": "Kuo",
"given": "Chen-Yuan"
},
{
"family": "Lee",
"given": "Pei-Lin"
},
{
"family": "Liu",
"given": "Yi-Hsuan"
},
{
"family": "Chen",
"given": "Wei-Ta"
},
{
"family": "Chen",
"given": "Shih-Pin"
},
{
"family": "Wang",
"given": "Yen-Feng"
},
{
"family": "Lin",
"given": "Ching-Po"
},
{
"family": "Chou",
"given": "Kun-Hsien"
},
{
"family": "Wang",
"given": "Shuu-Jiun"
}
],
"container-title-short": "Brain Commun",
"volume": "8",
"issue": "2",
"page": "fcag110",
"DOI": "10.1093/braincomms/fcag110",
"PMID": "41958921",
"PMCID": "PMC13056717",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://doi.org/10.1093/braincomms/fcag110",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
28
]
]
}
}

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.1186/s10194-023-01670-6 [code]
Increased MRI-based Brain Age in chronic migraine patients.
Journal: The journal of headache and pain
In common: pain, structural MRI / diffusion, clinical / translational, 8 references
[2] doi:10.1186/s10194-025-02188-9
Perfusion dynamics in reversible cerebral vasoconstriction syndrome.
Journal: The journal of headache and pain
In common: pain, structural MRI / diffusion, clinical / translational, 2 references, author Shih-Pin Chen
[3] doi:10.1093/braincomms/fcac233
Regional rather than global brain age mediates cognitive function in cerebral small vessel disease.
Journal: Brain communications
In common: structural MRI / diffusion, 4 references, author Ching-Po Lin
[4] doi:10.1126/sciadv.adk6063 [code]
Neuroimaging epicenters as potential sites of onset of the neuroanatomical pathology in schizophrenia.
Journal: Science advances
In common: structural MRI / diffusion, 2 references, author Ching-Po Lin
[5] doi:10.1002/hbm.70458 [code]
A Systematic Evaluation of the Performance of Multiple Brain Age Algorithms in Two Cohorts of Youth.
Journal: Human brain mapping
In common: structural MRI / diffusion, 5 references
[6] doi:10.1038/s41398-023-02379-5
Investigating brain aging trajectory deviations in different brain regions of individuals with schizophrenia using multimodal magnetic resonance imaging and brain-age prediction: a multicenter study.
Journal: Translational psychiatry
In common: structural MRI / diffusion, 1 reference, author Ching-Po Lin
[7] doi:10.1038/s41537-022-00325-w
Predicting aging trajectories of decline in brain volume, cortical thickness and fractional anisotropy in schizophrenia.
Journal: Schizophrenia (Heidelberg, Germany)
In common: structural MRI / diffusion, 1 reference, author Ching-Po Lin
[8] doi:10.1161/jaha.125.043931 [code]
Commissural Fiber Disruption Is Associated With Symptom Onset in Cerebral Autosomal-Dominant Arteriopathy With Subcortical Infarcts and Leukoencephalopathy.
Journal: Journal of the American Heart Association
In common: structural MRI / diffusion, clinical / translational, author Shih-Pin Chen
[9] doi:10.1002/hbm.70627 [code]
Investigating the Contribution of Molecular-Enriched Functional Connectivity to Brain-Age Analysis.
Journal: Human brain mapping
In common: structural MRI / diffusion, 5 references
[10] doi:10.1212/wnl.0000000000207484 [code]
Evaluation of a Clustering Approach to Define Distinct Subgroups of Patients With Migraine to Select Electroacupuncture Treatments.
Journal: Neurology
In common: pain, clinical / translational, 3 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.

Add the badge to the code's README

OSCR: the badge of this paper

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 -->
[![OSCR](https://openscicode.org/badge/doi/10.1093/braincomms/fcag110.svg)](https://openscicode.org/badge/doi/10.1093/braincomms/fcag110)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1093/braincomms/fcag110.svg
   :target: https://openscicode.org/badge/doi/10.1093/braincomms/fcag110
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1093/braincomms/fcag110"><img src="https://openscicode.org/badge/doi/10.1093/braincomms/fcag110.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.