OSCR

Oral microbiota dysbiosis related to the cortical thinning and cognitive impairment in cerebral small vessel disease.

Code ↔ Paper

1 match between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 1 match
  1. [1] § Materials and methods › Individual cortical thinning biomarkers ↔ individual_brain_health_output_of_example/Brain_individual_report_output.Rmd, lines 689–759 · score 0.67 · subcortical volume, centile scores, 0–1, atlas, segmented, lifespan

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R Markdown · 1,050 lines · 38 KB · no license · 1 match

  1. ---
  2. title: "Brain Health Report"
  3. author: " "
  4. date: "`r Sys.Date()`"
  5. output:
  6. html_document: default
  7. pdf_document: default
  8. word_document: default
  9. ---
  10. ```{r setup, include=FALSE}
  11. knitr::opts_chunk$set(echo = TRUE,error = FALSE,message = FALSE)
  12. ```
  13. ## Deviation of global features:
  14. #### lightblue=Male,darkred=Female,soldline=Meidan,dottedline=95%CI
  15. ```{r, warning = FALSE, include = FALSE,echo=FALSE}
  16. #load required packages
  17. #install.packages('gamlss')
  18. rm(list=ls())
  19. datapath='C:/ZZZ/work/manuscript/Lifespan-main'# change
  20. setwd(datapath)
  21. source("100.common-variables.r")
  22. source("101.common-functions.r")
  23. source("ZZZ_function.R")
  24. source("300.variables.r")
  25. source("301.functions.r")
  26. #install.packages('gamlss')
  27. rm(list=ls())
  28. library(glmnet)
  29. library(dplyr);
  30. library(ggplot2)
  31. library(ggplot2)
  32. library(stringr)
  33. library(robustbase)
  34. library(gamlss)
  35. library(ggplot2)
  36. library(reshape2)
  37. source("100.common-variables.r")
  38. source("101.common-functions.r")
  39. source("ZZZ_function.R")
  40. source("300.variables.r")
  41. source("301.functions.r")
  42. library(raincloudplots)
  43. library(commonmark)
  44. library(ggplot2)
  45. #library(ggstatsplot)
  46. library(lmerTest)
  47. library(effectsize)
  48. library(ggrain)
  49. library(ggsci)
  50. library(ggdist)
  51. library(hrbrthemes)
  52. ```
  53. ```{r, warning = FALSE, include = FALSE,echo=FALSE}
  54. #read individual freesurfer-derived phenotypes and calcuate the centiles
  55. datafile = 'C:/ZZZ/work/manuscript/Lifespan-main/Results1_individual.xlsx'
  56. datapath = 'C:/ZZZ/work/manuscript/Lifespan-main'# change
  57. setwd(datapath)#set the filepath
  58. path <- list()
  59. str_lab <- 'global_and_local_feature'# change
  60. path[[1]] <- paste0(datapath, '/test_zzz_update_20240116/aseg.vol.table')
  61. path[[2]] <-
  62. paste0(datapath, '/test_zzz_update_20240116/lh.aparc.thickness.table')
  63. path[[3]] <-
  64. paste0(datapath, '/test_zzz_update_20240116/rh.aparc.thickness.table')
  65. path[[4]] <-
  66. paste0(datapath, '/test_zzz_update_20240116/lh.aparc.area.table')
  67. path[[5]] <-
  68. paste0(datapath, '/test_zzz_update_20240116/rh.aparc.area.table')
  69. path[[6]] <-
  70. paste0(datapath, '/test_zzz_update_20240116/lh.aparc.volume.table')
  71. path[[7]] <-
  72. paste0(datapath, '/test_zzz_update_20240116/rh.aparc.volume.table')
  73. path[[8]] <- paste0(datapath, '/test_zzz_update_20240116/Global_feature')
  74. RDSfile_all <- NULL
  75. for (i in 1:length(path))
  76. {
  77. feature_path = path[[i]]
  78. setwd(feature_path)
  79. myfile <- list.files()
  80. RDSfile_all0 <-
  81. myfile[grep(myfile, pattern = "our_model.rds$")]
  82. for (j in RDSfile_all0)
  83. {
  84. #RDSfile_all0<-paste0(feature_path,'/',RDSfile_all0);
  85. RDSfile_all <- c(RDSfile_all, paste0(feature_path, '/', j))
  86. }
  87. }
  88. datapath = 'C:/ZZZ/work/manuscript/Lifespan-main'# change
  89. setwd(datapath)
  90. #loading for Global_feature
  91. var <-
  92. c(
  93. 'global.table',
  94. 'aseg.vol.table',
  95. 'lh.aparc.volume.table',
  96. 'rh.aparc.volume.table',
  97. 'lh.aparc.thickness.table',
  98. 'rh.aparc.thickness.table',
  99. 'lh.aparc.area.table',
  100. 'rh.aparc.area.table'
  101. )
  102. setwd(datapath)
  103. patient_index=5768;
  104. MRI <- data.frame(read_excel(datafile, sheet = 'global.table'))
  105. #individual_name<-c("20211201_WENGJINYUAN_029_M_p181")
  106. #individual_name<-c("20211201_ZHUOZHIZHENG_034_M_p253")
  107. #individual_name<-c("20220511_SUNJUN_033_F_p624")
  108. #individual_name<-c("20221230_LIJUNJIE_027_M_p2412")
  109. #individual_name<-c("20230411_LIYUNA_026_F_p577")
  110. #individual_name<-c("20230427_CHAILI_027_F_p696")
  111. #individual_name<-c("20220512_HUATIANTIAN_023_F_p626")
  112. #individual_name<-c("20230104_LIZHUYUERONG_025_F_p2464")
  113. #individual_name<-c("Lifespan%3A20210203_WEIREN_029_M_p1843")
  114. #individual_name<-c("20230120_XUXIAOLU_032_F_p89")
  115. #individual_name<-c("20220521_XUSIYAO_024_F_p735")
  116. #individual_name<-c("20230112_Sunting_033_F_p12")
  117. #individual_name<-c("20230420_GUOMIN_035_F_p648")
  118. #individual_name<-c("20220725_lvshan_030_F_p1120")
  119. #individual_name<-c("20230104_JINYING_024_F_p2462")
  120. #individual_name<-c("20230106_wuminghao_033_M_p2494")
  121. #individual_name<-c("20220523_QULIYING_028_F_p637")
  122. #individual_name<-c("20220717_LIUCHENGHAO_024_M_p1065")
  123. #individual_name<-c("20221227_SHIDONGLI_037_F_p2390")
  124. #individual_name<-c("20211226_LIYUXING_024_F_p342")
  125. #individual_name<-c("20211226_LIUWAN_026_F_p337")
  126. #individual_name<-c("20221014_LIUXINRU_023_F_p1828")
  127. #individual_name<-c("20221230_ZHUXIAOQIN_023_F_p2411")
  128. #individual_name<-c("20211226_LUQI_024_F_p341")
  129. #individual_name<-c("20220717_WUDI_024_F_p1064")
  130. #individual_name<-c("20210922_YANGWENJING_073_F_p1757")
  131. #individual_name<-c("20230408_TANGXIANZHANG_063_M_p556")
  132. #individual_name<-c("20220323_SHIJIAHUI_072_M_p288")
  133. #individual_name<-c("20220512_HUATIANTIAN_023_F_p626")
  134. #individual_name<-c("test3")
  135. individual_name<-c("20230518_WANGHONGGANG_049_M_p799")
  136. individual_index<-NULL
  137. individual_num=0;
  138. for(name in MRI$Freesufer_Path3)
  139. {
  140. individual_num<-individual_num+1;
  141. if(individual_name %in% name){
  142. individual_index<-individual_num;
  143. }else{next}
  144. }
  145. patient_index<-individual_index
  146. all_data1_raw<- MRI[c(patient_index), c(7,8,10,11)]
  147. all_data1_centile<- MRI[c(patient_index), c(7,8,10,11)]
  148. for (sheet in var)
  149. #for local feature
  150. {
  151. setwd(datapath)
  152. MRI <- read_excel(datafile, sheet = sheet)
  153. MRI <- MRI[c(patient_index, 5768, 5769), ]
  154. if (sheet == "aseg.vol.table")
  155. {
  156. MRI[, 'cerebellum_WM'] <-
  157. MRI$`Left-Cerebellum-White-Matter` + MRI$`Right-Cerebellum-White-Matter`
  158. MRI[, 'cerebellum_GM'] <-
  159. MRI$`Left-Cerebellum-Cortex` + MRI$`Right-Cerebellum-Cortex`
  160. MRI[, 'cerebellum_total'] <-
  161. MRI[, 'cerebellum_WM'] + MRI[, 'cerebellum_GM']
  162. MRI[, 'CC'] <- MRI$CC_Anterior + MRI$CC_Central + MRI$CC_Mid_Anterior +
  163. MRI$CC_Mid_Posterior + MRI$CC_Posterior
  164. }
  165. str = sheet
  166. if (sheet == "global.table")
  167. {
  168. for (i in 1:dim(MRI)[1])
  169. {
  170. MRI[i, 'mean_thickness'] <-
  171. (MRI[i, 'meanCT2_lhMeanThickness'] * MRI[i, 'meanCT2_lhVertex'] +
  172. MRI[i, 'meanCT2_rhMeanThickness'] * MRI[i, 'meanCT2_rhVertex']) /
  173. (MRI[i, 'meanCT2_lhVertex'] + MRI[i, 'meanCT2_rhVertex'])
  174. MRI[i, 'total_surface_arrea'] <-
  175. MRI[i, 'totalSA2_lh'] + MRI[i, 'totalSA2_rh']
  176. }
  177. str = 'Global_feature'
  178. }
  179. tem_feature <- colnames(MRI)
  180. all_data <- MRI
  181. Z_data_new <- list()
  182. Quant_data_new <- list()
  183. #for(i in tem_feature[1:length(tem_feature)])
  184. for (i in tem_feature[1:length(tem_feature)])
  185. {
  186. all_data[, 'feature'] <- all_data[, i]
  187. rads_file <- paste0(str, '_', i, '_loop_our_model.rds')
  188. #if (!exists(rads_file)) {next}
  189. rads_index <- NULL
  190. for (rads1 in RDSfile_all)
  191. {
  192. if (grepl(rads_file, rads1)) {
  193. rads_index <- rads1
  194. }
  195. }
  196. if (is.null(rads_index)) {
  197. next
  198. }
  199. else{
  200. results <- readRDS(rads_index)
  201. print(paste0(rads_index, '-vs-', i))
  202. }
  203. Z_score_sum <- NULL
  204. Quant_score_sum <- NULL
  205. m2 <- results$m2
  206. m0 <- results$m0
  207. #for mu
  208. # all_data[is.na(all_data$Sex),'Sex']<-'Male'
  209. # all_data[!is.na(all_data$feature)&!is.infinite(all_data$feature)&
  210. # !is.na(all_data$Age)&!is.na(all_data$Sex),]
  211. all_data$Sex <- as.factor(all_data$Sex)
  212. #all_data$Site_ZZZ<-as.factor(all_data$Site_ZZZ)
  213. all_data[2, 'Site'] <- 'CC'
  214. all_data$Site_ZZZ <- as.factor(all_data$Site)
  215. tem_rnd <- matrix(0, dim(all_data)[1], 1)
  216. Model.Frame <- model.frame(formula = m2$mu.formula, data = all_data)
  217. Model.Matrix <- model.matrix(m2$mu.formula, Model.Frame)
  218. Fit.fix <-
  219. matrix(m2$mu.coefficients[colnames(Model.Matrix)],
  220. ncol = 1,
  221. dimnames = list(colnames(Model.Matrix), 'Beta'))
  222. if (!is.null(m2$mu.coefSmo[[1]]))
  223. {
  224. Fit.fix[length(Fit.fix)] = 0
  225. for (iz in 1:dim(all_data)[1]) {
  226. if (all_data$Site_ZZZ[iz] %in% names(m2$mu.coefSmo[[1]]$coef)) {
  227. tem_rnd[iz] <-
  228. m2$mu.coefSmo[[1]]$coef[as.character(all_data$Site_ZZZ[iz])]
  229. } else{
  230. tem_rnd[iz] <- mean(m2$mu.coefSmo[[1]]$coef)
  231. }
  232. }
  233. } else{
  234. print('no random effects for this term')
  235. }
  236. mu <- exp(as.vector(Model.Matrix %*% Fit.fix) + as.vector(tem_rnd))
  237. #for sigma
  238. tem_rnd <- matrix(0, dim(all_data)[1], 1)
  239. Model.Frame <- model.frame(formula = m2$sigma.formula, data = all_data)
  240. Model.Matrix <- model.matrix(m2$sigma.formula, Model.Frame)
  241. Fit.fix <-
  242. matrix(
  243. m2$sigma.coefficients[colnames(Model.Matrix)],
  244. ncol = 1,
  245. dimnames = list(colnames(Model.Matrix), 'Beta')
  246. )
  247. if (!is.null(m2$sigma.coefSmo[[1]]))
  248. {
  249. Fit.fix[length(Fit.fix)] = 0
  250. for (iz in 1:dim(all_data)[1]) {
  251. if (all_data$Site_ZZZ[iz] %in% names(m2$sigma.coefSmo[[1]]$coef)) {
  252. tem_rnd[iz] <-
  253. m2$sigma.coefSmo[[1]]$coef[as.character(all_data$Site_ZZZ[iz])]
  254. } else{
  255. tem_rnd[iz] <- mean(m2$sigma.coefSmo[[1]]$coef)
  256. }
  257. }
  258. } else{
  259. print('no random effects for this term')
  260. }
  261. sigma <- exp(as.vector(Model.Matrix %*% Fit.fix) + as.vector(tem_rnd))
  262. #sigma<-(as.vector(Model.Matrix %*% Fit.fix))
  263. #for nu
  264. Model.Frame <- model.frame(formula = m2$nu.formula, data = all_data)
  265. Model.Matrix <- model.matrix(m2$nu.formula, Model.Frame)
  266. Fit.fix <-
  267. matrix(m2$nu.coefficients[colnames(Model.Matrix)],
  268. ncol = 1,
  269. dimnames = list(colnames(Model.Matrix), 'Beta'))
  270. if (!is.null(m2$nu.coefSmo[[1]]))
  271. {
  272. Fit.fix[length(Fit.fix)] = 0
  273. } else{
  274. print('no random effects for this term')
  275. }
  276. nu <- as.vector(Model.Matrix[, colnames(Model.Matrix)[1]] * Fit.fix[1])
  277. Z_score_sum <-
  278. zzz_cent(
  279. obj = m2,
  280. type = c("z-scores"),
  281. mu = mu,
  282. sigma = sigma,
  283. nu = nu,
  284. xname = 'Age',
  285. xvalues = all_data$Age,
  286. yval = all_data$feature,
  287. calibration = FALSE,
  288. lpar = 3
  289. )
  290. Quant_score_sum <-
  291. zzz_cent(
  292. obj = m2,
  293. type = c("z-scores"),
  294. mu = mu,
  295. sigma = sigma,
  296. nu = nu,
  297. xname = 'Age',
  298. xvalues = all_data$Age,
  299. yval = all_data$feature,
  300. calibration = FALSE,
  301. lpar = 3,
  302. cdf = TRUE
  303. )
  304. Z_score_sum <- data.frame(Z_score_sum)
  305. colnames(Z_score_sum) <- c('Z_score')
  306. Quant_score_sum <- data.frame(Quant_score_sum)
  307. colnames(Quant_score_sum) <- c('Quant_score')
  308. #
  309. # Z_data_new[[i]] <- Z_score_sum
  310. # Quant_data_new[[i]] <- Quant_score_sum
  311. #
  312. # results$Zscore_new <- Z_data_new
  313. # results$Quant_data_new <- Quant_data_new
  314. # results$all_data <- all_data
  315. # results$str <- str
  316. # results$i <- i
  317. all_data1_raw<- cbind(all_data1_raw,all_data$feature[1]);
  318. colnames(all_data1_raw)[dim(all_data1_raw)[2]]<-i
  319. all_data1_centile<- cbind(all_data1_centile,Quant_score_sum[1,1]);
  320. colnames(all_data1_centile)[dim(all_data1_centile)[2]]<-i
  321. }
  322. }
  323. setwd(paste0(datapath, '/test'))
  324. write.csv(all_data1_raw,'individual_raw_data.csv')
  325. write.csv(all_data1_centile,'individual_centile_score.csv')
  326. #
  327. ```
  328. ```{r, warning = FALSE, include = TRUE,echo=FALSE}
  329. # setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_quant_update/figure3')
  330. # results<-readRDS('BHI_predict_mdoel.rds')
  331. #
  332. # setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  333. #
  334. # individual_data<-read.csv('individual_centile_score.csv',header=TRUE,check.names=F);
  335. #
  336. #
  337. # predict_BHI<-predict(results$model,type='response',newdata=individual_data);
  338. #
  339. # predict_BHI<-(-(predict_BHI+results$W0))
  340. # predict_BHI<-round(predict_BHI,2)
  341. # options('scipen'=12);
  342. #cat(paste0("Brain Healthy Index is: ",round(predict_BHI,2)));
  343. ```
  344. ```{r,warning = FALSE, include = FALSE,echo=FALSE}
  345. library(ggplot2)
  346. library(ggpubr)
  347. #rm (list = ls ())
  348. width1 = 4; height1=3
  349. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  350. individual_data<-read.csv('individual_raw_data.csv',header=TRUE,check.names=F);
  351. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/Global_feature')
  352. results<-readRDS('Global_feature_GMV_loop_our_model.rds');
  353. p2<-results$p2
  354. Female_p2<-results$Female_p2;Female_p2[,c(2,3,4,5,6)]<-Female_p2[,c(2,3,4,5,6)]/10000
  355. Male_p2<-results$Male_p2;Male_p2[,c(2,3,4,5,6)]<-Male_p2[,c(2,3,4,5,6)]/10000
  356. individual_data[,results$i]<-individual_data[,results$i]/10000
  357. f1<-ggplot()+
  358. geom_line(data=Male_p2,aes(x=Age,y=median),color=c('#00CCFF'),linewidth=2,linetype=c('solid'))+
  359. #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  360. geom_line(data=Male_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  361. geom_line(data=Male_p2,aes(x=Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  362. # geom_line(data=Female_p2,aes(x=Age,y=median),color=c('darkred'),linewidth=2,linetype=c('solid'))+
  363. # #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  364. # geom_line(data=Female_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  365. # geom_line(data=Female_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  366. #geom_line(data=p2,aes(Age,y=upper99CI/10000),color=c('#666666'),linewidth=1,linetype=c('dashed'))+
  367. geom_point(aes(individual_data$Age,individual_data[,results$i]),colour='red',size=2,stroke=5)+
  368. labs(x='Age (years)',y=paste0(results$i,' (ml)'))+
  369. # legend("topright",
  370. # legend=c('Male','Lower 95%CI','Upper 95%CI','Female','Lower 95%CI','Upper 95%CI'),
  371. # fill = c('#00CCFF','#00CCFF','#00CCFF','darkred','darkred','darkred'),
  372. # col = c('#00CCFF','#00CCFF','#00CCFF','darkred','darkred','darkred'),
  373. # title = "cyl")
  374. theme_bw()+
  375. theme(axis.text = element_text(size = 14,colour = 'black'),
  376. axis.title = element_text(size=14,colour = 'black'))
  377. #scale_x_log10()
  378. print(f1)
  379. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  380. ggsave(paste0(results$i,".png"),width = width1, height = height1, dpi = 300)
  381. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/Global_feature')
  382. results<-readRDS('Global_feature_sGMV_loop_our_model.rds');
  383. p2<-results$p2
  384. Female_p2<-results$Female_p2;Female_p2[,c(2,3,4,5,6)]<-Female_p2[,c(2,3,4,5,6)]/10000
  385. Male_p2<-results$Male_p2;Male_p2[,c(2,3,4,5,6)]<-Male_p2[,c(2,3,4,5,6)]/10000
  386. individual_data[,results$i]<-individual_data[,results$i]/10000
  387. f2<-ggplot()+
  388. geom_line(data=Male_p2,aes(x=Age,y=median),color=c('#00CCFF'),linewidth=2,linetype=c('solid'))+
  389. #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  390. geom_line(data=Male_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  391. geom_line(data=Male_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  392. # geom_line(data=Female_p2,aes(x=Age,y=median),color=c('darkred'),linewidth=2,linetype=c('solid'))+
  393. # #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  394. # geom_line(data=Female_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  395. # geom_line(data=Female_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  396. #geom_line(data=p2,aes(Age,y=upper99CI/10000),color=c('#666666'),linewidth=1,linetype=c('dashed'))+
  397. geom_point(aes(individual_data$Age,individual_data[,results$i]),colour='red',size=2,stroke=5)+
  398. labs(x='Age (years)',y=paste0(results$i,' (ml)'))+
  399. theme_bw()+
  400. theme(axis.text = element_text(size = 14,colour = 'black'),
  401. axis.title = element_text(size=14,colour = 'black'))
  402. #scale_x_log10()
  403. print(f2)
  404. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  405. ggsave(paste0(results$i,".png"),width = width1, height = height1, dpi = 300)
  406. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/Global_feature')
  407. results<-readRDS('Global_feature_WMV_loop_our_model.rds');
  408. p2<-results$p2
  409. Female_p2<-results$Female_p2;Female_p2[,c(2,3,4,5,6)]<-Female_p2[,c(2,3,4,5,6)]/10000
  410. Male_p2<-results$Male_p2;Male_p2[,c(2,3,4,5,6)]<-Male_p2[,c(2,3,4,5,6)]/10000
  411. individual_data[,results$i]<-individual_data[,results$i]/10000
  412. f3<-ggplot()+
  413. geom_line(data=Male_p2,aes(x=Age,y=median),color=c('#00CCFF'),linewidth=2,linetype=c('solid'))+
  414. #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  415. geom_line(data=Male_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  416. geom_line(data=Male_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  417. # geom_line(data=Female_p2,aes(x=Age,y=median),color=c('darkred'),linewidth=2,linetype=c('solid'))+
  418. # #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  419. # geom_line(data=Female_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  420. # geom_line(data=Female_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  421. #geom_line(data=p2,aes(Age,y=upper99CI/10000),color=c('#666666'),linewidth=1,linetype=c('dashed'))+
  422. geom_point(aes(individual_data$Age,individual_data[,results$i]),colour='red',size=2,stroke=5)+
  423. labs(x='Age (years)',y=paste0(results$i,' (ml)'))+
  424. theme_bw()+
  425. theme(axis.text = element_text(size = 14,colour = 'black'),
  426. axis.title = element_text(size=14,colour = 'black'))
  427. #scale_x_log10()
  428. print(f3)
  429. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  430. ggsave(paste0(results$i,".png"),width = width1, height = height1, dpi = 300)
  431. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/Global_feature')
  432. results<-readRDS('Global_feature_Ventricles_loop_our_model.rds');
  433. p2<-results$p2
  434. Female_p2<-results$Female_p2;Female_p2[,c(2,3,4,5,6)]<-Female_p2[,c(2,3,4,5,6)]/10000
  435. Male_p2<-results$Male_p2;Male_p2[,c(2,3,4,5,6)]<-Male_p2[,c(2,3,4,5,6)]/10000
  436. individual_data[,results$i]<-individual_data[,results$i]/10000
  437. f4<-ggplot()+
  438. geom_line(data=Male_p2,aes(x=Age,y=median),color=c('#00CCFF'),linewidth=2,linetype=c('solid'))+
  439. #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  440. geom_line(data=Male_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  441. geom_line(data=Male_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  442. # geom_line(data=Female_p2,aes(x=Age,y=median),color=c('darkred'),linewidth=2,linetype=c('solid'))+
  443. # #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  444. # geom_line(data=Female_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  445. # geom_line(data=Female_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  446. #geom_line(data=p2,aes(Age,y=upper99CI/10000),color=c('#666666'),linewidth=1,linetype=c('dashed'))+
  447. geom_point(aes(individual_data$Age,individual_data[,results$i]),colour='red',size=2,stroke=5)+
  448. labs(x='Age (years)',y=paste0(results$i,' (ml)'))+
  449. theme_bw()+
  450. theme(axis.text = element_text(size = 14,colour = 'black'),
  451. axis.title = element_text(size=14,colour = 'black'))
  452. #scale_x_log10()
  453. print(f4)
  454. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  455. ggsave(paste0(results$i,".png"),width = width1, height = height1, dpi = 300)
  456. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/Global_feature')
  457. results<-readRDS('aseg.vol.table_cerebellum_total_loop_our_model.rds');
  458. p2<-results$p2
  459. Female_p2<-results$Female_p2;Female_p2[,c(2,3,4,5,6)]<-Female_p2[,c(2,3,4,5,6)]/10000
  460. Male_p2<-results$Male_p2;Male_p2[,c(2,3,4,5,6)]<-Male_p2[,c(2,3,4,5,6)]/10000
  461. individual_data[,results$i]<-individual_data[,results$i]/10000
  462. f5<-ggplot()+
  463. geom_line(data=Male_p2,aes(x=Age,y=median),color=c('#00CCFF'),linewidth=2,linetype=c('solid'))+
  464. #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  465. geom_line(data=Male_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  466. geom_line(data=Male_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  467. # geom_line(data=Female_p2,aes(x=Age,y=median),color=c('darkred'),linewidth=2,linetype=c('solid'))+
  468. # #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  469. # geom_line(data=Female_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  470. # geom_line(data=Female_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  471. #geom_line(data=p2,aes(Age,y=upper99CI/10000),color=c('#666666'),linewidth=1,linetype=c('dashed'))+
  472. geom_point(aes(individual_data$Age,individual_data[,results$i]),colour='red',size=2,stroke=5)+
  473. labs(x='Age (years)',y=paste0('Cerebellum (ml)'))+
  474. theme_bw()+
  475. theme(axis.text = element_text(size = 14,colour = 'black'),
  476. axis.title = element_text(size=14,colour = 'black'))
  477. #scale_x_log10()
  478. print(f5)
  479. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  480. ggsave(paste0(results$i,".png"),width = width1, height = height1, dpi = 300)
  481. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/Global_feature')
  482. results<-readRDS('aseg.vol.table_Brain-Stem_loop_our_model.rds');
  483. p2<-results$p2
  484. Female_p2<-results$Female_p2;Female_p2[,c(2,3,4,5,6)]<-Female_p2[,c(2,3,4,5,6)]/10000
  485. Male_p2<-results$Male_p2;Male_p2[,c(2,3,4,5,6)]<-Male_p2[,c(2,3,4,5,6)]/10000
  486. individual_data[,results$i]<-individual_data[,results$i]/10000
  487. f6<-ggplot()+
  488. geom_line(data=Male_p2,aes(x=Age,y=median),color=c('#00CCFF'),linewidth=2,linetype=c('solid'))+
  489. #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  490. geom_line(data=Male_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  491. geom_line(data=Male_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  492. # geom_line(data=Female_p2,aes(x=Age,y=median),color=c('darkred'),linewidth=2,linetype=c('solid'))+
  493. # #geom_line(data=p2,aes(x=Age,y=lower99CI/10000),color=c('red'),linewidth=1,linetype=c('dashed'))+
  494. # geom_line(data=Female_p2,aes(x=Age,y=lower95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  495. # geom_line(data=Female_p2,aes(Age,y=upper95CI),color=c('darkred'),linewidth=1,linetype=c('dotted'))+
  496. #geom_line(data=p2,aes(Age,y=upper99CI/10000),color=c('#666666'),linewidth=1,linetype=c('dashed'))+
  497. geom_point(aes(individual_data$Age,individual_data[,results$i]),colour='red',size=2,stroke=5)+
  498. labs(x='Age (years)',y=paste0('Brainstem (ml)'))+
  499. theme_bw()+
  500. theme(axis.text = element_text(size = 14,colour = 'black'),
  501. axis.title = element_text(size=14,colour = 'black'))
  502. #scale_x_log10()
  503. print(f6)
  504. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  505. ggsave(paste0(results$i,".png"),width = width1, height = height1, dpi = 300)
  506. #library(cowplot)
  507. # library('png')
  508. # setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  509. #
  510. # figs<-c('GMV.png','sGMV.png','WMV.png','Ventricles.png','cerebellum_total.png','Brain-Stem.png')
  511. # f1<-readPNG('GMV.png')
  512. #ggarrange(f1,f2,f3,f4,f5,f6,ncol=6,nrow=1)
  513. ```
  514. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="50%",fig.align='center',fig.show='hold',fig.cap=' '}
  515. library(knitr)
  516. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/GMV.png')
  517. p2<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/sGMV.png')
  518. p3<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/WMV.png')
  519. p4<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/Ventricles.png')
  520. p5<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/cerebellum_total.png')
  521. p6<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/Brain-Stem.png')
  522. knitr::include_graphics(c(p1,p2))
  523. #knitr::include_graphics(c(p3,p4))
  524. #knitr::include_graphics(c(p5,p6))
  525. ```
  526. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="50%",fig.align='center',fig.show='hold',fig.cap=' '}
  527. library(knitr)
  528. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/WMV.png')
  529. p2<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/Ventricles.png')
  530. #knitr::include_graphics(c(p1,p2))
  531. knitr::include_graphics(c(p1,p2))
  532. #knitr::include_graphics(c(p5,p6))
  533. ```
  534. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="50%",fig.align='center',fig.show='hold',fig.cap=' '}
  535. library(knitr)
  536. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/cerebellum_total.png')
  537. p2<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/Brain-Stem.png')
  538. #knitr::include_graphics(c(p1,p2))
  539. #knitr::include_graphics(c(p3,p4))
  540. knitr::include_graphics(c(p1,p2))
  541. ```
  542. \newpage
  543. ## Deviation of local features:
  544. #### lightblue=supernormal,darkred=abnormal
  545. ```{r, warning = FALSE, include = FALSE,echo=FALSE}
  546. library(ggplot2)
  547. library(ggpubr)
  548. width1 = 4; height1=3
  549. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  550. individual_data<-read.csv('individual_centile_score.csv',header=TRUE,check.names=F);
  551. del_str='_thickness'
  552. del_str='_area'
  553. library(ggseg)
  554. #for cortical volume
  555. del_str='_volume'
  556. feature_seg<-colnames(individual_data)[36:103];
  557. library(stringr)
  558. feature_seg<-str_remove_all(string = feature_seg,pattern = del_str)
  559. value=individual_data[1,36:103]
  560. value[,is.na(value[1,])]<-0
  561. seg_data=data.frame(label=feature_seg,
  562. Centile=as.numeric(value))
  563. library(ggsci)
  564. p<-ggplot(seg_data)+
  565. geom_brain(atlas=dk,
  566. size = 0.1,
  567. position=position_brain(hemi ~ side),
  568. #hemi=hemis,
  569. mapping = aes(fill = Centile))+
  570. theme_void()+
  571. theme(legend.title = element_text(size=14,colour = 'black'), #change legend title font size
  572. legend.text = element_text(size=10,colour = 'black'))+ #change legend text font size)
  573. #scale_fill_gradient(limits=c(4.5,max(seg_data$Peak_age)),low='grey',high='#990000')
  574. scale_fill_gradient2(limits=c(0,1),low='#990000',midpoint = 0.5, high='#00CCFF')
  575. p
  576. ggsave(paste0("cortical_volume.png"),width = width1, height = height1, dpi = 300)
  577. feature_seg<-colnames(individual_data)[c(14:17,19:22,25:32)];
  578. #feature_seg<-str_remove_all(string = feature_seg,pattern = del_str)
  579. value=individual_data[1,c(14:17,19:22,25:32)]
  580. value[,is.na(value[1,])]<-0
  581. feature_seg[1]<-c("Left-Thalamus-Proper")
  582. feature_seg[9]<-c("Right-Thalamus-Proper")
  583. seg_data=data.frame(label=feature_seg,
  584. Centile=as.numeric(value))
  585. library(ggsci)
  586. p<-ggplot(seg_data)+
  587. geom_brain(atlas=aseg,
  588. size = 0.1,
  589. side='coronal',
  590. mapping = aes(fill = Centile))+
  591. theme_void()+
  592. theme(legend.title = element_text(size=14,colour = 'black'), #change legend title font size
  593. legend.text = element_text(size=10,colour = 'black'))+ #change legend text font size)
  594. scale_fill_gradient2(limits=c(0,1),low='#990000',midpoint = 0.5, high='#00CCFF')
  595. print(p)
  596. ggsave(paste0("subcortical_volume.png"),width = width1, height = height1, dpi = 300)
  597. ```
  598. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="50%",fig.align='center',fig.show='hold',fig.cap=' '}
  599. library(knitr)
  600. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/subcortical_volume.png')
  601. p2<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/cortical_volume.png')
  602. #knitr::include_graphics(c(p1,p2))
  603. #knitr::include_graphics(c(p3,p4))
  604. knitr::include_graphics(c(p1,p2))
  605. ```
  606. \newpage
  607. ## Summary of global and local features:
  608. #### lightblue=supernormal,darkred=abnormal
  609. ```{r, warning = FALSE, include = FALSE,echo=FALSE}
  610. library(ggplot2)
  611. library(ggpubr)
  612. width1 = 4; height1=3
  613. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  614. individual_data<-read.csv('individual_raw_data.csv',header=TRUE,check.names=F);
  615. individual_score<-read.csv('individual_centile_score.csv',header=TRUE,check.names=F);
  616. del_str='_thickness'
  617. del_str='_area'
  618. del_str='_volume'
  619. sub_var<-colnames(individual_data)[c(6:9,35,18,14:17,19:22,25:32)];
  620. table_sub<-cbind(t(individual_data[,sub_var]/1000),t(individual_score[,sub_var]))
  621. colnames(table_sub)<-c('Volume(ml)','centile')
  622. sub_var_volume<-colnames(individual_data)[c(36:103)];
  623. sub_var_thickness<-colnames(individual_data)[c(104:171)];
  624. sub_var_area<-colnames(individual_data)[c(172:239)];
  625. table_cor<-cbind(t(individual_data[,sub_var_volume]/1000),
  626. t(individual_score[,sub_var_volume]),
  627. t(individual_data[,sub_var_thickness]),
  628. t(individual_score[,sub_var_thickness]),
  629. t(individual_data[,sub_var_area]/100),
  630. t(individual_score[,sub_var_area])) #此处有问题,需要检查 20240128
  631. colnames(table_cor)<-c('volume(ml)','centile_volume',
  632. 'thickness(cm)','centile_thickness',
  633. 'surface_area(cm2)','centile_area')
  634. library("htmltools")
  635. library("webshot")
  636. export_formattable <- function(f, file, width = "100%", height = NULL,
  637. background = "white", delay = 0.2)
  638. {
  639. w <- as.htmlwidget(f, width = width, height = height)
  640. path <- html_print(w, background = background, viewer = NULL)
  641. url <- paste0("file:///", gsub("\\\\", "/", normalizePath(path)))
  642. webshot(url,
  643. file = file,
  644. selector = ".formattable_widget",
  645. zoom=4,
  646. delay = delay)
  647. }
  648. library(stringr)
  649. rownames(table_cor)<-str_remove_all(string = rownames(table_cor),pattern = del_str)
  650. table_cor<-round(table_cor,2)
  651. table_sub<-round(table_sub,2)
  652. library(formattable)
  653. #formattable(table_sub,list(centile=color_bar("pink",proportion)))
  654. table_sub<-data.frame(table_sub)
  655. p<-formattable(table_sub,
  656. list(centile = formatter("span",
  657. style = x ~ ifelse(x < 0.05,#条件1
  658. style(display = "block",
  659. color = "white",
  660. font.weight = "bold",
  661. "border-radius" = "10px",#圆角大小
  662. "padding-right" = "4px",#背景色框的大小
  663. "background-color" = "#990000"#背景色
  664. ),#满足条件1变绿加粗
  665. ifelse(x>=0.95,#条件2
  666. style(display = "block",
  667. color = "white",
  668. font.weight = "bold",
  669. "border-radius" = "10px",#圆角大小
  670. "padding-right" = "4px",#背景色框的大小
  671. "background-color" = "#00CCFF"#背景色
  672. ),#满足条件2变红加粗
  673. "color:orange")#都不满足橘黄色
  674. ))))
  675. export_formattable(p,"global_summary.png")
  676. table_cor<-data.frame(table_cor)
  677. p<-formattable(table_cor,
  678. list(centile_volume = formatter("span",
  679. style = x ~ ifelse(x < 0.05,#条件1
  680. style(display = "block",
  681. color = "white",
  682. font.weight = "bold",
  683. "border-radius" = "10px",#圆角大小
  684. "padding-right" = "4px",#背景色框的大小
  685. "background-color" = "#990000"#背景色
  686. ),#满足条件1变绿加粗
  687. ifelse(x>=0.95,#条件2
  688. style(display = "block",
  689. color = "white",
  690. font.weight = "bold",
  691. "border-radius" = "10px",#圆角大小
  692. "padding-right" = "4px",#背景色框的大小
  693. "background-color" = "#00CCFF"#背景色
  694. ),#满足条件2变红加粗
  695. "color:orange")#都不满足橘黄色
  696. )),
  697. centile_thickness = formatter("span",
  698. style = x ~ ifelse(x < 0.05,#条件1
  699. style(display = "block",
  700. color = "white",
  701. font.weight = "bold",
  702. "border-radius" = "10px",#圆角大小
  703. "padding-right" = "4px",#背景色框的大小
  704. "background-color" = "#990000"#背景色
  705. ),#满足条件1变绿加粗
  706. ifelse(x>=0.95,#条件2
  707. style(display = "block",
  708. color = "white",
  709. font.weight = "bold",
  710. "border-radius" = "10px",#圆角大小
  711. "padding-right" = "4px",#背景色框的大小
  712. "background-color" = "#00CCFF"#背景色
  713. ),#满足条件2变红加粗
  714. "color:orange")#都不满足橘黄色
  715. )),
  716. centile_area = formatter("span",
  717. style = x ~ ifelse(x < 0.05,#条件1
  718. style(display = "block",
  719. color = "white",
  720. font.weight = "bold",
  721. "border-radius" = "10px",#圆角大小
  722. "padding-right" = "4px",#背景色框的大小
  723. "background-color" = "#990000"#背景色
  724. ),#满足条件1变绿加粗
  725. ifelse(x>=0.95,#条件2
  726. style(display = "block",
  727. color = "white",
  728. font.weight = "bold",
  729. "border-radius" = "10px",#圆角大小
  730. "padding-right" = "4px",#背景色框的大小
  731. "background-color" = "#00CCFF"#背景色
  732. ),#满足条件2变红加粗
  733. "color:orange")#都不满足橘黄色
  734. ))))
  735. export_formattable(p,"local_summary.png")
  736. ```
  737. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="100%",fig.align='left',fig.show='hold',fig.cap=paste0('Note:lh,left hemisphere;rh:right hemisphere')}
  738. library(knitr)
  739. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/global_summary.png')
  740. p2<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/local_summary.png')
  741. knitr::include_graphics(c(p1))
  742. ```
  743. \newpage
  744. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="100%",fig.align='left',fig.show='hold',fig.cap=paste0('Note:lh,left hemisphere;rh:right hemisphere')}
  745. library(knitr)
  746. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/global_summary.png')
  747. p2<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/local_summary.png')
  748. knitr::include_graphics(c(p2))
  749. ```
  750. \newpage
  751. ## Disease propensity score:
  752. ```{r, warning = FALSE, include = FALSE,echo=FALSE}
  753. library(ggplot2)
  754. library(ggpubr)
  755. width1 = 4; height1=3
  756. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  757. individual_data<-read.csv('individual_centile_score.csv',header=TRUE,check.names=F);
  758. tem_data<-individual_data[1,individual_data[1,]<0.05]
  759. ```
  760. ```{r, warning = FALSE, include = FALSE,echo=FALSE}
  761. library(ggplot2)
  762. library(ggpubr)
  763. rm (list = ls ())
  764. width1 = 4; height1=3
  765. setwd('C:/ZZZ/work/manuscript/Lifespan-main/test');
  766. individual_data<-read.csv('individual_centile_score.csv',header=TRUE,check.names=F);
  767. model<-readRDS('C:/ZZZ/work/manuscript/Lifespan-main/test_zzz_update_20240116/figure3/global_and_local_feature/global_and_local_feature_ROC_loop_lasso_selection.rds')
  768. model$model$MCI
  769. if(individual_data$Sex=='Male')
  770. {
  771. individual_data[1,'Sex']<-1
  772. }
  773. if(individual_data$Sex=='Female')
  774. {
  775. individual_data[1,'Sex']<-0
  776. }
  777. individual_data$Sex<-as.numeric(individual_data$Sex)
  778. Pre_MCI<-predict(model$model$MCI,type='response',newdata=individual_data);
  779. Pre_AD<-predict(model$model$AD,type='response',newdata=individual_data);
  780. Pre_PD<-predict(model$model$PD,type='response',newdata=individual_data);
  781. Pre_CSVD<-predict(model$model$SVD,type='response',newdata=individual_data);
  782. Pre_MS<-predict(model$model$MS,type='response',newdata=individual_data);
  783. Pre_NMOSD<-predict(model$model$AQP4Pos_NMOSD,type='response',newdata=individual_data);
  784. library(fmsb)
  785. rad_data0<-data.frame(matrix(NA,3,6));
  786. rad_data0[1,] <- data.frame(t(c(1,1,1,1,1,1)));
  787. rad_data0[2,] <- data.frame(t(c(0,0,0,0,0,0)));
  788. rad_data0[3,] <- data.frame(t(c(Pre_MCI,Pre_AD,Pre_PD,Pre_CSVD,Pre_MS,Pre_NMOSD)));
  789. colnames(rad_data0)<-c('MCI','AD','PD','CSVD','MS','NMOSD')
  790. rownames(rad_data0)<-c('Max','Min','value')
  791. # rad_data0<-data.frame(matrix(NA,3,4));
  792. # rad_data0[1,] <- data.frame(t(c(1,1,1,1)));
  793. # rad_data0[2,] <- data.frame(t(c(0,0,0,0)));
  794. # rad_data0[3,] <- data.frame(t(c(Pre_MCI,Pre_AD,Pre_PD,Pre_CSVD)));
  795. # colnames(rad_data0)<-c('MCI','AD','PD','CSVD')
  796. # rownames(rad_data0)<-c('Max','Min','value')
  797. png(filename = paste0("disease_risk.png"),
  798. width = 1500,
  799. height = 1500,
  800. units = "px",
  801. bg = "white",
  802. res = 300)
  803. p<-radarchart(rad_data0,
  804. axistype = 1,
  805. seg=5,
  806. centerzero=TRUE,
  807. # Customize the polygon
  808. pcol = "black",
  809. pfcol = scales::alpha("lightgrey", 0.5),
  810. plwd = 2, plty = 1,
  811. # Customize the grid
  812. cglcol = "lightgrey", cglty = 2,
  813. #cglwd = 0.8,
  814. # Customize the axis
  815. axislabcol = "black",
  816. cglwd=1,
  817. # Variable labels
  818. vlcex = 1, palcex = 1,
  819. vlabels = colnames(rad_data0),
  820. caxislabels = c(0,1/5,
  821. 1/5*2,
  822. 1/5*3,
  823. 1/5*4,
  824. 1/5*5))
  825. print(p)
  826. dev.off()
  827. write.csv(rad_data0,'Disease_propensity_score.csv')
  828. #ggsave(paste0("disease_risk.png"),width = width1, height = height1, dpi = 300)
  829. #dev.off()
  830. ```
  831. ```{r warning = FALSE, include = TRUE,echo=FALSE, out.width="80%",fig.align='center',fig.show='hold',fig.cap=' '}
  832. library(knitr)
  833. p1<-file.path('C:/ZZZ/work/manuscript/Lifespan-main/test/disease_risk.png')
  834. knitr::include_graphics(c(p1))
  835. ```
  836. Note that this quantitative report is just for clinical research currently.

Brain_individual_report_output.Rmd at commit adca4ca, no license · at the source

Overview

Authors: Yuerong Lizhu1,2, Yiyi Chen3,4, Xinze Zhang5, Yuqi Luo1,2, Zhizheng Zhuo1,2, Jinhui Wang6,7,8, Yunyun Duan1,2, Li Chai1,2, Jun Qiu1,9, Ziyi Gao10, Tingting Wang11, Hongyi Yan12, Xiaoyun Liang13, Yilong Wang11,12,14, Yingying Su5, Ling Guan10,11,15, Yaou Liu1,2
ORCID iDs: Xiaoyun Liang
15 affiliations
  1. Department of Radiology, Beijing Tiantan Hospital, Capital Medical University, Beijing, China
  2. Tiantan Image Research Center, China National Clinical Research Center for Neurological Diseases, Beijing, China
  3. Department of Neurology, Shenzhen Second People's Hospital, The First Affiliated Hospital of Shenzhen University, Shenzhen, China
  4. Shenzhen Clinical Research Center for Neurological Diseases, Shenzhen, China
  5. Department of Stomatology, Beijing Tiantan Hospital, Capital Medical University, Beijing, China
  6. Institute for Brain Research and Rehabilitation, South China Normal University, Guangzhou, China
  7. Key Laboratory of Brain, Cognition and Education Sciences (South China Normal University), Ministry of Education, Guangzhou, China
  8. Guangdong Key Laboratory of Mental Health and Cognitive Science, South China Normal University, Guangzhou, China
  9. Department of Radiology, The First Affiliated Hospital of USTC, Division of Life Sciences and Medicine, University of Science and Technology of China, Hefei, China
  10. School of Interdisciplinary Science, Beijing Institute of Technology, Beijing, China
  11. Department of Neurology, Beijing Tiantan Hospital, Capital Medical University, Beijing, China
  12. China National Clinical Research Center for Neurological Diseases, Beijing, China
  13. Institute of Research and Clinical Innovations, Neusoft Medical Systems Co., Ltd., Shanghai, China
  14. National Center for Neurological Disorders, Beijing, China
  15. Department of Medicine, The University of British Columbia, Vancouver, Canada
Journal: Journal of oral microbiology, volume 18, issue 1, article 2705667
Dates: received 16 January 2026; accepted 14 July 2026; published online 5 August 2026
Type: Research article · Language: English
License: CC BY-NC
Identifiers: DOI 10.1080/20002297.2026.2705667 · PMID 42564713 · PMCID PMC13446054 · OpenAlex W7172537838
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), Alzheimer's / dementia (population), stroke (population)
Methods: Statistics, Machine learning, Connectivity, fMRI & imaging, Preprocessing
Keywords: Oral microbiota, CSVD, MRI, brain atrophy, cortical thinning, brain charts
Topic: Gut microbiota and health (Molecular Biology, Biochemistry, Genetics and Molecular Biology), according to OpenAlex
Funding: National Natural Science Foundation of China (82271516, 82330057, 82425101, 2023ZD0504800, 2023ZD0504803, 2023ZD0504802, 2023ZD0504804, 2023ZD0504801, 82330057, 82271516, 82425101); National Science and Technology Major Project (2023ZD0504800, 2023ZD0504802, 2023ZD0504803, 2023ZD0504804, 2023ZD0504801)
Citations: not cited yet (Europe PMC); 47 references in the paper

Abstract

Background: Prior studies have linked the microbiota to brain diseases, whereas the longitudinal effects of the oral microbiota on cortical thinning and cognitive impairments in cerebral small vessel disease (CSVD) remain unexplored.

Methods: We recruited 120 CSVD patients and 40 healthy controls (HCs). The subgingival plaque microbiota was sequenced by a metagenomic approach. Cortical thickness was assessed using GM-centile, an age- and sex-normalized MRI metric. Differential microbial taxa and KEGG orthologs (KOs) between groups were identified using MaAsLin2. Associations between key differential taxa with CSVD-specific cortical thinning were examined using the Spearman test, and those with MoCA score and plasma inflammatory markers (CRP and lymphocyte counts) were examined by linear regression models. Mediation models evaluated the indirect role of cortical thinning in the relationship between microbial abundance and cognitive function. Generalized estimation equations validated the longitudinal effects of the microbiota on cortical thinning progression.

Result: We identified distinct oral microbiota dysbiosis in CSVD, including depletion of g_Selenomonas and g_Leptotrichia and enrichment of g_Treponema. The abundance of these microbes was correlated with longitudinal cortical thinning in the frontal gyrus, insular lobes, and inferotemporal gyrus. Enrichment analysis revealed that CSVD-enriched KOs were linked to the upregulation of LPS-mediated pro-inflammatory pathways, while those depleted were associated with the reduced biosynthesis of neuroprotective short-chain fatty acids (SCFAs). g_Leptotrichia abundance showed negatively correlation with CRP (p = 0.045). Mediation analyses indicated that the association between g_Leptotrichia depletion and baseline cognitive impairment was mediated by bilateral insular cortical thinning (both p < 0.05). Additionally, the association between g_Leptotrichia depletion and one-year cognitive decline was mediated by superior frontal cortical thinning (p = 0.033).

Conclusions: Oral microbiota dysbiosis in CSVD patients reflects a pro-inflammatory state, characterized by enhanced LPS synthesis and reduced SCFAs production. This dysbiosis is associated with CSVD-specific cortical thinning in regions vulnerable to neuroinflammation, which in turn mediates cognitive impairment.

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

Repository

Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.

zhuozhizheng/Chinese_normative_reference_and_downstream_clinical_applications

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: adca4ca6c1c0f79f1914b22913ba898ed2714b28, 10 September 2024
Languages: R (28)
Size: 62 files, 28 scripts
Software Heritage: not archived
Found in: “Data availability statement”
Holds: README, 2 notebooks
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: reshape2 (22 files), ggplot2 (21 files), tidyverse (21 files), easystats (20 files), lmerTest (20 files), glmnet (19 files), pROC (9 files), ggpubr (7 files), ggseg (7 files), caret (3 files), pheatmap (2 files), survival (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
29 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;
  • 28 scripts, each with its path and the digest of its content;
  • 1 match 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 statement

The data involving participant-derived information (including brain MRI scans, oral microbiota metagenomic sequencing, and clinical and cognitive assessments) are available on request from Prof. Yaou Liu and Prof. Yilong Wang. The normative reference MRI dataset for quantifying the degree of brain atrophy used the data and models from the Chinese Human Brain Project. The source data and main codes for the statistical analysis are openly available online at GitHub: https://github.com/zhuozhizheng/Chinese_normative_reference_and_downstream_clinical_applications.

Reproduced under the paper's license (CC BY-NC), 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 3, 28 September 2026

  • Funding: added National Natural Science Foundation of China: 82271516, 82330057, 82425101, 2023ZD0504800, 2023ZD0504803, 2023ZD0504802, 2023ZD0504804, 2023ZD0504801, 82330057, 82271516, 82425101; National Science and Technology Major Project: 2023ZD0504800, 2023ZD0504802, 2023ZD0504803, 2023ZD0504804, 2023ZD0504801

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 17 authors, 6 keywords, 47 references.

Cite

This paper

Lizhu, Y., Chen, Y., Zhang, X., Luo, Y., Zhuo, Z., Wang, J., Duan, Y., Chai, L., Qiu, J., Gao, Z., Wang, T., Yan, H., Liang, X., Wang, Y., Su, Y., Guan, L., & Liu, Y. (2026). Oral microbiota dysbiosis related to the cortical thinning and cognitive impairment in cerebral small vessel disease. Journal of oral microbiology, 18(1), 2705667. https://doi.org/10.1080/20002297.2026.2705667

BibTeX

@article{lizhu2026oral,
author = {Lizhu, Yuerong and Chen, Yiyi and Zhang, Xinze and Luo, Yuqi and Zhuo, Zhizheng and Wang, Jinhui and Duan, Yunyun and Chai, Li and Qiu, Jun and Gao, Ziyi and Wang, Tingting and Yan, Hongyi and Liang, Xiaoyun and Wang, Yilong and Su, Yingying and Guan, Ling and Liu, Yaou},
title = {{Oral microbiota dysbiosis related to the cortical thinning and cognitive impairment in cerebral small vessel disease}},
journal = {Journal of oral microbiology},
year = {2026},
month = aug,
volume = {18},
number = {1},
pages = {2705667},
publisher = {Taylor \& Francis},
issn = {2000-2297},
doi = {10.1080/20002297.2026.2705667},
url = {https://doi.org/10.1080/20002297.2026.2705667},
pmid = {42564713},
pmcid = {PMC13446054}
}

RIS

TY - JOUR
AU - Lizhu, Yuerong
AU - Chen, Yiyi
AU - Zhang, Xinze
AU - Luo, Yuqi
AU - Zhuo, Zhizheng
AU - Wang, Jinhui
AU - Duan, Yunyun
AU - Chai, Li
AU - Qiu, Jun
AU - Gao, Ziyi
AU - Wang, Tingting
AU - Yan, Hongyi
AU - Liang, Xiaoyun
AU - Wang, Yilong
AU - Su, Yingying
AU - Guan, Ling
AU - Liu, Yaou
TI - Oral microbiota dysbiosis related to the cortical thinning and cognitive impairment in cerebral small vessel disease
T2 - Journal of oral microbiology
J2 - J Oral Microbiol
PY - 2026
DA - 2026/08/05
VL - 18
IS - 1
SP - 2705667
SN - 2000-2297
PB - Taylor & Francis
DO - 10.1080/20002297.2026.2705667
UR - https://doi.org/10.1080/20002297.2026.2705667
LA - en
ER -

CSL-JSON

{
"id": "10.1080/20002297.2026.2705667",
"type": "article-journal",
"title": "Oral microbiota dysbiosis related to the cortical thinning and cognitive impairment in cerebral small vessel disease",
"container-title": "Journal of oral microbiology",
"author": [
{
"family": "Lizhu",
"given": "Yuerong"
},
{
"family": "Chen",
"given": "Yiyi"
},
{
"family": "Zhang",
"given": "Xinze"
},
{
"family": "Luo",
"given": "Yuqi"
},
{
"family": "Zhuo",
"given": "Zhizheng"
},
{
"family": "Wang",
"given": "Jinhui"
},
{
"family": "Duan",
"given": "Yunyun"
},
{
"family": "Chai",
"given": "Li"
},
{
"family": "Qiu",
"given": "Jun"
},
{
"family": "Gao",
"given": "Ziyi"
},
{
"family": "Wang",
"given": "Tingting"
},
{
"family": "Yan",
"given": "Hongyi"
},
{
"family": "Liang",
"given": "Xiaoyun"
},
{
"family": "Wang",
"given": "Yilong"
},
{
"family": "Su",
"given": "Yingying"
},
{
"family": "Guan",
"given": "Ling"
},
{
"family": "Liu",
"given": "Yaou"
}
],
"container-title-short": "J Oral Microbiol",
"volume": "18",
"issue": "1",
"page": "2705667",
"DOI": "10.1080/20002297.2026.2705667",
"PMID": "42564713",
"PMCID": "PMC13446054",
"ISSN": "2000-2297",
"publisher": "Taylor & Francis",
"URL": "https://doi.org/10.1080/20002297.2026.2705667",
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
5
]
]
}
}

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.1093/neuonc/noag128 [code]
Spatially-resolved single-cell imaging of melanoma brain metastases identifies localized immune patterns predictive of immune checkpoint blockade response.
Journal: Neuro-oncology
In common: glmnet, pROC, survival, 6 other tools
[2] doi:10.3390/ijms27156925 [code]
XGBoost-SHAP Interpretable Modeling Identifies and Validates an Eight-Gene Biomarker for Hepatic Encephalopathy Risk Prediction in Cirrhosis.
Journal: International journal of molecular sciences
In common: glmnet, pROC, survival, 6 other tools
[3] doi:10.1093/braincomms/fcag146 [code]
Convergent structural brain alterations in chronic pain: a multi-metric individual participant data meta-analysis.
Journal: Brain communications
In common: ggseg, glmnet, pROC, 5 other tools, structural MRI / diffusion
[4] doi:10.1126/sciadv.aec9291 [code]
Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.
Journal: Science advances
In common: glmnet, pROC, caret, 5 other tools
[5] doi:10.1038/s41467-026-77170-3 [code]
DNA methylation profiling identifies long-range epigenetic silencing of clustered protocadherins as a key determinant of meningioma progression.
Journal: Nature communications
In common: pROC, survival, caret, 5 other tools
[6] doi:10.1016/j.isci.2026.115657 [code]
Integration of machine learning to develop a disulfidptosis model for predicting glioma prognosis, immunotherapy response, and drug.
Journal: iScience
In common: glmnet, pROC, survival, 5 other tools
[7] doi:10.1016/j.xcrm.2026.102682 [code]
TET CpG sequence-context-specific DNA demethylation shapes progression of IDH-mutant gliomas.
Journal: Cell reports. Medicine
In common: glmnet, pROC, survival, 5 other tools
[8] doi:10.3390/ijms27104466 [code]
Uncovering the Key Circuit FOSL2/FOS/EGR3/EGR1, Contributing to the Hyperexcitability of Excitatory Neurons in the Epileptic Temporal Cortex and Hippocampus.
Journal: International journal of molecular sciences
In common: glmnet, pROC, caret, 5 other tools
[9] doi:10.1038/s42003-026-10957-8 [code]
Brain defence by the extracellular matrix protein Cochlin.
Journal: Communications biology
In common: glmnet, survival, caret, 5 other tools
[10] doi:10.1093/braincomms/fcag236 [code]
Dynamic, state-dependent characteristics of cognitive fluctuations in Lewy body dementia: a magnetoencephalography study.
Journal: Brain communications
In common: ggseg, pROC, caret, 4 other tools, Alzheimer's / dementia

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.