Do common dopaminergic variants modulate processing speed in cognitive aging? A longitudinal candidate gene study.
The 20 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Materials and methods › Statistical analysis › Exploratory post-mortem analyses. ↔ 10_postmortem_neuropathology_analysis.sh, lines 183–233 · score 0.79 · binary outcomes, Thal phase, post mortem, Braak stage, synuclein, linear
- [2] § Materials and methods › Statistical analysis › Exploratory post-mortem analyses. ↔ 11_postmortem_neuropathology_results_and_checks.R, lines 241–297 · score 0.71 · Thal phase, Braak stage, cognitive trajectories, APOE, death, TDP
- [3] § Results › Exploratory neuropathological analyses ↔ 13_postmortem_synaptic_density_results.R, lines 90–146 · score 0.71 · occipital cortex synaptic, parietal cortex, frontal cortex, Synaptic density, Bonferroni, FDR
- [4] § Materials and methods › Statistical analysis › Exploratory post-mortem analyses. ↔ 10_postmortem_neuropathology_analysis.sh, lines 1–59 · score 0.66 · Thal phase, post mortem, Braak stage, pathological, TDP, synuclein
- [5] § Results › Secondary outcomes: Other cognitive domains › Gene-based associations. ↔ 05_gene_based_magma_results.R, lines 1–28 · score 0.66 · Episodic Memory, MAGMA gene, Fluid Reasoning, cognitive outcomes, Vocabulary, slopes
- [6] § Results › Exploratory neuropathological analyses ↔ 11_postmortem_neuropathology_results_and_checks.R, lines 1–47 · score 0.65 · binary neuropathology outcomes, sparse cells, exploratory SNP
- [7] § Materials and methods › Statistical analysis › Primary genetic association analyses. ↔ 03_primary_single_snp_results_and_diagnostics.R, lines 1–54 · score 0.63 · episodic memory, fluid reasoning, Single SNP, vocabulary, processing speed, intercepts
- [8] § Materials and methods › Genotyping and quality control › Quality control procedures. ↔ 01_prepare_analysis_files.R, lines 1–83 · score 0.62 · ppp1r1b, DRD5, DRD3, DRD1, DBH, DDC
- [9] § Materials and methods › Statistical analysis › Exploratory post-mortem analyses. ↔ 13_postmortem_synaptic_density_results.R, lines 148–186 · score 0.62 · frontal cortex, synaptic density, hippocampus, occipital, parietal, exploratory
- [10] § Materials and methods › Genotyping and quality control › Quality control procedures. ↔ 02_primary_single_snp_analysis.sh, lines 1–58 · score 0.60 · PC1 PC20, LD pruned, indep, pairwise, PLINK, genotyped
- [11] § Materials and methods › Statistical analysis › Gene-based analyses. ↔ 07_pathway_allele_score_models.R, lines 1–32 · score 0.59 · dopamine pathway allele, covariate adjustment, allele score, unweighted
- [12] § Results › Pathway-wide analysis: Dopamine pathway allele score ↔ 07_pathway_allele_score_models.R, lines 54–78 · score 0.58 · pathway allele score, dopamine pathway alleles, S4, processing speed, model
- [13] § Materials and methods › Genotyping and quality control ↔ 01_prepare_analysis_files.R, lines 1–83 · score 0.57 · ppp1r1b, DRD3, DRD1, DBH, DDC, COMT
- [14] § Materials and methods › Statistical analysis › Gene-based analyses. ↔ 06_pathway_allele_score.sh, the whole file · a weak match · score 0.57 · dopamine pathway allele, allele score, stricter, unweighted, r2, LD
- [15] § Materials and methods › Statistical analysis › Analysis overview. ↔ 03_primary_single_snp_results_and_diagnostics.R, lines 1–54 · score 0.55 · episodic memory, fluid reasoning, vocabulary, processing speed, dopaminergic, cognitive
- [16] § Materials and methods › Genotyping and quality control › Quality control procedures. ↔ 08_clinical_lifestyle_sensitivity_analysis.sh, lines 1–60 · score 0.53 · PC1 PC20, LD pruned, Genome wide, PLINK, genotyped, covariates
- [17] § Materials and methods › Protocol ↔ 01_prepare_analysis_files.R, lines 346–417 · score 0.52 · DBP, SBP, depression, status, MVPA, lifestyle
- [18] § Results › Exploratory neuropathological analyses ↔ 13_postmortem_synaptic_density_results.R, lines 211–242 · score 0.51 · Model R2, Synaptic density, cognitive trajectories, S13, FDR
- [19] § Materials and methods › Statistical analysis › Sensitivity analysis with clinical covariates. ↔ 01_prepare_analysis_files.R, lines 419–478 · score 0.51 · MCAR, imputation, mice, status, predictive, variables
- [20] § Materials and methods › Cognitive assessment › Cognitive battery. ↔ 05_gene_based_magma_results.R, lines 1–28 · score 0.51 · Episodic memory, Fluid reasoning, Vocabulary, Processing speed, Cognitive
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 · 782 lines · 29 KB · no license · 4 matches
- #!/usr/bin/env Rscript
- # 01_prepare_analysis_files.R
- #
- # Prepare the genotype, phenotype, covariate, neuropathology, and synaptic
- # analysis files used in the revised dopamine-pathway analyses.
- suppressPackageStartupMessages({
- library(tidyverse)
- library(mice)
- library(naniar)
- })
- # ─────────────────────────────────────────────────────────────────────────────
- # 0. Project paths and settings
- # ─────────────────────────────────────────────────────────────────────────────
- project_dir <- "/path/to/authorised/project_directory"
- plink_exe <- "plink"
- revision_dir <- file.path(project_dir, "PLOS_revision_genomewide_PC_analysis")
- qc_dir <- file.path(project_dir, "qc_outputs")
- clean_dir <- file.path(project_dir, "clean_data")
- pca_dir <- file.path(project_dir, "JOURNAL_REVISIONS")
- neuropath_source_dir <- file.path(project_dir, "NEUROPATH ANALYSIS")
- synaptic_source_dir <- file.path(project_dir, "SYNAPTIC ANALYSIS")
- neuropath_revision_dir <- file.path(revision_dir, "postmortem_neuropathology_genomewidePC20")
- synaptic_revision_dir <- file.path(revision_dir, "postmortem_synaptic_genomewidePC20")
- dir.create(revision_dir, showWarnings = FALSE, recursive = TRUE)
- dir.create(qc_dir, showWarnings = FALSE, recursive = TRUE)
- dir.create(clean_dir, showWarnings = FALSE, recursive = TRUE)
- dir.create(neuropath_revision_dir, showWarnings = FALSE, recursive = TRUE)
- dir.create(synaptic_revision_dir, showWarnings = FALSE, recursive = TRUE)
- genes <- c("comt", "drd2", "drd3", "dat1", "dbh", "ppp1r1b", "ddc", "drd1", "th", "drd5")
- pc_vars <- paste0("PC", 1:20)
- genomewide_pc_file <- file.path(pca_dir, "MANC_1000_pca_results.eigenvec")
- cognitive_pheno_for_fam <- file.path(project_dir, "cognitive_clean.tsv")
- main_base_file <- file.path(project_dir, "journal_main_phenotypes_base.tsv")
- sensitivity_phenotype_base_file <- file.path(project_dir, "journal_sensitivity_phenotypes_base.tsv")
- sensitivity_covariate_base_file <- file.path(project_dir, "journal_sensitivity_covariates_base.tsv")
- personal_details_file <- file.path(project_dir, "PersonalDetailsQuestionnaire_04-2021.csv")
- clinical_file <- file.path(project_dir, "ClinicalData_04-2021 (1).csv")
- depression_file <- file.path(project_dir, "DepressionData_04-2021 (1).csv")
- sleep_file <- file.path(project_dir, "PersonalDetailsQuestionnaire_Sleep_04-2021 (1).csv")
- neuropath_continuous_base_file <- file.path(neuropath_source_dir, "neuropath_basic_final_plink.tsv")
- neuropath_binary_base_file <- file.path(neuropath_source_dir, "neuropath_basic_final_recoded_plink.tsv")
- synaptic_base_file <- file.path(synaptic_source_dir, "synaptic_final_plink.tsv")
- main_output_file <- file.path(revision_dir, "journal_main_phenotypes_genomewide_PC20.tsv")
- main_keep_file <- file.path(revision_dir, "journal_main_keep_ids_genomewide_PC20.txt")
- sensitivity_output_file <- file.path(revision_dir, "journal_sensitivity_phenotypes_covariates_genomewide_PC20.tsv")
- sensitivity_keep_file <- file.path(revision_dir, "journal_sensitivity_keep_ids_genomewide_PC20.txt")
- sensitivity_covariate_list_file <- file.path(revision_dir, "journal_sensitivity_covariates_for_plink.txt")
- neuropath_continuous_output_file <- file.path(neuropath_revision_dir, "neuropath_basic_final_genomewide_PC20_plink.tsv")
- neuropath_binary_output_file <- file.path(neuropath_revision_dir, "neuropath_basic_final_recoded_genomewide_PC20_plink.tsv")
- neuropath_keep_file <- file.path(neuropath_revision_dir, "neuropath_basic_final_genomewide_PC20_ids.txt")
- neuropath_marker_trajectory_file <- file.path(neuropath_revision_dir, "neuropath_marker_trajectory_models.tsv")
- neuropath_subset_genotype_prefix <- file.path(neuropath_revision_dir, "dopamine_ps_neuropathology_subset")
- synaptic_output_file <- file.path(synaptic_revision_dir, "synaptic_final_genomewide_PC20_plink.tsv")
- synaptic_keep_file <- file.path(synaptic_revision_dir, "synaptic_final_genomewide_PC20_ids.txt")
- synaptic_marker_trajectory_file <- file.path(synaptic_revision_dir, "synaptic_marker_trajectory_models.tsv")
- synaptic_subset_genotype_prefix <- file.path(synaptic_revision_dir, "dopamine_ps_synaptic_subset")
- expected_main_n <- 1559
- expected_sensitivity_n <- 434
- expected_neuropath_n <- 116
- expected_synaptic_n <- 50
- # ─────────────────────────────────────────────────────────────────────────────
- # Helper functions
- # ─────────────────────────────────────────────────────────────────────────────
- run_plink <- function(args) {
- message("\nPLINK command:")
- message(plink_exe, " ", paste(args, collapse = " "))
- status <- system2(plink_exe, args = args)
- if (!identical(status, 0L)) {
- stop("PLINK command failed.")
- }
- }
- check_file_exists <- function(path, label = path) {
- if (!file.exists(path)) {
- stop(paste("Missing required file:", label, "\nPath:", path))
- }
- }
- check_bfile_exists <- function(prefix, label = prefix) {
- check_file_exists(paste0(prefix, ".bed"), paste0(label, ".bed"))
- check_file_exists(paste0(prefix, ".bim"), paste0(label, ".bim"))
- check_file_exists(paste0(prefix, ".fam"), paste0(label, ".fam"))
- }
- standardise_ids <- function(data) {
- data %>%
- mutate(
- FID = as.character(FID),
- IID = as.character(IID)
- )
- }
- check_duplicate_ids <- function(data, dataset_name) {
- duplicate_ids <- data %>%
- count(FID, IID) %>%
- filter(n > 1)
- if (nrow(duplicate_ids) > 0) {
- print(duplicate_ids, n = Inf)
- stop(paste("Duplicate FID/IID pairs detected in", dataset_name))
- }
- }
- check_required_variables <- function(data, required_vars, dataset_name) {
- missing_vars <- setdiff(required_vars, names(data))
- if (length(missing_vars) > 0) {
- print(missing_vars)
- stop(paste("Required variables missing from", dataset_name))
- }
- }
- warn_if_unexpected_n <- function(data, expected_n, dataset_name) {
- if (!is.na(expected_n) && nrow(data) != expected_n) {
- warning(paste(dataset_name, "has", nrow(data), "rows; expected", expected_n))
- }
- }
- replace_pcs <- function(data, pc_data) {
- data %>%
- standardise_ids() %>%
- select(-any_of(pc_vars)) %>%
- left_join(pc_data, by = c("FID", "IID"))
- }
- check_complete_pcs <- function(data, dataset_name) {
- missing_pcs <- data %>%
- summarise(across(all_of(pc_vars), ~ sum(is.na(.))))
- if (any(missing_pcs > 0)) {
- print(missing_pcs)
- stop(paste("Missing genome-wide PCs in", dataset_name))
- }
- }
- # ─────────────────────────────────────────────────────────────────────────────
- # 1. SNP QC and per-gene clean files
- # ─────────────────────────────────────────────────────────────────────────────
- for (gene in genes) {
- raw_prefix <- file.path(project_dir, gene)
- clean_prefix <- file.path(clean_dir, paste0(gene, "_clean"))
- if (!file.exists(paste0(raw_prefix, ".bed"))) {
- warning(paste("Raw genotype panel missing; skipping:", gene))
- next
- }
- run_plink(c(
- "--bfile", raw_prefix,
- "--missing",
- "--hardy",
- "--freq",
- "--out", file.path(qc_dir, gene)
- ))
- run_plink(c(
- "--bfile", raw_prefix,
- "--indep-pairwise", "1500", "150", "0.5",
- "--out", file.path(qc_dir, paste0(gene, "_prune"))
- ))
- run_plink(c(
- "--bfile", raw_prefix,
- "--mind", "0.02",
- "--geno", "0.02",
- "--maf", "0.05",
- "--hwe", "1e-4",
- "--make-bed",
- "--out", clean_prefix
- ))
- }
- clean_prefixes <- file.path(clean_dir, paste0(genes, "_clean"))
- clean_prefixes <- clean_prefixes[file.exists(paste0(clean_prefixes, ".bed"))]
- if (length(clean_prefixes) < 2) {
- stop("Fewer than two clean dopamine gene panels are available for merging.")
- }
- # ─────────────────────────────────────────────────────────────────────────────
- # 2. Merge clean gene panels into dopamine_clean
- # ─────────────────────────────────────────────────────────────────────────────
- base_gene_prefix <- clean_prefixes[1]
- merge_other_prefixes <- clean_prefixes[-1]
- merge_list_file <- file.path(clean_dir, "merge_list.txt")
- dopamine_clean_prefix <- file.path(project_dir, "dopamine_clean")
- writeLines(merge_other_prefixes, merge_list_file)
- run_plink(c(
- "--bfile", base_gene_prefix,
- "--merge-list", merge_list_file,
- "--make-bed",
- "--out", dopamine_clean_prefix
- ))
- check_bfile_exists(dopamine_clean_prefix, "dopamine_clean")
- # ─────────────────────────────────────────────────────────────────────────────
- # 3. Attach cognitive phenotype to create dopamine_ps
- # ─────────────────────────────────────────────────────────────────────────────
- check_file_exists(cognitive_pheno_for_fam, "cleaned cognitive phenotype file")
- dopamine_ps_prefix <- file.path(project_dir, "dopamine_ps")
- run_plink(c(
- "--bfile", dopamine_clean_prefix,
- "--pheno", cognitive_pheno_for_fam,
- "--make-bed",
- "--out", dopamine_ps_prefix
- ))
- check_bfile_exists(dopamine_ps_prefix, "dopamine_ps")
- # ─────────────────────────────────────────────────────────────────────────────
- # 4. Prepare main cognitive phenotype + genome-wide PC20 file
- # ─────────────────────────────────────────────────────────────────────────────
- check_file_exists(genomewide_pc_file, "genome-wide PC file")
- genomewide_pcs <- read_table(
- genomewide_pc_file,
- col_names = c("FID", "IID", pc_vars),
- col_types = cols(
- FID = col_character(),
- IID = col_character(),
- .default = col_double()
- )
- ) %>%
- standardise_ids()
- check_duplicate_ids(genomewide_pcs, "genome-wide PC file")
- check_required_variables(genomewide_pcs, c("FID", "IID", pc_vars), "genome-wide PC file")
- main_outcome_vars <- c(
- "gsstd_lin", "gsstd_int",
- "gfstd_lin", "gfstd_int",
- "gmstd_lin", "gmstd_int",
- "gvstd_lin", "gvstd_int"
- )
- check_file_exists(main_base_file, "main phenotype base file")
- main_base <- read_tsv(main_base_file, show_col_types = FALSE) %>%
- standardise_ids() %>%
- select(-any_of(pc_vars))
- check_duplicate_ids(main_base, "main phenotype base file")
- check_required_variables(main_base, c("FID", "IID", main_outcome_vars), "main phenotype base file")
- main_data <- main_base %>%
- left_join(genomewide_pcs, by = c("FID", "IID"))
- warn_if_unexpected_n(main_data, expected_main_n, "main revised analysis file")
- check_duplicate_ids(main_data, "main revised analysis file")
- check_required_variables(main_data, c("FID", "IID", main_outcome_vars, pc_vars), "main revised analysis file")
- check_complete_pcs(main_data, "main revised analysis file")
- write_tsv(main_data, main_output_file)
- write_tsv(
- main_data %>% select(FID, IID),
- main_keep_file,
- col_names = FALSE
- )
- # ─────────────────────────────────────────────────────────────────────────────
- # 5. Prepare 434 clinical/lifestyle sensitivity covariates, including MICE
- # ─────────────────────────────────────────────────────────────────────────────
- if (!file.exists(sensitivity_covariate_base_file)) {
- raw_files <- c(personal_details_file, clinical_file, depression_file, sleep_file)
- missing_raw_files <- raw_files[!file.exists(raw_files)]
- if (length(missing_raw_files) > 0) {
- print(missing_raw_files)
- stop("Cannot build sensitivity covariates because required raw files are missing.")
- }
- pers <- read_csv(personal_details_file, show_col_types = FALSE)
- clinical <- read_csv(clinical_file, show_col_types = FALSE)
- depress <- read_csv(depression_file, show_col_types = FALSE)
- sleep <- read_csv(sleep_file, show_col_types = FALSE, col_types = cols(.default = col_guess()))
- clinic_ids <- clinical %>%
- filter(!(is.na(bp1s) & is.na(bp1d) & is.na(bmi))) %>%
- pull(ID)
- pers <- pers %>% filter(ID %in% clinic_ids)
- clinical <- clinical %>% filter(ID %in% clinic_ids)
- depress <- depress %>% filter(ID %in% clinic_ids)
- sleep <- sleep %>% filter(ID %in% clinic_ids)
- pers_clean <- pers %>%
- mutate(
- p1smoke = recode(p1smoke, "Yes" = 1, "No" = 0, .default = NA_real_),
- p1drink = recode(p1drink, "Yes" = 1, "No" = 0, .default = NA_real_),
- p1yrdrnk = as.numeric(p1yrdrnk),
- p1cuhlth = recode(
- p1cuhlth,
- "Very bad" = 1,
- "Bad" = 2,
- "Fair" = 3,
- "Good" = 4,
- "Very good" = 5,
- .default = NA_real_
- )
- )
- sleep_clean <- sleep %>%
- mutate(
- p1hrslp = as.numeric(p1hrslp),
- p1sleff = as.numeric(p1sleff)
- )
- core <- pers_clean %>%
- transmute(
- IID = as.character(ID),
- sex_raw = sex,
- site_raw = city
- )
- clinical_core <- clinical %>%
- transmute(
- IID = as.character(ID),
- sbp_raw = rowMeans(across(bp1s:bp3s), na.rm = FALSE),
- dbp_raw = rowMeans(across(bp1d:bp3d), na.rm = FALSE),
- bmi_raw = as.numeric(bmi),
- knownhp = knownhp
- ) %>%
- left_join(
- depress %>% transmute(IID = as.character(ID), m1score_raw = as.numeric(m1score)),
- by = "IID"
- )
- lifestyle <- pers_clean %>%
- transmute(
- IID = as.character(ID),
- p1smoke,
- p1drink,
- p1yrdrnk,
- p1activm = as.numeric(p1activm),
- p1activn = as.numeric(p1activn),
- p1cuhlth
- ) %>%
- left_join(
- sleep_clean %>%
- transmute(
- IID = as.character(ID),
- sleep_hrs_raw = p1hrslp,
- sleep_eff_raw = p1sleff
- ),
- by = "IID"
- )
- covs_raw <- core %>%
- left_join(clinical_core, by = "IID") %>%
- left_join(lifestyle, by = "IID")
- covs <- covs_raw %>%
- mutate(
- FID = IID,
- sex = case_when(
- sex_raw %in% c("Female", "F", "2") ~ 0,
- sex_raw %in% c("Male", "M", "1") ~ 1,
- TRUE ~ NA_real_
- ),
- site = case_when(
- str_detect(site_raw, regex("Manchester", ignore_case = TRUE)) ~ 0,
- str_detect(site_raw, regex("Newcastle", ignore_case = TRUE)) ~ 1,
- TRUE ~ NA_real_
- ),
- htn_status = case_when(
- str_to_lower(knownhp) == "yes" ~ 1,
- str_to_lower(knownhp) == "no" ~ 0,
- is.na(knownhp) & !is.na(sbp_raw) & !is.na(dbp_raw) &
- (sbp_raw >= 140 | dbp_raw >= 90) ~ 1,
- is.na(knownhp) & !is.na(sbp_raw) & !is.na(dbp_raw) &
- (sbp_raw < 140 & dbp_raw < 90) ~ 0,
- TRUE ~ NA_real_
- ),
- MAP = dbp_raw + ((sbp_raw - dbp_raw) / 3),
- smoke_curr = p1smoke,
- alcohol_freq_wk = if_else(is.na(p1yrdrnk), NA_real_, p1yrdrnk / 52),
- mvpa_min_wk = (p1activm + p1activn) * 60 / 4.348,
- srh_raw = p1cuhlth
- ) %>%
- select(
- FID, IID,
- sex, site, htn_status,
- sbp_raw, dbp_raw, MAP, bmi_raw, m1score_raw,
- smoke_curr, alcohol_freq_wk, mvpa_min_wk,
- sleep_hrs_raw, sleep_eff_raw, srh_raw
- )
- miss_pct <- covs %>%
- select(-FID, -IID) %>%
- summarise(across(everything(), ~ mean(is.na(.)) * 100)) %>%
- pivot_longer(everything(), names_to = "variable", values_to = "pct_missing")
- print(miss_pct, n = Inf)
- if (ncol(covs %>% select(-FID, -IID) %>% select(where(~ any(is.na(.))))) > 0) {
- print(mcar_test(covs %>% select(-FID, -IID)))
- }
- set.seed(12345)
- covs_for_mice <- covs %>%
- filter(!is.na(sex), !is.na(site)) %>%
- mutate(
- htn_status = factor(htn_status, levels = c(0, 1)),
- smoke_curr = factor(smoke_curr, levels = c(0, 1)),
- srh_raw = ordered(srh_raw, levels = 1:5)
- )
- id_cols <- covs_for_mice %>% select(FID, IID)
- data_mice <- covs_for_mice %>% select(-FID, -IID)
- ini <- mice(data_mice, maxit = 0, printFlag = FALSE)
- meth <- ini$method
- pred <- ini$predictorMatrix
- meth[] <- ""
- numeric_vars <- names(data_mice)[purrr::map_lgl(data_mice, is.numeric)]
- meth[numeric_vars] <- "pmm"
- meth[c("htn_status", "smoke_curr")] <- "logreg"
- meth["srh_raw"] <- "polr"
- meth[c("sex", "site")] <- ""
- imp <- mice(
- data_mice,
- m = 20,
- maxit = 20,
- method = meth,
- predictorMatrix = pred,
- seed = 12345,
- printFlag = TRUE
- )
- covs_imp1 <- complete(imp, 1) %>%
- bind_cols(id_cols) %>%
- relocate(FID, IID) %>%
- mutate(
- htn_status = as.numeric(as.character(htn_status)),
- smoke_curr = as.numeric(as.character(smoke_curr)),
- srh_raw = as.numeric(as.character(srh_raw))
- )
- write_tsv(covs_imp1, sensitivity_covariate_base_file)
- saveRDS(imp, file.path(revision_dir, "sensitivity_covariate_imputations_mids.rds"))
- }
- check_file_exists(sensitivity_phenotype_base_file, "sensitivity phenotype base file")
- check_file_exists(sensitivity_covariate_base_file, "sensitivity covariate base file")
- sensitivity_covariates_for_plink <- c(
- "sex",
- "htn_status",
- "bmi_raw",
- "m1score_raw",
- "smoke_curr",
- "alcohol_freq_wk",
- "mvpa_min_wk",
- "sleep_hrs_raw",
- "sleep_eff_raw",
- "srh_raw",
- "MAP",
- pc_vars
- )
- sensitivity_phenotypes <- read_tsv(sensitivity_phenotype_base_file, show_col_types = FALSE) %>%
- standardise_ids() %>%
- select(-any_of(pc_vars))
- sensitivity_covariates <- read_tsv(sensitivity_covariate_base_file, show_col_types = FALSE) %>%
- standardise_ids() %>%
- select(-any_of(pc_vars))
- check_duplicate_ids(sensitivity_phenotypes, "sensitivity phenotype base file")
- check_duplicate_ids(sensitivity_covariates, "sensitivity covariate base file")
- check_required_variables(
- sensitivity_phenotypes,
- c("FID", "IID", "gsstd_lin", "gsstd_int"),
- "sensitivity phenotype base file"
- )
- check_required_variables(
- sensitivity_covariates,
- c(
- "FID", "IID",
- "sex", "htn_status", "bmi_raw", "m1score_raw",
- "smoke_curr", "alcohol_freq_wk", "mvpa_min_wk",
- "sleep_hrs_raw", "sleep_eff_raw", "srh_raw", "MAP"
- ),
- "sensitivity covariate base file"
- )
- sensitivity_data <- sensitivity_phenotypes %>%
- left_join(sensitivity_covariates, by = c("FID", "IID")) %>%
- left_join(genomewide_pcs, by = c("FID", "IID"))
- warn_if_unexpected_n(sensitivity_data, expected_sensitivity_n, "434 sensitivity analysis file")
- check_duplicate_ids(sensitivity_data, "434 sensitivity analysis file")
- check_required_variables(
- sensitivity_data,
- c("FID", "IID", "gsstd_lin", "gsstd_int", sensitivity_covariates_for_plink),
- "434 sensitivity analysis file"
- )
- check_complete_pcs(sensitivity_data, "434 sensitivity analysis file")
- write_tsv(sensitivity_data, sensitivity_output_file)
- write_tsv(
- sensitivity_data %>% select(FID, IID),
- sensitivity_keep_file,
- col_names = FALSE
- )
- writeLines(
- paste(sensitivity_covariates_for_plink, collapse = " "),
- sensitivity_covariate_list_file
- )
- # ─────────────────────────────────────────────────────────────────────────────
- # 6. Prepare neuropathology files and covariates
- # ─────────────────────────────────────────────────────────────────────────────
- check_file_exists(neuropath_continuous_base_file, "neuropathology continuous base file")
- check_file_exists(neuropath_binary_base_file, "neuropathology binary base file")
- neuropath_continuous_required <- c(
- "FID", "IID",
- "braak_stage", "thal_phase", "caa_score",
- "sex", "age_at_death", "pmi_hrs", "apoe_e4",
- "smoke_curr", "alcohol_freq_wk", "mvpa_min_wk",
- "sleep_hrs_raw", "sleep_eff_raw", "srh_raw"
- )
- neuropath_binary_required <- c(
- "FID", "IID",
- "synuclein_present", "tdp43_present",
- "sex", "age_at_death", "pmi_hrs", "apoe_e4"
- )
- neuropath_continuous_base <- read_tsv(neuropath_continuous_base_file, show_col_types = FALSE) %>%
- standardise_ids()
- neuropath_binary_base <- read_tsv(neuropath_binary_base_file, show_col_types = FALSE) %>%
- standardise_ids()
- check_duplicate_ids(neuropath_continuous_base, "neuropathology continuous base file")
- check_duplicate_ids(neuropath_binary_base, "neuropathology binary base file")
- check_required_variables(neuropath_continuous_base, neuropath_continuous_required, "neuropathology continuous base file")
- check_required_variables(neuropath_binary_base, neuropath_binary_required, "neuropathology binary base file")
- neuropath_continuous_gwpc <- replace_pcs(neuropath_continuous_base, genomewide_pcs)
- neuropath_binary_gwpc <- replace_pcs(neuropath_binary_base, genomewide_pcs)
- warn_if_unexpected_n(neuropath_continuous_gwpc, expected_neuropath_n, "neuropathology continuous file")
- warn_if_unexpected_n(neuropath_binary_gwpc, expected_neuropath_n, "neuropathology binary file")
- check_complete_pcs(neuropath_continuous_gwpc, "neuropathology continuous file")
- check_complete_pcs(neuropath_binary_gwpc, "neuropathology binary file")
- write_tsv(neuropath_continuous_gwpc, neuropath_continuous_output_file)
- write_tsv(neuropath_binary_gwpc, neuropath_binary_output_file)
- neuropath_marker_trajectory_data <- neuropath_continuous_gwpc %>%
- select(
- FID, IID,
- braak_stage, thal_phase, caa_score,
- sex, age_at_death, pmi_hrs, apoe_e4,
- smoke_curr, alcohol_freq_wk, mvpa_min_wk,
- sleep_hrs_raw, sleep_eff_raw, srh_raw
- ) %>%
- left_join(
- neuropath_binary_gwpc %>%
- select(FID, IID, synuclein_present, tdp43_present),
- by = c("FID", "IID")
- ) %>%
- left_join(
- main_data %>%
- select(FID, IID, gsstd_lin, gsstd_int),
- by = c("FID", "IID")
- )
- check_required_variables(
- neuropath_marker_trajectory_data,
- c(
- "FID", "IID", "gsstd_lin", "gsstd_int",
- "braak_stage", "thal_phase", "caa_score",
- "synuclein_present", "tdp43_present",
- "sex", "age_at_death", "pmi_hrs", "apoe_e4",
- "smoke_curr", "alcohol_freq_wk", "mvpa_min_wk",
- "sleep_hrs_raw", "sleep_eff_raw", "srh_raw"
- ),
- "neuropathology marker-to-trajectory file"
- )
- write_tsv(neuropath_marker_trajectory_data, neuropath_marker_trajectory_file)
- neuropath_event_counts <- neuropath_binary_gwpc %>%
- summarise(
- synuclein_absent = sum(synuclein_present == 1, na.rm = TRUE),
- synuclein_present = sum(synuclein_present == 2, na.rm = TRUE),
- tdp43_absent = sum(tdp43_present == 1, na.rm = TRUE),
- tdp43_present = sum(tdp43_present == 2, na.rm = TRUE)
- )
- print(neuropath_event_counts)
- # ─────────────────────────────────────────────────────────────────────────────
- # 7. Prepare synaptic-density files and covariates
- # ─────────────────────────────────────────────────────────────────────────────
- check_file_exists(synaptic_base_file, "synaptic-density base file")
- synaptic_required <- c(
- "FID", "IID",
- "frontal", "hippocampus", "parietal", "occipital",
- "sex", "age_at_death", "pmi_hrs", "apoe_e4",
- "smoke_curr", "alcohol_freq_wk", "mvpa_min_wk",
- "sleep_quality", "srh_raw"
- )
- synaptic_base <- read_tsv(synaptic_base_file, show_col_types = FALSE) %>%
- standardise_ids()
- check_duplicate_ids(synaptic_base, "synaptic-density base file")
- check_required_variables(synaptic_base, synaptic_required, "synaptic-density base file")
- synaptic_gwpc <- replace_pcs(synaptic_base, genomewide_pcs)
- warn_if_unexpected_n(synaptic_gwpc, expected_synaptic_n, "synaptic-density file")
- check_complete_pcs(synaptic_gwpc, "synaptic-density file")
- write_tsv(synaptic_gwpc, synaptic_output_file)
- synaptic_marker_trajectory_data <- synaptic_gwpc %>%
- select(
- FID, IID,
- frontal, hippocampus, parietal, occipital,
- sex, age_at_death, pmi_hrs, apoe_e4,
- smoke_curr, alcohol_freq_wk, mvpa_min_wk,
- sleep_quality, srh_raw
- ) %>%
- left_join(
- main_data %>%
- select(FID, IID, gsstd_lin, gsstd_int),
- by = c("FID", "IID")
- )
- check_required_variables(
- synaptic_marker_trajectory_data,
- c(
- "FID", "IID", "gsstd_lin", "gsstd_int",
- "frontal", "hippocampus", "parietal", "occipital",
- "sex", "age_at_death", "pmi_hrs", "apoe_e4",
- "smoke_curr", "alcohol_freq_wk", "mvpa_min_wk",
- "sleep_quality", "srh_raw"
- ),
- "synaptic marker-to-trajectory file"
- )
- write_tsv(synaptic_marker_trajectory_data, synaptic_marker_trajectory_file)
- synaptic_availability <- synaptic_gwpc %>%
- summarise(
- n_total = n(),
- frontal_n = sum(!is.na(frontal)),
- hippocampus_n = sum(!is.na(hippocampus)),
- parietal_n = sum(!is.na(parietal)),
- occipital_n = sum(!is.na(occipital))
- )
- print(synaptic_availability)
- # ─────────────────────────────────────────────────────────────────────────────
- # 8. Create post-mortem keep files / subset genotype files
- # ─────────────────────────────────────────────────────────────────────────────
- write_tsv(
- neuropath_continuous_gwpc %>% select(FID, IID),
- neuropath_keep_file,
- col_names = FALSE
- )
- write_tsv(
- synaptic_gwpc %>% select(FID, IID),
- synaptic_keep_file,
- col_names = FALSE
- )
- run_plink(c(
- "--bfile", dopamine_ps_prefix,
- "--keep", neuropath_keep_file,
- "--make-bed",
- "--out", neuropath_subset_genotype_prefix
- ))
- run_plink(c(
- "--bfile", dopamine_ps_prefix,
- "--keep", synaptic_keep_file,
- "--make-bed",
- "--out", synaptic_subset_genotype_prefix
- ))
- check_bfile_exists(neuropath_subset_genotype_prefix, "neuropathology dopamine subset")
- check_bfile_exists(synaptic_subset_genotype_prefix, "synaptic dopamine subset")
- # ─────────────────────────────────────────────────────────────────────────────
- # Output summary
- # ─────────────────────────────────────────────────────────────────────────────
- output_summary <- tibble(
- output = c(
- "dopamine_clean.bed/bim/fam",
- "dopamine_ps.bed/bim/fam",
- "journal_main_phenotypes_genomewide_PC20.tsv",
- "journal_main_keep_ids_genomewide_PC20.txt",
- "journal_sensitivity_phenotypes_covariates_genomewide_PC20.tsv",
- "journal_sensitivity_keep_ids_genomewide_PC20.txt",
- "journal_sensitivity_covariates_for_plink.txt",
- "neuropath_basic_final_genomewide_PC20_plink.tsv",
- "neuropath_basic_final_recoded_genomewide_PC20_plink.tsv",
- "neuropath_basic_final_genomewide_PC20_ids.txt",
- "dopamine_ps_neuropathology_subset.bed/bim/fam",
- "neuropath_marker_trajectory_models.tsv",
- "synaptic_final_genomewide_PC20_plink.tsv",
- "synaptic_final_genomewide_PC20_ids.txt",
- "dopamine_ps_synaptic_subset.bed/bim/fam",
- "synaptic_marker_trajectory_models.tsv"
- ),
- path = c(
- dopamine_clean_prefix,
- dopamine_ps_prefix,
- main_output_file,
- main_keep_file,
- sensitivity_output_file,
- sensitivity_keep_file,
- sensitivity_covariate_list_file,
- neuropath_continuous_output_file,
- neuropath_binary_output_file,
- neuropath_keep_file,
- neuropath_subset_genotype_prefix,
- neuropath_marker_trajectory_file,
- synaptic_output_file,
- synaptic_keep_file,
- synaptic_subset_genotype_prefix,
- synaptic_marker_trajectory_file
- )
- )
- cat("\nFinal setup outputs:\n")
- print(output_summary, width = Inf)
- cat("\n01_prepare_analysis_files.R complete.\n")
01_prepare_analysis_files.R, no license · at the source
Overview
- Division of Informatics, Imaging and Data Sciences, The University of Manchester, Manchester, United Kingdom
- Division of Neuroscience and Experimental Psychology, The University of Manchester, Salford, United Kingdom
Abstract
Amid a global shift toward older populations, understanding the mechanisms of cognitive aging is a public health priority. Processing speed shows age-related decline and predicts dementia risk. Neuroimaging links dopaminergic system integrity to cognitive performance in aging, but the contribution of common genetic variation remains unclear. This study tested whether common dopaminergic variants influence 12-year processing speed decline, performance at age 70, and other cognitive domains, with exploratory analyses of post-mortem pathology. A total of 89 linkage disequilibrium-independe
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 20 matches between paragraphs and lines of code.
supp:PMC13379125/pone.0353790.s022.zip
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
14 files
- 01_prepare_analysis_file
s.R , R, 782 lines, 4 matches - 02_primary_single_snp_an
alysis.sh , Shell, 104 lines, 1 match - 03_primary_single_snp_re
sults_and_diagnostics.R , R, 211 lines, 2 matches - 04_gene_based_magma_anal
ysis.sh , Shell, 130 lines - 05_gene_based_magma_resu
lts.R , R, 87 lines, 2 matches - 06_pathway_allele_score.
sh , Shell, 67 lines, 1 match - 07_pathway_allele_score_
models.R , R, 78 lines, 2 matches - 08_clinical_lifestyle_se
nsitivity_analysis.sh , Shell, 201 lines, 1 match - 09_clinical_lifestyle_se
nsitivity_results_and_di , R, 157 linesagnostics.R - 10_postmortem_neuropatho
logy_analysis.sh , Shell, 233 lines, 2 matches - 11_postmortem_neuropatho
logy_results_and_checks. , R, 366 lines, 2 matchesR - 12_postmortem_synaptic_d
ensity_analysis.sh , Shell, 203 lines - 13_postmortem_synaptic_d
ensity_results.R , R, 242 lines, 3 matches - README.txt, Text, 47 lines
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;
- 13 scripts, each with its path and the digest of its content;
- 20 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability
Data from The University of Manchester Longitudinal Study of Cognition in Normal Healthy Old Age are not publicly available due to ethical and data protection restrictions, as they contain potentially identifiable human participant information. Qualified researchers may request access to the data by contacting Dr Altug Didikoglu at The University of Manchester (). Data access requests will be reviewed by the study custodians and, where required, the relevant ethics or institutional governance committees. Data will be stored and maintained by The University of Manchester in accordance with institutional data governance and research ethics requirements to support long-term availability. Full summary association results and the GWAS analysis code used for the revised analyses are provided as Supporting information files accompanying this article.
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 3 authors, 13 MeSH terms, 47 references.
Cite
This paper
Rose, M. A., Robinson, A. C., & Payton, A. (2026). Do common dopaminergic variants modulate processing speed in cognitive aging? A longitudinal candidate gene study. PloS one, 21(7), e0353790. https://
BibTeX
@article{rose2026do,
author = {Rose, Monica Anona and Robinson, Andrew C and Payton, Antony},
title = {{Do common dopaminergic variants modulate processing speed in cognitive aging? A longitudinal candidate gene study}},
journal = {PloS one},
year = {2026},
month = jul,
volume = {21},
number = {7},
pages = {e0353790},
publisher = {PLOS},
issn = {1932-6203},
doi = {10.1371/
url = {https://
pmid = {42467707},
pmcid = {PMC13379125}
}
RIS
TY - JOUR
AU - Rose, Monica Anona
AU - Robinson, Andrew C
AU - Payton, Antony
TI - Do common dopaminergic variants modulate processing speed in cognitive aging? A longitudinal candidate gene study
T2 - PloS one
J2 - PLoS One
PY - 2026
DA - 2026/
VL - 21
IS - 7
SP - e0353790
SN - 1932-6203
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "Do common dopaminergic variants modulate processing speed in cognitive aging? A longitudinal candidate gene study",
"container-title": "PloS one",
"author": [
{
"family": "Rose",
"given": "Monica Anona"
},
{
"family": "Robinson",
"given": "Andrew C"
},
{
"family": "Payton",
"given": "Antony"
}
],
"container-title-short":
"volume": "21",
"issue": "7",
"page": "e0353790",
"DOI": "10.1371/
"PMID": "42467707",
"PMCID": "PMC13379125",
"ISSN": "1932-6203",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
17
]
]
}
}
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.1162/imag.a.1257 [code]
- Motor- and cognitive-dominant functional network adaptations supporting dual-task performance in older adults.Journal: Imaging neuroscience (Cambridge, Mass.)In common: ggplot2, tidyverse, 2 references
- [2] doi:10.2147/jpr.s619982 [code]
- Spatially Contextualized Integrative Genomics Highlights Neuronal and Glial Regulatory Programs in Low Back Pain.Journal: Journal of pain researchIn common: ggplot2, tidyverse, 2 references
- [3] doi:10.1038/s41562-026-02486-5 [code]
- Genome-wide association studies of infant and toddler temperament in European and multi-ancestry populations.Journal: Nature human behaviourIn common: ggplot2, tidyverse, 2 references
- [4] doi:10.1038/s41467-026-71682-8 [code]
- GWAS meta-analysis of cerebrospinal fluid Alzheimer's biomarkers reveals loci regulating lipids, brain volume and autophagy.Journal: Nature communicationsIn common: ggplot2, tidyverse, 2 references
- [5] doi:10.1162/imag.a.1302 [code]
- Five-year associations among dopamine D2-like receptor loss, cognitive decline, education, and self-reported leisure activities in healthy older adults.Journal: Imaging neuroscience (Cambridge, Mass.)In common: tidyverse, 2 references
- [6] doi:10.1002/alz.71271 [code]
- Intracellular protein GBF1 displays significant associations with amyloid pathology in Alzheimer's disease.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: ggplot2, tidyverse, histology / microscopy, 1 reference
- [7] doi:10.1186/s12916-026-04957-y [code]
- Thyroid-stimulating hormone receptor mediates peripheral-central neuroimmune crosstalk in autoimmune thyroid diseases.Journal: BMC medicineIn common: ggplot2, tidyverse, histology / microscopy, 1 reference
- [8] doi:10.1038/s41514-026-00391-9 [code]
- Region-specific transcriptional signatures of brain aging in the absence of neuropathology at the single-cell level.Journal: npj agingIn common: ggplot2, tidyverse, histology / microscopy, 1 reference
- [9] doi:10.1038/s41386-026-02433-y [code]
- Computational phenotyping of effort-based decision-making in type-2 diabetes on and off semaglutide.Journal: Neuropsychopharmacology : official publication of the American College of NeuropsychopharmacologyIn common: ggplot2, tidyverse, 1 reference
- [10] doi:10.1093/braincomms/fcag121 [code]
- Anterior insular co-activation patterns associated with stress markers in chronic primary pain.Journal: Brain communicationsIn common: ggplot2, tidyverse, 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.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 13 scripts, and 20 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:8195d57fe9008341…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
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.
