OSCR

Lower resting-state functional connectivity between frontoparietal and sensory networks is associated with recent pain intensity in a community sample of youth.

Code ↔ Paper

6 matches 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 6 matches
  1. [1] § Methods › Resting-state fMRI ↔ ABCD_Pain_RSfMRI_Analysis/abcd_pain_rs_tables_figures_new.Rmd, lines 208–236 · score 0.88 · retrosplenial temporal, dorsal attention, ventral attention, cingulo opercular, salience, mouth
  2. [2] § Methods › Other analytic covariates ↔ ABCD_Pain_RSfMRI_Analysis/abcd_pain_rs_tables_figures_new.Rmd, lines 53–103 · score 0.62 · household income, sex assigned, birth, Answer, visit, Age
  3. [3] § Methods › Statistical analysis ↔ ABCD_Pain_RSfMRI_Analysis/abcd_pain_rs_run_models_new.Rmd, lines 117–227 · score 0.60 · lme4, intercepts, mixed, family, regression, models
  4. [4] § Results › Pain intensity ↔ ABCD_Pain_RSfMRI_Analysis/abcd_pain_rs_tables_figures_new.Rmd, lines 208–236 · score 0.58 · cingulo opercular, sensorimotor mouth, sensorimotor hand, auditory, pain
  5. [5] § Methods › Self-reported pain characteristics ↔ ABCD_Pain_RSfMRI_Analysis/abcd_pain_rs_tables_figures_new.Rmd, lines 349–378 · score 0.55 · pairwise complete, Spearman, daily, duration, body, correlation
  6. [6] § Methods › Final sample selection ↔ ABCD_Pain_RSfMRI_Analysis/1_abcd_pain_sample_setup_new.Rmd, lines 192–205 · score 0.51 · Y2 pain questionnaire, body map, reported pain, incomplete, discrepant, ABCD

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 · 607 lines · 24 KB · no license · 4 matches

  1. ---
  2. title: "ABCD Pain RS Tables & Figures"
  3. description: |
  4. author:
  5. - name: 'Sara Shao & Scott A. Jones'
  6. affiliation: Oregon Health & Science University
  7. date: "`r Sys.Date()`"
  8. #output:
  9. format:
  10. html:
  11. embed-resources: true
  12. page-layout: full
  13. ---
  14. ```{r setup, echo = FALSE, messsage = FALSE, warning = FALSE}
  15. # behind the scenes stuff for making a publishable markdown file
  16. knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE)
  17. # define packages to install
  18. packages_to_install <- c('tidyverse')
  19. # install all packages that are not already installed
  20. install.packages(setdiff(packages_to_install, rownames(installed.packages())),
  21. repos = "http://cran.us.r-project.org")
  22. ```
  23. # Setup
  24. ```{r load_packages}
  25. library(tidyverse)
  26. library(psych)
  27. library(ggcorrplot)
  28. library(patchwork)
  29. library(kableExtra)
  30. library(openxlsx)
  31. library(effects)
  32. library(lme4)
  33. library(conflicted)
  34. library(here)
  35. conflict_prefer("select", "dplyr")
  36. conflict_prefer("filter", "dplyr")
  37. conflict_prefer("count", "dplyr")
  38. ```
  39. # Data
  40. ```{r read_data}
  41. # this is the output of abcd_pain_rs_data_prep.Rmd
  42. load(here("data/abcd_pain_rs_cleaned_data.RData"))
  43. ```
  44. # Table 1 (Demographics)
  45. ```{r calculate-demographics}
  46. demographics_by_pain_status <- final_df %>%
  47. group_by(ph_y_pq_001) %>% # pain last month
  48. summarize(
  49. # Sample sizes
  50. total = n(),
  51. # Age statistics (mean ± SD)
  52. age = mean(ab_g_dyn__visit_age, na.rm = TRUE),
  53. age_sd = sd(ab_g_dyn__visit_age, na.rm = TRUE),
  54. # Sex assigned at birth (female = 2)
  55. sex = sum(ab_g_stc__cohort_sex == 2, na.rm=TRUE),
  56. sex_perc = sum(ab_g_stc__cohort_sex == 2, na.rm=TRUE)*100 / n(),
  57. # Race/Ethnicity categories
  58. white = sum(ab_g_stc__cohort_ethnrace__leg == 2, na.rm=TRUE),
  59. white_perc = sum(ab_g_stc__cohort_ethnrace__leg == 2, na.rm=TRUE)*100/n(),
  60. black = sum(ab_g_stc__cohort_ethnrace__leg == 3, na.rm=TRUE),
  61. black_perc = sum(ab_g_stc__cohort_ethnrace__leg == 3, na.rm=TRUE)*100/n(),
  62. asian = sum(ab_g_stc__cohort_ethnrace__leg == 4, na.rm=TRUE),
  63. asian_perc = sum(ab_g_stc__cohort_ethnrace__leg == 4, na.rm=TRUE)*100/n(),
  64. nat = sum(ab_g_stc__cohort_ethnrace__leg == 5, na.rm=TRUE),
  65. nat_perc = sum(ab_g_stc__cohort_ethnrace__leg == 5, na.rm=TRUE)*100/n(),
  66. pac = sum(ab_g_stc__cohort_ethnrace__leg == 6, na.rm=TRUE),
  67. pac_perc = sum(ab_g_stc__cohort_ethnrace__leg == 6, na.rm=TRUE)*100/n(),
  68. multi = sum(ab_g_stc__cohort_ethnrace__leg == 8, na.rm=TRUE),
  69. multi_perc = sum(ab_g_stc__cohort_ethnrace__leg == 8, na.rm=TRUE)*100/n(),
  70. other = sum(ab_g_stc__cohort_ethnrace__leg == 13, na.rm=TRUE),
  71. other_perc = sum(ab_g_stc__cohort_ethnrace__leg == 13, na.rm=TRUE)*100/n(),
  72. # Ethnicity
  73. hisp = sum(ab_g_stc__cohort_ethn == 1, na.rm=TRUE),
  74. hisp_perc = sum(ab_g_stc__cohort_ethn == 1, na.rm=TRUE)*100/n(),
  75. hisp = sum(ab_g_stc__cohort_ethnrace__leg == 1, na.rm=TRUE),
  76. hisp_perc = sum(ab_g_stc__cohort_ethnrace__leg == 1, na.rm=TRUE)*100/n(),
  77. # Household income (3-level categorization)
  78. less_inc = sum(income == "[<50K]", na.rm=TRUE),
  79. less_inc_perc = sum(income == "[<50K]", na.rm=TRUE)*100/n(),
  80. med_inc = sum(income == "[>=50K & <100K]", na.rm=TRUE),
  81. med_inc_perc = sum(income == "[>=50K & <100K]", na.rm=TRUE)*100/n(),
  82. more_inc = sum(income == "[>=100K]", na.rm=TRUE),
  83. more_inc_perc = sum(income == "[>=100K]", na.rm=TRUE)*100/n(),
  84. na_inc = sum(income == "DonotKnow/RefusetoAnswer", na.rm=TRUE),
  85. na_inc_perc = sum(income == "DonotKnow/RefusetoAnswer", na.rm=TRUE)*100/n()
  86. ) %>%
  87. ungroup()
  88. ```
  89. ```{r format-demo-table}
  90. demographics_table <- demographics_by_pain_status %>%
  91. mutate(ph_y_pq_001 = if_else(ph_y_pq_001 == 0, "No Pain", "Pain"),
  92. total = as.character(total),
  93. age = paste0(round(age,2), " (", round(age_sd, 2), ")"),
  94. sex = paste0(round(sex,2), " (", round(sex_perc, 1), ")"),
  95. white = paste0(white, " (", round(white_perc, 2), ")"),
  96. black = paste0(black, " (", round(black_perc, 2), ")"),
  97. asian = paste0(asian, " (", round(asian_perc, 2), ")"),
  98. nat = paste0(nat, " (", round(nat_perc, 2), ")"),
  99. pac = paste0(pac, " (", round(pac_perc, 2), ")"),
  100. multi = paste0(multi, " (", round(multi_perc, 2), ")"),
  101. other = paste0(other, " (", round(other_perc, 2), ")"),
  102. hisp = paste0(hisp, " (", round(hisp_perc, 2), ")"),
  103. less_inc = paste0(less_inc, " (", round(less_inc_perc, 2), ")"),
  104. med_inc = paste0(med_inc, " (", round(med_inc_perc, 2), ")"),
  105. more_inc = paste0(more_inc, " (", round(more_inc_perc, 2), ")"),
  106. na_inc = paste0(na_inc, " (", round(na_inc_perc, 2), ")"),
  107. race = " ", ethn = " ", inc = " ") %>%
  108. select(ph_y_pq_001, total, age, sex, race, white, black, hisp, asian, other,
  109. inc, less_inc, med_inc, more_inc, na_inc) %>%
  110. pivot_longer(cols = -ph_y_pq_001, names_to = "Characteristic", values_to = "Value") %>%
  111. pivot_wider(names_from = ph_y_pq_001, values_from = Value) %>%
  112. mutate(Characteristic = case_match(Characteristic,
  113. "total" ~ "Total participants",
  114. "age" ~ "Age",
  115. "sex" ~ "Sex assigned at birth = female (%)",
  116. "race" ~ "Race / Ethnicity (%)",
  117. "white" ~ "White",
  118. "black" ~ "Black (African American)",
  119. "asian" ~ "Asian",
  120. "nat" ~ "American Indian/Alaska Native",
  121. "pac" ~ "Native Hawaiian or Other Pacific Islander",
  122. "multi" ~ "More than One Race",
  123. "other" ~ "Other",
  124. "ethn" ~ "Ethnicity (%)",
  125. "hisp" ~ "Hispanic",
  126. "par_ed" ~ "Parental Education (%)",
  127. "less" ~ 'Less than high school diploma',
  128. "hs" ~ 'High school diploma or GED',
  129. "college" ~ 'Some college',
  130. "bach" ~ "Bachelor's degree",
  131. "post" ~ "Post-graduate degree",
  132. "inc" ~ "Household income (%)",
  133. "less_inc" ~ "Less than $50,000",
  134. "med_inc" ~ "$50,000 to $100,000",
  135. "more_inc" ~ "Greater than $100,000",
  136. "na_inc" ~ "Don't know or decline to answer",
  137. .default = Characteristic))
  138. ```
  139. ```{r}
  140. demographics_table %>%
  141. knitr::kable(format = "html", booktabs = TRUE, linesep = "") %>%
  142. row_spec(c(4,10), bold=TRUE) %>%
  143. add_indent(setdiff(1:nrow(demographics_table), c(1:4,10)))
  144. ```
  145. ```{r, eval=FALSE}
  146. # Save to Excel file
  147. # Create workbook and sheet
  148. wb <- createWorkbook()
  149. addWorksheet(wb, "Demographics")
  150. # Write data to sheet
  151. writeData(wb, "Demographics", demographics_table)
  152. # Create a bold style
  153. bold_style <- createStyle(textDecoration = "bold")
  154. # Bold specific rows
  155. bold_rows <- c(1, 5, 11)
  156. for (row in bold_rows) {
  157. addStyle(wb, sheet = "Demographics", style = bold_style,
  158. rows = row, cols = 1:ncol(demographics_table), gridExpand = TRUE)
  159. }
  160. # Save the file
  161. saveWorkbook(wb, file = "clean_tables_figures/Table1_demographics.xlsx", overwrite = TRUE)
  162. ```
  163. # Table S1-S6 (Model Results)
  164. ```{r}
  165. pain_last_month <- read_csv("output/last_month.csv")
  166. painscale <- read_csv("output/average_pain.csv")
  167. pain_scale_worst <- read_csv("output/worst_pain.csv")
  168. pain_limit <- read_csv("output/limitations.csv")
  169. pain_how_long <- read_csv("output/how_long.csv")
  170. bm_count <- read_csv("output/bm_count.csv")
  171. datadict <- read_csv("/home/exacloud/gscratch/NagelLab/abcd/abcd-data-dictionary-6.0.csv")
  172. ```
  173. ```{r}
  174. # Get matching table for full ROI names from ABCD data dictionary
  175. roi_dict <- datadict %>%
  176. filter(name %in% paste0('mr_y_rsfmri__corr__gpnet__', pain_last_month$Region, '_mean')) %>%
  177. select(name, label) %>%
  178. mutate(label = str_remove(label, 'Average correlation between Gordon networks: '),
  179. name = str_remove_all(name, 'mr_y_rsfmri__corr__gpnet__|_mean'))
  180. ```
  181. ```{r}
  182. # Define the order that the ROIs are to be listed in
  183. priority <- c(
  184. "sensorimotor hand", "sensorimotor mouth", "auditory", "visual",
  185. "fronto-parietal", "cingulo-opercular", "cingulo-parietal", "default",
  186. "dorsal attention", "retrosplenial temporal", "salience", "ventral attention"
  187. )
  188. # Helper function to reorder words based on priority
  189. reorder_words <- function(string, priority) {
  190. string <- str_trim(string)
  191. words <- str_split(string, " & ")[[1]] # Split into individual words
  192. sorted_words <- words[order(match(words, priority))] # Sort by priority
  193. paste(sorted_words, collapse = " & ") # Rejoin into a single string
  194. }
  195. # Function to rename ROIs and re-sort them based on priority
  196. clean_rois <- function(table, priority) {
  197. clean_table <- roi_dict %>%
  198. left_join(table, c('name' = 'Region')) %>%
  199. select(-name) %>%
  200. mutate(label = sapply(label, reorder_words, priority = priority)) %>%
  201. separate(label, into = c('roi1', 'roi2'), sep = ' & ') %>%
  202. mutate(order1 = match(roi1, priority), order2 = match(roi2, priority)) %>%
  203. arrange(order1, order2) %>%
  204. select(-order1, -order2)
  205. return(clean_table)
  206. }
  207. ```
  208. ```{r}
  209. # clean all tables except pain_how_long
  210. pain_last_month_clean <- clean_rois(pain_last_month, priority = priority)
  211. painscale_clean <- clean_rois(painscale, priority = priority)
  212. pain_scale_worst_clean <- clean_rois(pain_scale_worst, priority = priority)
  213. pain_limit_clean <- clean_rois(pain_limit, priority = priority)
  214. bm_count_clean <- clean_rois(bm_count, priority = priority)
  215. new_names <- c('Network 1', 'Network 2', 'Beta estimate', 'Standard error', 'T-statistic', 'P-value', 'Adj. p-value', 'Site variance', 'Family variance', 'Residual variance')
  216. colnames(pain_last_month_clean) <- new_names
  217. colnames(painscale_clean) <- new_names
  218. colnames(pain_scale_worst_clean) <- new_names
  219. colnames(pain_limit_clean) <- new_names
  220. colnames(bm_count_clean) <- new_names
  221. ```
  222. ```{r}
  223. # clean pain_how_long
  224. pain_how_long_clean <- clean_rois(pain_how_long, priority = priority)
  225. colnames(pain_how_long_clean) <- c('Network 1', 'Network 2', 'Term', 'F-statistic', 'P-value', 'Adj. p-value', 'Beta estimate', 'Standard error', 'T-statistic', 'T-test p-value', 'Site variance', 'Family variance', 'Residual variance')
  226. pain_how_long_clean <- pain_how_long_clean %>%
  227. # clean level names
  228. mutate(Term = case_when(Term == 'ph_y_pq_001__042' ~ 'few hours',
  229. Term == 'ph_y_pq_001__043' ~ 'half day',
  230. Term == 'ph_y_pq_001__044' ~ 'all day')) %>%
  231. # pivot wider
  232. pivot_wider(names_from = Term,
  233. values_from = c(`Beta estimate`, `Standard error`, `T-statistic`, `T-test p-value`),
  234. names_sep = ": ", names_vary = "slowest")
  235. ```
  236. ```{r, eval = FALSE}
  237. pain_last_month_clean
  238. painscale_clean
  239. pain_scale_worst_clean
  240. pain_limit_clean
  241. pain_how_long_clean
  242. bm_count_clean
  243. ```
  244. ```{r}
  245. write_csv(pain_last_month_clean, "clean_tables_figures/TableS1_pain_last_month.csv")
  246. write_csv(painscale_clean, "clean_tables_figures/TableS2_painscale.csv")
  247. write_csv(pain_scale_worst_clean, "clean_tables_figures/TableS3_pain_scale_worst.csv")
  248. write_csv(pain_limit_clean, "clean_tables_figures/TableS4_pain_limit.csv")
  249. write_csv(pain_how_long_clean, "clean_tables_figures/TableS5_pain_how_long.csv")
  250. write_csv(bm_count_clean, "clean_tables_figures/TableS6_bm_count.csv")
  251. ```
  252. # Table S7-S12 (Sex Interaction Model Results)
  253. ```{r}
  254. pain_last_month_sx <- read_csv("output/last_month_sx.csv")
  255. painscale_sx <- read_csv("output/average_pain_sx.csv")
  256. pain_scale_worst_sx <- read_csv("output/worst_pain_sx.csv")
  257. pain_limit_sx <- read_csv("output/limitations_sx.csv")
  258. pain_how_long_sx <- read_csv("output/how_long_sx.csv")
  259. bm_count_sx <- read_csv("output/bm_count_sx.csv")
  260. ```
  261. ```{r}
  262. # clean all tables except pain_how_long
  263. pain_last_month_sx_clean <- clean_rois(pain_last_month_sx, priority = priority)
  264. painscale_sx_clean <- clean_rois(painscale_sx, priority = priority)
  265. pain_scale_worst_sx_clean <- clean_rois(pain_scale_worst_sx, priority = priority)
  266. pain_limit_sx_clean <- clean_rois(pain_limit_sx, priority = priority)
  267. bm_count_sx_clean <- clean_rois(bm_count_sx, priority = priority)
  268. new_names <- c('Network 1', 'Network 2', 'Beta estimate', 'Standard error', 'T-statistic', 'P-value', 'Adj. p-value', 'Site variance', 'Family variance', 'Residual variance')
  269. colnames(pain_last_month_sx_clean) <- new_names
  270. colnames(painscale_sx_clean) <- new_names
  271. colnames(pain_scale_worst_sx_clean) <- new_names
  272. colnames(pain_limit_sx_clean) <- new_names
  273. colnames(bm_count_sx_clean) <- new_names
  274. ```
  275. ```{r}
  276. # clean pain_how_long
  277. pain_how_long_sx_clean <- clean_rois(pain_how_long_sx, priority = priority)
  278. colnames(pain_how_long_sx_clean) <- c('Network 1', 'Network 2', 'Term', 'F-statistic', 'P-value', 'Adj. p-value', 'Beta estimate', 'Standard error', 'T-statistic', 'T-test p-value', 'Site variance', 'Family variance', 'Residual variance')
  279. pain_how_long_sx_clean <- pain_how_long_sx_clean %>%
  280. # clean level names
  281. mutate(Term = case_when(grepl('ph_y_pq_001__042', Term) ~ 'few hours',
  282. grepl('ph_y_pq_001__043', Term) ~ 'half day',
  283. grepl('ph_y_pq_001__044', Term) ~ 'all day')) %>%
  284. # pivot wider
  285. pivot_wider(names_from = Term,
  286. values_from = c(`Beta estimate`, `Standard error`, `T-statistic`, `T-test p-value`),
  287. names_sep = ": ", names_vary = "slowest")
  288. ```
  289. ```{r, eval = FALSE}
  290. pain_last_month_sx_clean
  291. painscale_sx_clean
  292. pain_scale_worst_sx_clean
  293. pain_limit_sx_clean
  294. pain_how_long_sx_clean
  295. bm_count_sx_clean
  296. ```
  297. ```{r}
  298. write_csv(pain_last_month_sx_clean, "clean_tables_figures/TableS7_pain_last_month_sx.csv")
  299. write_csv(painscale_sx_clean, "clean_tables_figures/TableS8_painscale_sx.csv")
  300. write_csv(pain_scale_worst_sx_clean, "clean_tables_figures/TableS9_pain_scale_worst_sx.csv")
  301. write_csv(pain_limit_sx_clean, "clean_tables_figures/TableS10_pain_limit_sx.csv")
  302. write_csv(pain_how_long_sx_clean, "clean_tables_figures/TableS11_pain_how_long_sx.csv")
  303. write_csv(bm_count_sx_clean, "clean_tables_figures/TableS12_bm_count_sx.csv")
  304. ```
  305. # Figure S13 (Pain Correlation Plot)
  306. ```{r}
  307. library(dplyr)
  308. library(corrplot)
  309. vars_of_interest <- final_df %>%
  310. select(
  311. `Average pain intensity` = ph_y_pq_001__02,
  312. `Worst pain intensity` = ph_y_pq_001__03,
  313. `Pain Limitations` = ph_y_pq_001__05,
  314. `Number of body sites` = bm_count,
  315. `Daily pain duration` = ph_y_pq_001__04
  316. )
  317. cor_matrix <- cor(vars_of_interest,
  318. use = "pairwise.complete.obs",
  319. method = "spearman")
  320. # Save plot
  321. pdf("clean_tables_figures/FigureS13_correlation_plot.pdf", width = 7, height = 10)
  322. corrplot(cor_matrix,
  323. method = "circle",
  324. type = "upper",
  325. tl.col = "black",
  326. addCoef.col = "black",
  327. col = colorRampPalette(c("blue", "white", "red"))(200))
  328. dev.off()
  329. ```
  330. # Figure 1 (Sig. Connectivity Matrices)
  331. ```{r}
  332. # note: orientation (TL or BL) indicates how it will look in the plot, not in the table
  333. # `pmat = TRUE` will turn values into indicators of significance (default alpha = 0.05)
  334. results_mat <- function(table, column, pmat = FALSE, pthresh = 0.05, orientation = 'TL') {
  335. mat <- table %>%
  336. select(all_of(c('Network 1', 'Network 2')), !!sym(column)) %>%
  337. pivot_wider(names_from = 'Network 2', values_from = column) %>%
  338. column_to_rownames('Network 1')
  339. if (orientation == 'BL') { # if bottom-left
  340. mat <- mat %>%
  341. select(all_of(rev(names(.))))
  342. }
  343. if (pmat == TRUE) {
  344. mat <- mat %>%
  345. mutate(across(everything(), ~if_else(. < pthresh, 1, 0)))
  346. }
  347. return(mat)
  348. }
  349. ```
  350. ### Average Pain
  351. ```{r, warning=FALSE}
  352. beta_mat <- results_mat(painscale_clean, 'Beta estimate', orientation = 'BL')
  353. sig_mat <- results_mat(painscale_clean, 'Adj. p-value', pmat = TRUE, orientation = 'BL', pthresh = 0.01)
  354. ```
  355. ```{r}
  356. avg_pain_plot <- ggcorrplot(beta_mat,
  357. p.mat = as.matrix(sig_mat),
  358. ggtheme = theme_classic,
  359. #title = "",
  360. outline.color = 'black', # box outline
  361. pch = "*", # symbol for significance
  362. pch.cex = 5,
  363. tl.cex = 10, # size of axis labels
  364. digits = 5) +
  365. theme(
  366. #plot.title = element_text(size = 14, hjust = 0.5),
  367. #legend.title = element_text(size = 12)
  368. ) +
  369. scale_fill_gradient2(lim = c(-0.1,0.1), low = '#2f4c9e', mid = '#e2e2e2', high = '#bb1b2c') +
  370. labs(title = "Average Pain Intensity", fill = expression(beta))
  371. ```
  372. ### Worst Pain
  373. ```{r, warning=FALSE}
  374. beta_mat <- results_mat(pain_scale_worst_clean, 'Beta estimate', orientation = 'BL')
  375. sig_mat <- results_mat(pain_scale_worst_clean, 'Adj. p-value', pmat = TRUE, orientation = 'BL', pthresh = 0.01)
  376. ```
  377. ```{r}
  378. worst_pain_plot <- ggcorrplot(beta_mat,
  379. p.mat = as.matrix(sig_mat),
  380. ggtheme = theme_classic,
  381. #title = "",
  382. outline.color = 'black', # box outline
  383. pch = "*", # symbol for significance
  384. pch.cex = 5,
  385. tl.cex = 10, # size of axis labels
  386. digits = 5) +
  387. theme(
  388. #plot.title = element_text(size = 14, hjust = 0.5),
  389. #legend.title = element_text(size = 12)
  390. ) +
  391. scale_fill_gradient2(lim = c(-0.1,0.1), low = '#2f4c9e', mid = '#e2e2e2', high = '#bb1b2c') +
  392. labs(title = "Worst Pain Intensity", fill = expression(beta))
  393. ```
  394. ### Combine Plots
  395. ```{r, fig.width = 9, fig.height = 4}
  396. avg_pain_plot + worst_pain_plot +
  397. plot_annotation(tag_levels = "A", tag_suffix = ")")
  398. ```
  399. ```{r}
  400. ggsave("clean_tables_figures/Figure1.png", width = 14, height = 4, units = "in", dpi = 350)
  401. ```
  402. # Regression Figures
  403. ```{r}
  404. painscale %>%
  405. filter(`Corrected p-value` < 0.01)
  406. pain_scale_worst %>%
  407. filter(`Corrected p-value` < 0.01)
  408. ```
  409. ### Average Pain
  410. ```{r}
  411. # aud__frp
  412. mod1 <- lmer(mr_y_rsfmri__corr__gpnet__aud__frp_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__02 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  413. effects <- effect(term = "ph_y_pq_001__02", mod = mod1)
  414. effects_df <- as.data.frame(effects)
  415. p1 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__02, y = fit)) +
  416. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__02, y = mr_y_rsfmri__corr__gpnet__aud__frp_mean),
  417. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  418. geom_line(color = 'blue', size = 1.1) +
  419. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  420. theme_classic() +
  421. labs(x = "Average pain intensity", y = "Auditory to fronto-parietal")
  422. p1
  423. ```
  424. ```{r}
  425. # aud__vis
  426. mod2 <- lmer(mr_y_rsfmri__corr__gpnet__aud__vis_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__02 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  427. effects <- effect(term = "ph_y_pq_001__02", mod = mod2)
  428. effects_df <- as.data.frame(effects)
  429. p2 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__02, y = fit)) +
  430. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__02, y = mr_y_rsfmri__corr__gpnet__aud__vis_mean),
  431. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  432. geom_line(color = 'blue', size = 1.1) +
  433. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  434. theme_classic() +
  435. labs(x = "Average pain intensity", y = "Auditory to visual")
  436. p2
  437. ```
  438. ```{r}
  439. # cip__frp
  440. mod3 <- lmer(mr_y_rsfmri__corr__gpnet__cip__frp_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__02 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  441. effects <- effect(term = "ph_y_pq_001__02", mod = mod3)
  442. effects_df <- as.data.frame(effects)
  443. p3 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__02, y = fit)) +
  444. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__02, y = mr_y_rsfmri__corr__gpnet__cip__frp_mean),
  445. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  446. geom_line(color = 'blue', size = 1.1) +
  447. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  448. theme_classic() +
  449. labs(x = "Average pain intensity", y = "Fronto-parietal to cingulo-parietal")
  450. p3
  451. ```
  452. ```{r}
  453. # frp__smh
  454. mod4 <- lmer(mr_y_rsfmri__corr__gpnet__frp__smh_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__02 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  455. effects <- effect(term = "ph_y_pq_001__02", mod = mod4)
  456. effects_df <- as.data.frame(effects)
  457. p4 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__02, y = fit)) +
  458. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__02, y = mr_y_rsfmri__corr__gpnet__frp__smh_mean),
  459. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  460. geom_line(color = 'blue', size = 1.1) +
  461. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  462. theme_classic() +
  463. labs(x = "Average pain intensity", y = "Sensorimotor hand to fronto-parietal")
  464. p4
  465. ```
  466. ```{r}
  467. # frp__smm
  468. mod5 <- lmer(mr_y_rsfmri__corr__gpnet__frp__smm_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__02 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  469. effects <- effect(term = "ph_y_pq_001__02", mod = mod5)
  470. effects_df <- as.data.frame(effects)
  471. p5 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__02, y = fit)) +
  472. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__02, y = mr_y_rsfmri__corr__gpnet__frp__smm_mean),
  473. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  474. geom_line(color = 'blue', size = 1.1) +
  475. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  476. theme_classic() +
  477. labs(x = "Average pain intensity", y = "Sensorimotor mouth to fronto-parietal")
  478. p5
  479. ```
  480. ### Worst Pain
  481. ```{r}
  482. # aud__frp
  483. mod6 <- lmer(mr_y_rsfmri__corr__gpnet__aud__frp_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__03 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  484. effects <- effect(term = "ph_y_pq_001__03", mod = mod6)
  485. effects_df <- as.data.frame(effects)
  486. p6 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__03, y = fit)) +
  487. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__03, y = mr_y_rsfmri__corr__gpnet__aud__frp_mean),
  488. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  489. geom_line(color = 'blue', size = 1.1) +
  490. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  491. theme_classic() +
  492. labs(x = "Worst pain intensity", y = "Auditory to fronto-parietal")
  493. p6
  494. ```
  495. ```{r}
  496. # aud__vis
  497. mod7 <- lmer(mr_y_rsfmri__corr__gpnet__aud__vis_mean ~ ab_g_dyn__visit_age + ab_g_stc__cohort_sex + mr_y_qc__mot__rsfmri__mot_mean + income + ph_y_pq_001__03 + (1 | ab_g_dyn__design_site) + (1|ab_g_stc__design_id__fam), data = final_df)
  498. effects <- effect(term = "ph_y_pq_001__03", mod = mod7)
  499. effects_df <- as.data.frame(effects)
  500. p7 <- ggplot(data = effects_df, mapping = aes(x = ph_y_pq_001__03, y = fit)) +
  501. geom_point(data = final_df, mapping = aes(x = ph_y_pq_001__03, y = mr_y_rsfmri__corr__gpnet__aud__vis_mean),
  502. alpha = 0.3, color = 'darkgrey', size = 0.8) +
  503. geom_line(color = 'blue', size = 1.1) +
  504. geom_ribbon(aes(ymin = lower, ymax = upper), data = effects_df, alpha = 0.3, fill = 'blue') +
  505. theme_classic() +
  506. labs(x = "Worst pain intensity", y = "Auditory to visual")
  507. p7
  508. ```
  509. ### Combine Plots
  510. ```{r, fig.height = 10, fig.width = 7}
  511. (p1 + p2) / (p3 + p4) / (p5 + p6) / (p7 + plot_spacer()) +
  512. plot_annotation(tag_levels = "A", tag_suffix = ")")
  513. ```
  514. ```{r, eval=FALSE}
  515. ggsave("clean_tables_figures/Figure2_reg_plots.png", width = 7, height = 10, dpi = 350)
  516. ```

abcd_pain_rs_tables_figures_new.Rmd, no license · at the source

Overview

Authors: Carmen I Bango1,2, Scott A Jones1,3, Angelica M Morales1,3, Sara Shao1,3, Dani Y Del Rubin1,3, Arturo Lopez Flores1, Amy L Holley2, Bonnie J Nagel1,3,4, Anna C Wilson2
  1. Department of Psychiatry, Oregon Health & Science University, Portland, OR, USA
  2. Department of Pediatrics, Institute on Development and Disability, Oregon Health & Science University, Portland, OR, USA
  3. Steven J. Sharp Center for Mental Health Innovation, Oregon Health & Science University, Portland, OR, USA
  4. Department of Behavioral Neuroscience, Oregon Health & Science University, Portland, OR, USA
Institutions: Oregon Health & Science University (United States)
Journal: Neuroimage. Reports, volume 6, issue 3, article 100366
Dates: received 16 January 2026; accepted 5 June 2026; published online 12 June 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1016/j.ynirp.2026.100366 · PMID 42327571 · PMCID PMC13279023 · OpenAlex W7164546387
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: fMRI (modality), human (organism), pain (population)
Methods: Spectral & time-frequency, Statistics, Connectivity, fMRI & imaging
Keywords: ABCD study, Resting-state functional connectivity, Adolescent pain, Pain intensity, Functional magnetic resonance imaging, Brain networks
Topic: Pain Mechanisms and Treatments (Physiology, Medicine), according to OpenAlex
Funding: National Institutes of Health (S10OD016356, S10OD034224, S10OD021701); Oregon Health and Science University; National Institute of Child Health and Human Development (R21 HD112210); Office of Research Infrastructure Programs
Citations: not cited yet (Europe PMC); 99 references in the paper

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 6 matches between paragraphs and lines of code.

OSF w482t

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Languages: R (4)
Size: 4 files, 4 scripts
Software Heritage: not checked
Found in: the text, “Statistical analysis”
Holds: 4 notebooks
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (4 files), data.table (3 files), lme4 (2 files), broom (1 file), lmerTest (1 file), patchwork (1 file), psych (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
4 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;
  • 4 scripts, each with its path and the digest of its content;
  • 6 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:

  • no repository, dataset or request procedure was recognized in it

Read it in the paper: doi.org/10.1016/j.ynirp.2026.100366.

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 2, 28 September 2026

  • Authors: added Carmen I Bango (0009-0006-8866-0725); Scott A Jones (0000-0003-1051-4200); Sara Shao (0009-0005-4403-6296); Dani Y Del Rubin (0000-0002-6292-7392); Anna C Wilson (0000-0001-8672-068X); removed Carmen I Bango; Scott A Jones; Sara Shao; Dani Y Del Rubin; Anna C Wilson

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 6 keywords, 4 funders, 96 references.

Cite

This paper

Bango, C. I., Jones, S. A., Morales, A. M., Shao, S., Del Rubin, D. Y., Lopez Flores, A., Holley, A. L., Nagel, B. J., & Wilson, A. C. (2026). Lower resting-state functional connectivity between frontoparietal and sensory networks is associated with recent pain intensity in a community sample of youth. Neuroimage. Reports, 6(3), 100366. https://doi.org/10.1016/j.ynirp.2026.100366

BibTeX

@article{bango2026lower,
author = {Bango, Carmen I and Jones, Scott A and Morales, Angelica M and Shao, Sara and Del Rubin, Dani Y and Lopez Flores, Arturo and Holley, Amy L and Nagel, Bonnie J and Wilson, Anna C},
title = {{Lower resting-state functional connectivity between frontoparietal and sensory networks is associated with recent pain intensity in a community sample of youth}},
journal = {Neuroimage. Reports},
year = {2026},
month = jun,
volume = {6},
number = {3},
pages = {100366},
publisher = {Elsevier},
issn = {2666-9560},
doi = {10.1016/j.ynirp.2026.100366},
url = {https://doi.org/10.1016/j.ynirp.2026.100366},
pmid = {42327571},
pmcid = {PMC13279023}
}

RIS

TY - JOUR
AU - Bango, Carmen I
AU - Jones, Scott A
AU - Morales, Angelica M
AU - Shao, Sara
AU - Del Rubin, Dani Y
AU - Lopez Flores, Arturo
AU - Holley, Amy L
AU - Nagel, Bonnie J
AU - Wilson, Anna C
TI - Lower resting-state functional connectivity between frontoparietal and sensory networks is associated with recent pain intensity in a community sample of youth
T2 - Neuroimage. Reports
J2 - Neuroimage Rep
PY - 2026
DA - 2026/06/12
VL - 6
IS - 3
SP - 100366
SN - 2666-9560
PB - Elsevier
DO - 10.1016/j.ynirp.2026.100366
UR - https://doi.org/10.1016/j.ynirp.2026.100366
LA - en
ER -

CSL-JSON

{
"id": "10.1016/j.ynirp.2026.100366",
"type": "article-journal",
"title": "Lower resting-state functional connectivity between frontoparietal and sensory networks is associated with recent pain intensity in a community sample of youth",
"container-title": "Neuroimage. Reports",
"author": [
{
"family": "Bango",
"given": "Carmen I"
},
{
"family": "Jones",
"given": "Scott A"
},
{
"family": "Morales",
"given": "Angelica M"
},
{
"family": "Shao",
"given": "Sara"
},
{
"family": "Del Rubin",
"given": "Dani Y"
},
{
"family": "Lopez Flores",
"given": "Arturo"
},
{
"family": "Holley",
"given": "Amy L"
},
{
"family": "Nagel",
"given": "Bonnie J"
},
{
"family": "Wilson",
"given": "Anna C"
}
],
"container-title-short": "Neuroimage Rep",
"volume": "6",
"issue": "3",
"page": "100366",
"DOI": "10.1016/j.ynirp.2026.100366",
"PMID": "42327571",
"PMCID": "PMC13279023",
"ISSN": "2666-9560",
"publisher": "Elsevier",
"URL": "https://doi.org/10.1016/j.ynirp.2026.100366",
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
12
]
]
}
}

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.1002/jcv2.70135 [code]
Alterations in resting-state functional connectivity relate to psychopathology trajectories during emerging adolescence.
Journal: JCPP advances
In common: psych, broom, lmerTest, 3 other tools, fMRI, 5 references
[2] doi:10.1038/s41467-026-73072-6 [code]
Mapping the spatiotemporal continuum of structural connectivity development across the human connectome in youth.
Journal: Nature communications
In common: psych, lmerTest, lme4, 2 other tools, 3 references
[3] doi:10.1073/pnas.2606871123 [code]
Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: psych, broom, lmerTest, 4 other tools
[4] doi:10.1038/s41398-026-04010-9 [code]
Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.
Journal: Translational psychiatry
In common: psych, broom, lmerTest, 4 other tools
[5] 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: psych, broom, data.table, 1 other tool, pain, 2 references
[6] doi:10.1038/s41398-026-04045-y [code]
Physical-Digital and social-nonsocial extracurricular engagement: differential effects on brain development and psychological outcomes in children.
Journal: Translational psychiatry
In common: broom, lme4, tidyverse, 4 references
[7] doi:10.1016/j.dcn.2026.101738 [code]
Timing and tempo of puberty and neurodevelopment following adversity: A registered report.
Journal: Developmental cognitive neuroscience
In common: psych, lme4, patchwork, 1 other tool, 3 references
[8] doi:10.1038/s41537-026-00761-y [code]
The role of fear learning in the development of psychosis: an EEG study utilizing a differential fear conditioning paradigm in people with psychotic vulnerability.
Journal: Schizophrenia (Heidelberg, Germany)
In common: psych, broom, lmerTest, 3 other tools
[9] doi:10.1073/pnas.2603114123 [code]
The human hippocampus can pattern separate memories by meaning.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: psych, broom, lmerTest, 3 other tools
[10] doi:10.1038/s41467-026-72934-3 [code]
Multi-focal ultrasound neuromodulation to the dorsal anterior cingulate cortex disrupts behavioural and neural pain processing.
Journal: Nature communications
In common: broom, lmerTest, lme4, 1 other tool, pain, fMRI, 1 reference

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.