OSCR

Mapping genetic convergence across brain structure, mental health, and cardiometabolic disease.

Code ↔ Paper

4 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 4 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Methods › Statistical analyses › Estimating causal relationships ↔ R/userGWASa.r, lines 1–74 · score 0.74 · GenomicSEM, GWAS summary statistics, covariance matrices, standard errors, flexible, multivariable
  2. [2] § Methods › Statistical analyses › Mapping shared genetic loci ↔ pleioFDR_amd.m, the whole file · a weak match · score 0.65 · leveraging pleiotropic, discovery rate, conjunctional, condFDR, conjFDR, phenotypes
  3. [3] § Methods › Statistical analyses › Estimating causal relationships ↔ R/rgmodel.R, lines 1–35 · score 0.61 · LD score regression, genetic covariance matrices, genetically correlated, multivariable, GenomicSEM, phenotype
  4. [4] § Methods › Statistical analyses › Mapping shared genetic loci ↔ plot_Manhattan.m, lines 116–220 · score 0.55 · condFDR, conjFDR, loci, thresholds

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 · 388 lines · 17 KB · GPL-3.0 · 1 match

  1. #' userGWASa: Ultra-fast multivariate GWAS with flexible analytic estimation
  2. #'
  3. #' Runs a multivariate GWAS across a set of
  4. #' GWAS summary statistics and a user-specified factor model. Factor-specific
  5. #' SNP effects (betas, SEs, Z-statistics, p-values) and an omnibus
  6. #' heterogeneity statistic (Q_omnibus) are computed.
  7. #'
  8. #' @param sumstats A \code{data.frame} of merged GWAS summary statistics,
  9. #' as produced by the \code{sumstats()} function in GenomicSEM. Must contain
  10. #' columns \code{SNP}, \code{A1}, \code{A2}, \code{MAF}, \code{N}, and
  11. #' trait-specific \code{beta.*} and \code{se.*} columns.
  12. #' @param LDSCoutput A list object returned by the \code{ldsc()} function.
  13. #' @param model A character string specifying the factor model in
  14. #' \code{lavaan}-style syntax. Ignored if
  15. #' \code{usermod} is provided.
  16. #' @param usermod Optional. A pre-fitted no-SNP model results data frame
  17. #' (the \code{$results} element from a \code{usermodel()} call). When
  18. #' supplied, the function skips fitting the no-SNP model internally and uses
  19. #' these parameter estimates directly to extract lambda coefficients.
  20. #' Default is \code{NULL}.
  21. #' @param batch_size Integer. Number of SNPs to process per batch. Larger
  22. #' values increase memory use but reduce overhead. Default is \code{100000}.
  23. #'
  24. #' @return A \code{data.frame} with one row per SNP and the following columns:
  25. #' \itemize{
  26. #' \item The first 6 columns from \code{sumstats} (SNP identifiers and
  27. #' allele information).
  28. #' \item \code{beta_<factor>}: GLS-estimated SNP effect on each factor.
  29. #' \item \code{SE_<factor>}: Sandwich-corrected standard error of the
  30. #' factor beta.
  31. #' \item \code{Z_beta_<factor>}: Z-statistic for the factor beta.
  32. #' \item \code{p_val_<factor>}: Two-sided p-value for the factor beta.
  33. #' \item \code{Q_omnibus}, \code{Q_omnibus_df}, \code{Q_omnibus_pval}:
  34. #' Omnibus Q_SNP statistic across all traits, its degrees of freedom,
  35. #' and p-value.
  36. #' }
  37. #'
  38. #' @details
  39. #' The function implements a two-stage approach. First, a no-SNP factor model
  40. #' is fit using \code{\link[GenomicSEM]{usermodel}} with DWLS estimation to
  41. #' obtain factor loading estimates (lambdas). Second, for each batch of SNPs,
  42. #' SNP-to-factor betas are estimated via GLS using the diagonal of the
  43. #' SNP-specific sampling covariance matrix as weights, with a sandwich
  44. #' variance estimator for the standard errors.
  45. #'
  46. #' The Q_omnibus statistic tests whether the observed SNP-trait association
  47. #' vector is consistent with the implied factor model.
  48. #'
  49. #' @seealso \code{\link[GenomicSEM]{usermodel}}, \code{\link[GenomicSEM]{userGWAS}}
  50. #' @noRd
  51. #'
  52. #' @examples
  53. #' \dontrun{
  54. #' load("LDSC_PSYCH.RData")
  55. #' sumstats <- data.table::fread("Psych_sumstats_4GLS.txt", data.table = FALSE)
  56. #'
  57. #' model <- '
  58. #' Psych =~ a*SCZ + a*BIP
  59. #' Neuro =~ ADHD + MDD + ASD
  60. #' Psych ~~ Neuro
  61. #' Psych ~ SNP
  62. #' Neuro ~ SNP
  63. #' '
  64. #'
  65. #' results <- userGWASa(
  66. #' sumstats = sumstats,
  67. #' LDSCoutput = LDSC_P,
  68. #' model = model,
  69. #' batch_size = 50000
  70. #' )
  71. #' }
  72. #'
  73. #' @keywords internal
  74. .userGWASa <- function(sumstats, LDSCoutput, model, usermod = NULL, batch_size = 100000) {
  75. # Helper function: V' M V
  76. VMV <- function(V1, M, V2) { V1 %*% M %*% V2 }
  77. # Helper function: correlation matrix -> covariance matrix, given SDs
  78. cor2cov <- function(R, sds) {
  79. D <- diag(sds, nrow = length(sds))
  80. D %*% R %*% D
  81. }
  82. # Helper function: pull explicit ('N*indicator') fixed loadings out of model syntax
  83. parse_fixed_loadings <- function(model_text) {
  84. lines <- trimws(strsplit(model_text, "\n")[[1]])
  85. loading_lines <- grep("=~", lines, fixed = TRUE, value = TRUE)
  86. if (length(loading_lines) == 0) {
  87. return(data.frame(lhs = character(), op = character(), rhs = character(),
  88. Unstand_Est = numeric(), stringsAsFactors = FALSE))
  89. }
  90. out <- do.call(rbind, lapply(loading_lines, function(line) {
  91. parts <- strsplit(line, "=~", fixed = TRUE)[[1]]
  92. factor <- trimws(parts[1])
  93. tokens <- trimws(strsplit(parts[2], "\\+")[[1]])
  94. tokens <- tokens[nzchar(tokens)]
  95. fixed_val <- rep(NA_real_, length(tokens))
  96. indicator <- character(length(tokens))
  97. for (t in seq_along(tokens)) {
  98. m <- regmatches(tokens[t], regexec("^([0-9]*\\.?[0-9]+)\\*(.+)$", tokens[t]))[[1]]
  99. if (length(m) == 3) {
  100. fixed_val[t] <- as.numeric(m[2])
  101. indicator[t] <- trimws(m[3])
  102. } else {
  103. indicator[t] <- tokens[t]
  104. }
  105. }
  106. if (all(is.na(fixed_val))) fixed_val[1] <- 1 # lavaan's default marker rule
  107. data.frame(lhs = factor, op = "=~", rhs = indicator,
  108. Unstand_Est = fixed_val, stringsAsFactors = FALSE)
  109. }))
  110. out[!is.na(out$Unstand_Est), ]
  111. }
  112. # Helper function: recover the free-parameter table usermodel() prints but doesn't return
  113. parse_partial_results <- function(captured_output) {
  114. header_idx <- grep("^\\s*lhs\\s+op\\s+rhs\\b", captured_output)
  115. if (length(header_idx) == 0) return(NULL)
  116. header_idx <- header_idx[1]
  117. end_idx <- length(captured_output)
  118. tail_blank <- which(!nzchar(trimws(captured_output[(header_idx + 1):end_idx])))
  119. if (length(tail_blank) > 0) end_idx <- header_idx + tail_blank[1] - 1
  120. table_text <- paste(captured_output[header_idx:end_idx], collapse = "\n")
  121. parsed <- tryCatch(
  122. read.table(text = table_text, header = TRUE, stringsAsFactors = FALSE),
  123. error = function(e) NULL
  124. )
  125. if (is.null(parsed) || !all(c("lhs", "op", "rhs") %in% colnames(parsed))) return(NULL)
  126. est_col <- intersect(c("Unstand_Est", "Unstandardized_Estimate"), colnames(parsed))
  127. if (length(est_col) == 0) return(NULL)
  128. parsed$Unstand_Est <- parsed[[est_col[1]]]
  129. parsed
  130. }
  131. # Helper function: flag latent factors with a negative variance estimate
  132. check_latent_variances <- function(df, factors) {
  133. self_var <- df[df$op == "~~" & df$lhs == df$rhs & df$lhs %in% factors, ]
  134. self_var$lhs[as.numeric(self_var$Unstand_Est) < 0]
  135. }
  136. start_time <- Sys.time()
  137. cat("userGWASa started at:", format(start_time, "%Y-%m-%d %H:%M:%S"), "\n")
  138. # Coerce to plain data.frame to ensure consistent column subsetting
  139. # regardless of whether input is a data.table, tibble, or other tabular class
  140. sumstats <- as.data.frame(sumstats)
  141. # ── No-SNP model ──────────────────────────────────────────────────────────────
  142. if (is.character(model) & is.null(usermod)) {
  143. model_lines <- strsplit(model, "\n")[[1]]
  144. snp_lines <- grep("~.*\\bSNP\\b", model_lines, value = TRUE)
  145. nosnp_model <- paste(grep("~.*\\bSNP\\b", model_lines, value = TRUE, invert = TRUE),
  146. collapse = "\n")
  147. captured_output <- capture.output(
  148. suppressWarnings(suppressMessages({
  149. nosnpmod <- usermodel(
  150. LDSCoutput, estimation = "DWLS", model = nosnp_model,
  151. CFIcalc = FALSE, std.lv = FALSE, imp_cov = FALSE
  152. )
  153. }))
  154. )
  155. nosnpmod <- nosnpmod$results
  156. # Re-emit smoothing warning if it occurred
  157. if (any(grepl("smoothed", captured_output))) {
  158. warning("The S matrix was smoothed prior to model estimation. ")
  159. }
  160. } else {
  161. nosnpmod <- usermod
  162. }
  163. # usermodel() falls through with no explicit return (i.e. NULL) when the no-SNP
  164. # fit fails to converge, or when it lands on an inadmissible solution (a Heywood
  165. # case: negative residual/latent variance, or an out-of-bounds latent
  166. # correlation) -- in both cases its diagnostic warning/print is swallowed by the
  167. # suppressWarnings()/capture.output() above, and the free-parameter estimates it
  168. # printed (but did not return) are the only usable record of that fit. Recover
  169. # those from captured_output and proceed with a warning rather than silently
  170. # letting the NULL/malformed table cascade into extract_lambdas() and surface
  171. # many steps later as an opaque vector-length error out of paste0()/colnames<-.
  172. if (is.null(nosnpmod) || !is.data.frame(nosnpmod) || nrow(nosnpmod) == 0 ||
  173. !all(c("lhs", "op", "rhs") %in% colnames(nosnpmod))) {
  174. recovered <- if (exists("captured_output")) parse_partial_results(captured_output) else NULL
  175. if (is.null(recovered)) {
  176. diagnostic <- if (exists("captured_output")) paste(utils::head(captured_output, 15), collapse = "\n") else ""
  177. if (nchar(diagnostic) > 1500) diagnostic <- paste0(substr(diagnostic, 1, 1500), "\n...(truncated)")
  178. stop(
  179. "The no-SNP measurement model failed to fit and produced no usable parameter table ",
  180. "(it did not converge, and no recoverable free-parameter estimates were printed). ",
  181. "Please respecify the model.",
  182. if (nzchar(diagnostic)) paste0("\n\nDiagnostic output:\n", diagnostic) else "",
  183. call. = FALSE
  184. )
  185. }
  186. warning(
  187. "The no-SNP measurement model landed on an inadmissible solution (a Heywood case: a ",
  188. "negative residual/latent variance, or an out-of-bounds latent correlation). Proceeding ",
  189. "with the free-parameter estimates from that fit -- results for the affected factor(s) ",
  190. "are numerically unreliable and should be interpreted with caution. Consider ",
  191. "respecifying the measurement model.",
  192. call. = FALSE
  193. )
  194. nosnpmod <- recovered
  195. }
  196. if (!"Unstand_Est" %in% colnames(nosnpmod) && "Unstandardized_Estimate" %in% colnames(nosnpmod)) {
  197. nosnpmod$Unstand_Est <- nosnpmod$Unstandardized_Estimate
  198. }
  199. # Backfill any explicitly fixed ('N*indicator') loadings missing from the table --
  200. # usermodel() drops these when it falls back to the free-parameters-only table
  201. # above for an inadmissible/non-converged fit.
  202. fixed_loadings <- parse_fixed_loadings(model)
  203. missing <- !paste(fixed_loadings$lhs, fixed_loadings$op, fixed_loadings$rhs) %in%
  204. paste(nosnpmod$lhs, nosnpmod$op, nosnpmod$rhs)
  205. if (any(missing)) nosnpmod <- dplyr::bind_rows(nosnpmod, fixed_loadings[missing, , drop = FALSE])
  206. # ── Extract lambda coefficients ───────────────────────────────────────────────
  207. factors <- unique(nosnpmod$lhs[nosnpmod$op == "=~"])
  208. # usermodel()'s own Heywood check (cor.lv-based) can miss a negative latent
  209. # variance -- e.g. two correlated latents both negative cancel out in the ratio,
  210. # or a single latent uncorrelated with any other skips the check entirely.
  211. negative_factors <- check_latent_variances(nosnpmod, factors)
  212. if (length(negative_factors) > 0) {
  213. warning(
  214. "Negative latent variance estimate for factor(s): ", paste(negative_factors, collapse = ", "),
  215. ". Loadings/betas for the affected factor(s) may be unreliable.",
  216. call. = FALSE
  217. )
  218. }
  219. traits <- colnames(LDSCoutput$S)
  220. num_traits <- ncol(LDSCoutput$S)
  221. num_factors <- length(factors)
  222. combinations <- expand.grid(traits = traits, factors = factors)
  223. column_names <- paste0("lambda.", combinations$traits, "_", combinations$factors)
  224. extract_lambdas <- function(df, factors, traits, num_traits, num_factors) {
  225. lambdas <- rep(0, num_traits * num_factors)
  226. for (factor_idx in seq_along(factors)) {
  227. factor <- factors[factor_idx]
  228. for (trait_idx in seq_along(traits)) {
  229. trait <- traits[trait_idx]
  230. row <- df[df$lhs == factor & df$rhs == trait & df$op == "=~", ]
  231. lambda_value <- if (nrow(row) > 0) row$Unstand_Est else 0
  232. lambdas[(factor_idx - 1) * num_traits + trait_idx] <- lambda_value
  233. }
  234. }
  235. lambdas_df <- data.frame(matrix(lambdas, nrow = 1, byrow = TRUE))
  236. colnames(lambdas_df) <- column_names
  237. return(lambdas_df)
  238. }
  239. lambdas <- extract_lambdas(nosnpmod, factors, traits, num_traits, num_factors)
  240. # ── Initialise output data frame ──────────────────────────────────────────────
  241. GLS_mGWAS_results <- sumstats[, 1:6]
  242. for (j in factors) {
  243. GLS_mGWAS_results[[paste0("beta_", j)]] <- NA_real_
  244. GLS_mGWAS_results[[paste0("SE_", j)]] <- NA_real_
  245. GLS_mGWAS_results[[paste0("Z_beta_", j)]] <- NA_real_
  246. GLS_mGWAS_results[[paste0("p_val_", j)]] <- NA_real_
  247. }
  248. GLS_mGWAS_results <- GLS_mGWAS_results %>%
  249. mutate(Q_omnibus = NA_real_, Q_omnibus_df = NA_real_, Q_omnibus_pval = NA_real_)
  250. # ── Batch loop ────────────────────────────────────────────────────────────────
  251. total_batches <- ceiling(nrow(sumstats) / batch_size)
  252. pb <- txtProgressBar(min = 0, max = total_batches, style = 3)
  253. for (batch_num in seq_len(total_batches)) {
  254. i <- (batch_num - 1) * batch_size + 1
  255. batch_end <- min(i + batch_size - 1, nrow(sumstats))
  256. snp_batch <- sumstats[i:batch_end, ]
  257. batch_indices <- i:batch_end
  258. betas <- snp_batch %>% select(contains("beta."))
  259. SEs <- snp_batch %>% select(contains("se."))
  260. # Lambda matrix
  261. lambdas_snp <- as.numeric(lambdas)
  262. R_SNP <- LDSCoutput$I
  263. diag(R_SNP)[diag(R_SNP) < 1] <- 1
  264. X <- matrix(lambdas_snp, nrow = num_traits, ncol = num_factors)
  265. colnames(X) <- factors
  266. # SNP-trait beta and SE lists
  267. beta_l <- lapply(transpose(betas), function(x) as.numeric(unlist(x)))
  268. se_snp <- lapply(transpose(SEs), function(x) as.numeric(unlist(x)))
  269. # V_SNP list and its diagonalised inverse
  270. V_SNP_list <- apply(SEs, 1, function(se) {
  271. cor2cov(R = as.matrix(R_SNP), sds = as.numeric(se))
  272. }, simplify = FALSE)
  273. V_d_list_inv <- lapply(V_SNP_list, function(V_SNP) diag(1 / diag(V_SNP)))
  274. # GLS factor betas (sandwich SE)
  275. Beta_list <- unname(Map(function(V_d_inv, beta) {
  276. solve(t(X) %*% V_d_inv %*% X) %*% t(X) %*% V_d_inv %*% beta
  277. }, V_d_list_inv, beta_l))
  278. SE_parallel_list <- unname(Map(function(V_d_inv, V_SNP) {
  279. bread <- solve(t(X) %*% V_d_inv %*% X)
  280. meat <- t(X) %*% V_d_inv %*% V_SNP %*% V_d_inv %*% X
  281. sandwich <- bread %*% meat %*% bread
  282. sqrt(diag(sandwich))
  283. }, V_d_list_inv, V_SNP_list))
  284. # Convert to data frames
  285. SE_parallel_df <- as.data.frame(do.call(rbind, SE_parallel_list))
  286. colnames(SE_parallel_df) <- paste0("SE_", factors)
  287. Beta_parallel_df <- as.data.frame(do.call(rbind, lapply(Beta_list, as.numeric)))
  288. colnames(Beta_parallel_df) <- paste0("Beta_", factors)
  289. Z_df_parallel <- Beta_parallel_df / SE_parallel_df
  290. colnames(Z_df_parallel) <- paste0("Z_", factors)
  291. # ── Q_omnibus ───────────────────────────────────────────────────────────────
  292. solveI <- solve(LDSCoutput$I)
  293. beta_hats_list <- lapply(Beta_list, function(beta) {
  294. as.matrix(beta)[, 1] %*% t(X)
  295. })
  296. Resid_parallel_list <- mapply(function(beta, beta_hat) {
  297. unname(as.numeric(as.vector(beta) - beta_hat))
  298. }, beta_l, beta_hats_list, SIMPLIFY = FALSE)
  299. inside_list <- lapply(se_snp, function(SEs_snp) {
  300. SEs_snp <- as.numeric(SEs_snp)
  301. solveI / (SEs_snp %*% t(SEs_snp))
  302. })
  303. Q_Omnibus_parallel <- mapply(Resid_parallel_list, inside_list, Resid_parallel_list,
  304. FUN = VMV)
  305. # ── Write batch results ──────────────────────────────────────────────────────
  306. for (j in factors) {
  307. GLS_mGWAS_results[batch_indices, paste0("beta_", j)] <- Beta_parallel_df[, paste0("Beta_", j)]
  308. GLS_mGWAS_results[batch_indices, paste0("SE_", j)] <- SE_parallel_df[, paste0("SE_", j)]
  309. GLS_mGWAS_results[batch_indices, paste0("Z_beta_", j)] <- Z_df_parallel[, paste0("Z_", j)]
  310. GLS_mGWAS_results[batch_indices, paste0("p_val_", j)] <- 2 * pnorm(-abs(
  311. GLS_mGWAS_results[batch_indices, paste0("Z_beta_", j)]))
  312. }
  313. GLS_mGWAS_results[batch_indices, "Q_omnibus"] <- Q_Omnibus_parallel
  314. GLS_mGWAS_results[batch_indices, "Q_omnibus_df"] <- length(colnames(betas)) - ncol(Beta_parallel_df)
  315. GLS_mGWAS_results[batch_indices, "Q_omnibus_pval"] <- pchisq(
  316. GLS_mGWAS_results[batch_indices, "Q_omnibus"],
  317. df = GLS_mGWAS_results[batch_indices, "Q_omnibus_df"],
  318. lower.tail = FALSE
  319. )
  320. GLS_mGWAS_results <- GLS_mGWAS_results %>% select(where(~ !all(is.na(.))))
  321. setTxtProgressBar(pb, batch_num)
  322. rm(snp_batch)
  323. if (batch_num %% 10 == 0) gc()
  324. }
  325. close(pb)
  326. end_time <- Sys.time()
  327. elapsed_time <- end_time - start_time
  328. cat("Finished at:", format(end_time, "%Y-%m-%d %H:%M:%S"), "\n")
  329. cat("Total time elapsed:", round(elapsed_time, 2), attr(elapsed_time, "units"), "\n")
  330. return(GLS_mGWAS_results)
  331. }

userGWASa.r at commit 6b65ca5, under GPL-3.0 · at the source

Overview

Authors: Jakub Kopal1, Alexey A Shadrin1,2, Dennis van der Meer1, Olav B Smeland1, Sara E Stinson1, Linn Rødevand1, Nadine Parker1, Kevin S O’Connell1, Oleksandr Frei1, Srdjan Djurovic1,3, Anders M Dale4,5,6,7,8, Ole A Andreassen1,2
  1. Centre for Precision Psychiatry, Division of Mental Health and Addiction, Oslo University Hospital & Institute of Clinical Medicine, University of Oslo, Oslo, Norway
  2. K.G. Jebsen Centre for Neurodevelopmental Disorders, University of Oslo and Oslo University Hospital, Oslo, Norway
  3. Department of Medical Genetics, Oslo University Hospital & University of Oslo, Oslo, Norway
  4. Department of Radiology, School of Medicine, University of California San Diego, La Jolla, CA USA
  5. Center for Multimodal Imaging and Genetics, J. Craig Venter Institute, La Jolla, CA USA
  6. Department of Psychiatry, School of Medicine, University of California San Diego, La Jolla, CA USA
  7. Department of Cognitive Science, University of California San Diego, La Jolla, CA USA
  8. Department of Neuroscience, University of California San Diego, La Jolla, CA USA
Institutions: Oslo University Hospital (Norway); University of Oslo (Norway); J. Craig Venter Institute (United States); University of California San Diego (United States)
Journal: Communications medicine, volume 6, issue 1, article 416
Dates: received 28 July 2025; accepted 24 February 2026; published online 27 July 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s43856-026-01510-z · PMID 42509310 · PMCID PMC13407876 · OpenAlex W4410592756
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism), other condition (population), ADHD (population), developmental (subfield)
Methods: Statistics, Preprocessing
Keywords: Neurodevelopmental disorders, Cardiovascular diseases, Neuroscience
Topic: Health, Environment, Cognitive Aging (Health, Toxicology and Mutagenesis, Environmental Science), according to OpenAlex
Funding: NIDA NIH HHS (U24 DA055330, U24 DA041123); NIA NIH HHS (R01 AG076838); NHLBI NIH HHS (OT2 HL161847)
Citations: not cited yet (Europe PMC); 101 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.

Repositories

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

BioPsyk/cleansumstats

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: e4fbc72d209466172fecc83f38dc608bed5ed190, 4 September 2025
Languages: Shell (128), Python (5), R (1)
Size: 283 files, 134 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, CITATION.cff, environment (docker/Dockerfile, docker/Dockerfile.deploy), tests, continuous integration, documentation
Not found: license file
Tools: Nextflow (24 files)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
135 files

bulik/ldsc

License: GPL-3.0
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: 2fdeeb3b44379408794154993dbd6101b8946b7e, 16 January 2026
Languages: Python (19), MATLAB (4), Perl (1), R (1)
Size: 1,093 files, 25 scripts
Software Heritage: archived
Found in: “Code availability”
Holds: README, license file, environment (environment.yml, requirements.txt, setup.py), tests
Not found: CITATION.cff, continuous integration, documentation
Tools: NumPy (18 files), pandas (11 files), SciPy (5 files), BEDTools (2 files)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
27 files
At the source: github.com/bulik/ldsc

comorment/ldsc

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: f2d7d6f7fffc4d12236f50740f7c848f8ddf6d9c, 10 November 2022
Languages: MATLAB (44), Shell (7), Python (5)
Size: 329 files, 56 scripts
Software Heritage: archived
Found in: “Code availability”
Holds: README, license file, CITATION.cff, environment (conda-environment.yml, docs/source/environment.yml, src/legacy_version/Dockerfile, src/dockerfiles/ldsc/Dockerfile), tests, continuous integration, documentation
Tools: data.table (1 file), ggplot2 (1 file), NumPy (1 file), pandas (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
58 files

precimed/mix3r

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 3faefc3b33123bec7db50c857f5ce03d81697bbb, 21 July 2025
Languages: Python (3), Jupyter (2), Shell (2), R (1)
Size: 18 files, 8 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, environment (environment.yml, apptainer/mix3r.def, docker/Dockerfile), continuous integration, 2 notebooks
Not found: license file, CITATION.cff, tests, documentation
Tools: pandas (3 files), data.table (2 files), NumPy (2 files), Matplotlib (1 file), Numba (1 file), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
9 files

GenomicSEM/GenomicSEM

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 6b65ca5db39fdade08b0d811477be1cdd57b5039, 26 August 2026
Languages: R (32)
Size: 82 files, 32 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: README, license file, environment (DESCRIPTION), documentation
Not found: CITATION.cff, tests, continuous integration
Tools: tidyverse (4 files), data.table (3 files), ggplot2 (2 files), ggpubr (2 files), lavaan (2 files), psych (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
34 files

precimed/pleiofdr

License: GPL-3.0
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 0da963cac22fe8de9030166d7aea974bcbb0a367, 3 June 2025
Languages: MATLAB (33), Python (9), R (3), Shell (2), Jupyter (1)
Size: 55 files, 48 scripts
Software Heritage: archived
Found in: “Code availability”
Holds: README, license file, 1 notebook
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (8 files), pandas (8 files), Statistics and Machine Learning Toolbox (6 files), data.table (3 files), SciPy (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
50 files

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s43856-026-01510-z.

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:

  • 6 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 303 scripts, each with its path and the digest of its content;
  • 4 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 statement

The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • it says that the data are available on request

Read it in the paper: doi.org/10.1038/s43856-026-01510-z.

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, 12 authors, 3 keywords, 3 funders, 100 references.

Cite

This paper

Kopal, J., Shadrin, A. A., van der Meer, D., Smeland, O. B., Stinson, S. E., Rødevand, L., Parker, N., O’Connell, K. S., Frei, O., Djurovic, S., Dale, A. M., & Andreassen, O. A. (2026). Mapping genetic convergence across brain structure, mental health, and cardiometabolic disease. Communications medicine, 6(1), 416. https://doi.org/10.1038/s43856-026-01510-z

BibTeX

@article{kopal2026mapping,
author = {Kopal, Jakub and Shadrin, Alexey A and van der Meer, Dennis and Smeland, Olav B and Stinson, Sara E and Rødevand, Linn and Parker, Nadine and O’Connell, Kevin S and Frei, Oleksandr and Djurovic, Srdjan and Dale, Anders M and Andreassen, Ole A},
title = {{Mapping genetic convergence across brain structure, mental health, and cardiometabolic disease}},
journal = {Communications medicine},
year = {2026},
month = jul,
volume = {6},
number = {1},
pages = {416},
publisher = {Nature Publishing Group},
issn = {2730-664X},
doi = {10.1038/s43856-026-01510-z},
url = {https://doi.org/10.1038/s43856-026-01510-z},
pmid = {42509310},
pmcid = {PMC13407876}
}

RIS

TY - JOUR
AU - Kopal, Jakub
AU - Shadrin, Alexey A
AU - van der Meer, Dennis
AU - Smeland, Olav B
AU - Stinson, Sara E
AU - Rødevand, Linn
AU - Parker, Nadine
AU - O’Connell, Kevin S
AU - Frei, Oleksandr
AU - Djurovic, Srdjan
AU - Dale, Anders M
AU - Andreassen, Ole A
TI - Mapping genetic convergence across brain structure, mental health, and cardiometabolic disease
T2 - Communications medicine
J2 - Commun Med (Lond)
PY - 2026
DA - 2026/07/27
VL - 6
IS - 1
SP - 416
SN - 2730-664X
PB - Nature Publishing Group
DO - 10.1038/s43856-026-01510-z
UR - https://doi.org/10.1038/s43856-026-01510-z
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s43856-026-01510-z",
"type": "article-journal",
"title": "Mapping genetic convergence across brain structure, mental health, and cardiometabolic disease",
"container-title": "Communications medicine",
"author": [
{
"family": "Kopal",
"given": "Jakub"
},
{
"family": "Shadrin",
"given": "Alexey A"
},
{
"family": "van der Meer",
"given": "Dennis"
},
{
"family": "Smeland",
"given": "Olav B"
},
{
"family": "Stinson",
"given": "Sara E"
},
{
"family": "Rødevand",
"given": "Linn"
},
{
"family": "Parker",
"given": "Nadine"
},
{
"family": "O’Connell",
"given": "Kevin S"
},
{
"family": "Frei",
"given": "Oleksandr"
},
{
"family": "Djurovic",
"given": "Srdjan"
},
{
"family": "Dale",
"given": "Anders M"
},
{
"family": "Andreassen",
"given": "Ole A"
}
],
"container-title-short": "Commun Med (Lond)",
"volume": "6",
"issue": "1",
"page": "416",
"DOI": "10.1038/s43856-026-01510-z",
"PMID": "42509310",
"PMCID": "PMC13407876",
"ISSN": "2730-664X",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s43856-026-01510-z",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
27
]
]
}
}

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.21203/rs.3.rs-9246968/v1 [code]
Copy number variants reveal divergent genetic and diagnostic cortical signatures across psychiatric disorders
Journal: Research Square (preprint)
In common: ggpubr, ggplot2, tidyverse, 2 other tools, genetics / omics, 12 references, 2 authors
[2] 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 behaviour
In common: psych, data.table, ggplot2, 5 other tools, developmental, genetics / omics, 9 references
[3] doi:10.1038/s41380-026-03497-4 [code]
Transcriptome-informed brain cartography of polygenic risk and association with brain structure in major psychiatric disorders.
Journal: Molecular psychiatry
In common: ggplot2, tidyverse, pandas, 3 other tools, ADHD, genetics / omics, other condition, 10 references
[4] doi:10.1038/s41467-026-72164-7 [code]
Multivariate genetic analysis reveals three distinct pathological dimensions in musculoskeletal disorders.
Journal: Nature communications
In common: lavaan, BEDTools, psych, 8 other tools, genetics / omics, 4 references
[5] doi:10.1073/pnas.2609814123 [code]
Genetic architectures of brain-related traits are shaped by strong selective constraints.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: BEDTools, data.table, Statistics and Machine Learning Toolbox, 6 other tools, genetics / omics, 7 references
[6] doi:10.1038/s41467-026-73428-y [code]
Regional heterogeneity in phenotypic and genetic associations between bone and brain in humans.
Journal: Nature communications
In common: lavaan, BEDTools, psych, 7 other tools, genetics / omics, 4 references
[7] doi:10.1002/gps3.70017 [code]
Shared genetic variants across substance use disorders implicate common neurobiological pathways, a genome-wide mixed methods study.
Journal: General psychiatry
In common: data.table, Statistics and Machine Learning Toolbox, pandas, 3 other tools, genetics / omics, other condition, 8 references
[8] doi:10.1038/s41467-026-73714-9 [code]
The genetic architecture of cortical similarity networks.
Journal: Nature communications
In common: ggplot2, tidyverse, pandas, 3 other tools, genetics / omics, 8 references
[9] doi:10.1038/s41467-026-70694-8 [code]
Shared genetic and neuroimmune architecture links type 1 diabetes with neurocognitive traits.
Journal: Nature communications
In common: data.table, tidyverse, genetics / omics, other condition, 9 references
[10] doi:10.1038/s41562-026-02476-7 [code]
Genome-wide meta-analysis of quantitatively measured generalized anxiety symptoms in individuals of European ancestry.
Journal: Nature human behaviour
In common: lavaan, BEDTools, psych, 2 other tools, genetics / omics, other condition, 3 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

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.