OSCR

A Shared Genetic Basis Underlying Myopia-Exotropia Comorbidity.

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. [1] § Methods › Colocalization Analysis ↔ R/claudia.R, lines 366–485 · score 0.73 · Bayesian colocalization, Posterior probabilities, pp h4, causal variants, signals, SNPs
  2. [2] § Methods › Colocalization Analysis ↔ R/split.R, lines 4–62 · score 0.73 · Bayesian colocalization, Posterior probabilities, pp h4, causal variants, signals, SNPs
  3. [3] § Results › Cross-Trait Meta-Analysis Results ↔ R/claudia.R, lines 366–485 · score 0.52 · pp h4, shared signal, causal variant, colocalization, trait
  4. [4] § Results › Cross-Trait Meta-Analysis Results ↔ R/split.R, lines 4–62 · score 0.52 · pp h4, shared signal, causal variant, colocalization, trait

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 · 502 lines · 19 KB · no license · 2 matches

  1. ##' variance of MLE of beta for quantitative trait, assuming var(y)=1
  2. ##'
  3. ##' Internal function
  4. ##' @title Var.data
  5. ##' @param f minor allele freq
  6. ##' @param N sample number
  7. ##' @return variance of MLE beta
  8. ##' @author Claudia Giambartolomei
  9. Var.data <- function(f, N) {
  10. 1 / (2 * N * f * (1 - f))
  11. }
  12. ##' variance of MLE of beta for case-control
  13. ##'
  14. ##' Internal function
  15. ##' @title Var.data
  16. ##' @inheritParams Var.data
  17. ##' @param s ???
  18. ##' @return variance of MLE beta
  19. ##' @author Claudia Giambartolomei
  20. Var.data.cc <- function(f, N, s) {
  21. 1 / (2 * N * f * (1 - f) * s * (1 - s))
  22. }
  23. ##' Internal function, logsum
  24. ##'
  25. ##' This function calculates the log of the sum of the exponentiated
  26. ##' logs taking out the max, i.e. insuring that the sum is not Inf
  27. ##' @title logsum
  28. ##' @param x numeric vector
  29. ##' @return max(x) + log(sum(exp(x - max(x))))
  30. ##' @author Claudia Giambartolomei
  31. logsum <- function(x) {
  32. my.max <- max(x) ##take out the maximum value in log form
  33. my.res <- my.max + log(sum(exp(x - my.max )))
  34. return(my.res)
  35. }
  36. ##' Internal function, logdiff
  37. ##'
  38. ##' This function calculates the log of the difference of the exponentiated
  39. ##' logs taking out the max, i.e. insuring that the difference is not negative
  40. ##' @title logdiff
  41. ##' @param x numeric
  42. ##' @param y numeric
  43. ##' @return max(x) + log(exp(x - max(x,y)) - exp(y-max(x,y)))
  44. ##' @author Chris Wallace
  45. logdiff <- function(x,y) {
  46. my.max <- max(x,y) ##take out the maximum value in log form
  47. my.res <- my.max + log(max(exp(x - my.max) - exp(y-my.max), 0))
  48. return(my.res)
  49. }
  50. ##' Internal function, approx.bf.p
  51. ##'
  52. ##' Calculate approximate Bayes Factors
  53. ##' @title Internal function, approx.bf.p
  54. ##' @param p p value
  55. ##' @param f MAF
  56. ##' @param type "quant" or "cc"
  57. ##' @param N sample size
  58. ##' @param s proportion of samples that are cases, ignored if type=="quant"
  59. ##' @param suffix suffix to append to column names of returned data.frame
  60. ##' @return data.frame containing lABF and intermediate calculations
  61. ##' @author Claudia Giambartolomei, Chris Wallace
  62. approx.bf.p <- function(p,f,type, N, s, suffix=NULL) {
  63. if(type=="quant") {
  64. sd.prior <- 0.15
  65. V <- Var.data(f, N)
  66. } else {
  67. sd.prior <- 0.2
  68. V <- Var.data.cc(f, N, s)
  69. }
  70. z <- qnorm(0.5 * p, lower.tail = FALSE)
  71. ## Shrinkage factor: ratio of the prior variance to the total variance
  72. r <- sd.prior^2 / (sd.prior^2 + V)
  73. ## Approximate BF # I want ln scale to compare in log natural scale with LR diff
  74. lABF = 0.5 * (log(1-r) + (r * z^2))
  75. ret <- data.frame(V,z,r,lABF)
  76. if(!is.null(suffix))
  77. colnames(ret) <- paste(colnames(ret), suffix, sep=".")
  78. return(ret)
  79. }
  80. ##' Internal function, approx.bf.estimates
  81. ##'
  82. ##' Calculate approximate Bayes Factors using supplied variance of the
  83. ##' regression coefficients
  84. ##' @title Internal function, approx.bf.estimates
  85. ##' @param z normal deviate associated with regression coefficient and
  86. ##' its variance
  87. ##' @param V its variance
  88. ##' @param sdY standard deviation of the trait. If not supplied, will
  89. ##' be estimated.
  90. ##' @param effect_priors named vector with variance of prior effect
  91. ##' sizes for quantitative and case-control traits. don't change
  92. ##' unless you know what you are doing!
  93. ##' @inheritParams approx.bf.p
  94. ##' @return data.frame containing lABF and intermediate calculations
  95. ##' @author Vincent Plagnol, Chris Wallace
  96. approx.bf.estimates <- function (z, V, type, suffix=NULL, sdY=1,
  97. effect_priors=c(quant=0.15,cc=0.2)) {
  98. sd.prior <- if (type == "quant") { effect_priors["quant"] * sdY } else { effect_priors["cc"] }
  99. r <- sd.prior^2/(sd.prior^2 + V)
  100. lABF = 0.5 * (log(1 - r) + (r * z^2))
  101. ret <- data.frame(V, z, r, lABF)
  102. if(!is.null(suffix))
  103. colnames(ret) <- paste(colnames(ret), suffix, sep = ".")
  104. return(ret)
  105. }
  106. ##' Internal function, calculate posterior probabilities for configurations, given logABFs for each SNP and prior probs
  107. ##'
  108. ##' @title combine.abf
  109. ##' @param l1 merged.df$lABF.df1
  110. ##' @param l2 merged.df$lABF.df2
  111. ##' @param quiet don't print posterior summary if TRUE. default=FALSE
  112. ##' @inheritParams coloc.abf
  113. ##' @return named numeric vector of posterior probabilities
  114. ##' @author Claudia Giambartolomei, Chris Wallace
  115. combine.abf <- function(l1, l2, p1, p2, p12, quiet=FALSE) {
  116. stopifnot(length(l1)==length(l2))
  117. lsum <- l1 + l2
  118. lH0.abf <- 0
  119. lH1.abf <- log(p1) + logsum(l1)
  120. lH2.abf <- log(p2) + logsum(l2)
  121. lH3.abf <- log(p1) + log(p2) + logdiff(logsum(l1) + logsum(l2), logsum(lsum))
  122. lH4.abf <- log(p12) + logsum(lsum)
  123. all.abf <- c(lH0.abf, lH1.abf, lH2.abf, lH3.abf, lH4.abf)
  124. my.denom.log.abf <- logsum(all.abf)
  125. pp.abf <- exp(all.abf - my.denom.log.abf)
  126. names(pp.abf) <- paste("PP.H", (1:length(pp.abf)) - 1, ".abf", sep = "")
  127. if(!quiet) {
  128. print(signif(pp.abf,3))
  129. print(paste("PP abf for shared variant: ", signif(pp.abf["PP.H4.abf"],3)*100 , '%', sep=''))
  130. }
  131. return(pp.abf)
  132. }
  133. combine_abf_weighted <- function(l1, l2, p1, p2, p12,
  134. prior_weights1, prior_weights2,
  135. quiet = FALSE) {
  136. stopifnot(length(l1) == length(l2))
  137. Q <- length(l1)
  138. if (is.null(prior_weights1)) {
  139. p1_vec <- rep(p1, Q)
  140. } else {
  141. prior_weights1 <- prior_weights1 / sum(prior_weights1)
  142. p1_vec <- Q * p1 * prior_weights1
  143. }
  144. if (is.null(prior_weights2)) {
  145. p2_vec <- rep(p2, Q)
  146. } else {
  147. prior_weights2 <- prior_weights2 / sum(prior_weights2)
  148. p2_vec <- Q * p2 * prior_weights2
  149. }
  150. stopifnot(length(p1_vec) == length(p2_vec))
  151. stopifnot(length(p1_vec) == length(l1))
  152. p12_vec <- p1_vec * p2_vec * (p12 / (p1 * p2))
  153. lsum <- l1 + l2
  154. lH0_abf <- 0
  155. lH1_abf <- logsum(log(p1_vec) + l1)
  156. lH2_abf <- logsum(log(p2_vec) + l2)
  157. lH3_abf <- logdiff(logsum(log(p1_vec) + l1) + logsum(log(p2_vec) + l2),
  158. logsum(log(p1_vec) + log(p2_vec) + lsum))
  159. lH4_abf <- logsum(log(p12_vec) + lsum)
  160. all_abf <- c(lH0_abf, lH1_abf, lH2_abf, lH3_abf, lH4_abf)
  161. denom_log_abf <- logsum(all_abf)
  162. pp_abf <- exp(all_abf - denom_log_abf)
  163. names(pp_abf) <- paste0("PP.H", (1:length(pp_abf)) - 1, ".abf")
  164. if(!quiet) {
  165. print(signif(pp_abf,3))
  166. print(paste("PP abf for shared variant: ", signif(pp_abf["PP.H4.abf"],3) * 100 ,
  167. "%", sep = ""))
  168. }
  169. pp_abf
  170. }
  171. ##' Estimate trait standard deviation given vectors of variance of coefficients, MAF and sample size
  172. ##'
  173. ##' Estimate is based on var(beta-hat) = var(Y) / (n * var(X))
  174. ##' var(X) = 2*maf*(1-maf)
  175. ##' so we can estimate var(Y) by regressing n*var(X) against 1/var(beta)
  176. ##'
  177. ##' @title Estimate trait variance, internal function
  178. ##' @param vbeta vector of variance of coefficients
  179. ##' @param maf vector of MAF (same length as vbeta)
  180. ##' @param n sample size
  181. ##' @return estimated standard deviation of Y
  182. ##'
  183. ##' @author Chris Wallace
  184. sdY.est <- function(vbeta, maf, n) {
  185. warning("estimating sdY from maf and varbeta, please directly supply sdY if known")
  186. oneover <- 1/vbeta
  187. nvx <- 2 * n * maf * (1-maf)
  188. m <- lm(nvx ~ oneover - 1)
  189. cf <- coef(m)[['oneover']]
  190. if(cf < 0)
  191. stop("estimated sdY is negative - this can happen with small datasets, or those with errors. A reasonable estimate of sdY is required to continue.")
  192. return(sqrt(cf))
  193. }
  194. ##' Internal function, process each dataset list for coloc.abf.
  195. ##'
  196. ##' Made public for another package to use, but not intended for users to use.
  197. ##'
  198. ##' @title process.dataset
  199. ##' @param d list
  200. ##' @param suffix "df1" or "df2"
  201. ##' @param ... used to pass parameters to approx.bf.estimates, in
  202. ##' particular the effect_priors parameter
  203. ##' @return data.frame with log(abf) or log(bf)
  204. ##' @export
  205. ##' @author Chris Wallace
  206. process.dataset <- function(d, suffix, ...) {
  207. #message('Processing dataset')
  208. nd <- names(d)
  209. ## if (! 'type' %in% nd)
  210. ## stop("dataset ",suffix,": ",'The variable type must be set, otherwise the Bayes factors cannot be computed')
  211. ## if(!(d$type %in% c("quant","cc")))
  212. ## stop("dataset ",suffix,": ","type must be quant or cc")
  213. ## if(d$type=="cc" & "pvalues" %in% nd) {
  214. ## if(!( "s" %in% nd))
  215. ## stop("dataset ",suffix,": ","please give s, proportion of samples who are cases, if using p values")
  216. ## if(!("MAF" %in% nd))
  217. ## stop("dataset ",suffix,": ","please give MAF if using p values")
  218. ## if(d$s<=0 || d$s>=1)
  219. ## stop("dataset ",suffix,": ","s must be between 0 and 1")
  220. ## }
  221. ## if(d$type=="quant") {
  222. ## if(!("sdY" %in% nd || ("MAF" %in% nd && "N" %in% nd )))
  223. ## stop("dataset ",suffix,": ","must give sdY for type quant, or, if sdY unknown, MAF and N so it can be estimated")
  224. ## }
  225. if("beta" %in% nd && "varbeta" %in% nd) { ## use beta/varbeta. sdY should be estimated by now for quant
  226. ## if(length(d$beta) != length(d$varbeta))
  227. ## stop("dataset ",suffix,": ","Length of the beta vectors and variance vectors must match")
  228. ## if(!("snp" %in% nd))
  229. ## d$snp <- sprintf("SNP.%s",1:length(d$beta))
  230. ## if(length(d$snp) != length(d$beta))
  231. ## stop("dataset ",suffix,": ","Length of snp names and beta vectors must match")
  232. if(d$type=="quant" && !('sdY' %in% nd))
  233. d$sdY <- sdY.est(d$varbeta, d$MAF, d$N)
  234. df <- approx.bf.estimates(z=d$beta/sqrt(d$varbeta),
  235. V=d$varbeta, type=d$type, suffix=suffix, sdY=d$sdY)
  236. df$snp <- as.character(d$snp)
  237. if("position" %in% nd)
  238. df <- cbind(df,position=d$position)
  239. return(df)
  240. }
  241. if("pvalues" %in% nd & "MAF" %in% nd & "N" %in% nd) { ## no beta/varbeta: use p value / MAF approximation
  242. ## if (length(d$pvalues) != length(d$MAF))
  243. ## stop('Length of the P-value vectors and MAF vector must match')
  244. ## if(!("snp" %in% nd))
  245. ## d$snp <- sprintf("SNP.%s",1:length(d$pvalues))
  246. df <- data.frame(pvalues = d$pvalues,
  247. MAF = d$MAF,
  248. N=d$N,
  249. snp=as.character(d$snp))
  250. snp.index <- which(colnames(df)=="snp")
  251. colnames(df)[-snp.index] <- paste(colnames(df)[-snp.index], suffix, sep=".")
  252. ## keep <- which(df$MAF>0 & df$pvalues > 0) # all p values and MAF > 0
  253. ## df <- df[keep,]
  254. abf <- approx.bf.p(p=df$pvalues, f=df$MAF, type=d$type, N=df$N, s=d$s, suffix=suffix)
  255. df <- cbind(df, abf)
  256. if("position" %in% nd)
  257. df <- cbind(df,position=d$position)
  258. return(df)
  259. }
  260. stop("Must give, as a minimum, one of:\n(beta, varbeta, type, sdY)\n(beta, varbeta, type, MAF)\n(pvalues, MAF, N, type)")
  261. }
  262. ##' Bayesian finemapping analysis
  263. ##'
  264. ##' This function calculates posterior probabilities of different
  265. ##' causal variant for a single trait.
  266. ##'
  267. ##' If regression coefficients and variances are available, it
  268. ##' calculates Bayes factors for association at each SNP. If only p
  269. ##' values are available, it uses an approximation that depends on the
  270. ##' SNP's MAF and ignores any uncertainty in imputation. Regression
  271. ##' coefficients should be used if available.
  272. ##'
  273. ##' @title Bayesian finemapping analysis
  274. ##' @param dataset a list with specifically named elements defining the dataset
  275. ##' to be analysed. See \code{\link{check_dataset}} for details.
  276. ##'
  277. ##' @param p1 prior probability a SNP is associated with the trait 1, default 1e-4
  278. ##' @param prior_weights Non-negative weights for the prior probability a SNP is causal
  279. ##' @return a \code{data.frame}:
  280. ##' \itemize{
  281. ##' \item an annotated version of the input data containing log Approximate Bayes Factors and intermediate calculations, and the posterior probability of the SNP being causal
  282. ##' }
  283. ##' @author Chris Wallace
  284. ##' @export
  285. finemap.abf <- function(dataset, p1=1e-4, prior_weights = NULL) {
  286. check_dataset(dataset,"")
  287. df <- process.dataset(d=dataset, suffix="")
  288. nsnps <- nrow(df)
  289. p1=adjust_prior(p1,nsnps,"1")
  290. if (!is.null(prior_weights) && (nsnps != length(prior_weights) | (prior_weights <= 0))) {
  291. stop("Length of prior weights must match size of dataset")
  292. }
  293. dfnull <- df[1,]
  294. for(nm in colnames(df))
  295. dfnull[,nm] <- NA
  296. dfnull[,"snp"] <- "null"
  297. dfnull[,"lABF."] <- 0
  298. df <- rbind(df,dfnull)
  299. ## data.frame("V."=NA,
  300. ## z.=NA,
  301. ## r.=NA,
  302. ## lABF.=1,
  303. ## snp="null"))
  304. if (!is.null(prior_weights)) {
  305. prior_vec <- p1 * nsnps * prior_weights / sum(prior_weights)
  306. df$prior <- c(prior_vec, 1 - nsnps * p1)
  307. } else {
  308. df$prior <- c(rep(p1,nsnps),1-nsnps*p1)
  309. }
  310. ## add SNP.PP.H4 - post prob that each SNP is THE causal variant for a shared signal
  311. ## BUGFIX 16/5/19
  312. ## my.denom.log.abf <- logsum(df$lABF + df$prior)
  313. ## df$SNP.PP <- exp(df$lABF - my.denom.log.abf)
  314. my.denom.log.abf <- logsum(df$lABF + log(df$prior))
  315. df$SNP.PP <- exp(df$lABF + log(df$prior) - my.denom.log.abf)
  316. return(df)
  317. }
  318. adjust_prior=function(p,nsnps,suffix="") {
  319. if(nsnps * p >= 1) { ## for very large regions
  320. warning(paste0("p",suffix," * nsnps >= 1, setting p",suffix,"=1/(nsnps + 1)"))
  321. 1/(nsnps + 1)
  322. } else {
  323. p
  324. }
  325. }
  326. ##' Bayesian colocalisation analysis
  327. ##'
  328. ##' This function calculates posterior probabilities of different
  329. ##' causal variant configurations under the assumption of a single
  330. ##' causal variant for each trait.
  331. ##'
  332. ##' If regression coefficients and variances are available, it
  333. ##' calculates Bayes factors for association at each SNP. If only p
  334. ##' values are available, it uses an approximation that depends on the
  335. ##' SNP's MAF and ignores any uncertainty in imputation. Regression
  336. ##' coefficients should be used if available.
  337. ##'
  338. ##' @title Fully Bayesian colocalisation analysis using Bayes Factors
  339. ##' @param dataset1 a list with specifically named elements defining
  340. ##' the dataset to be analysed. See \code{\link{check_dataset}}
  341. ##' for details.
  342. ##' @param dataset2 as above, for dataset 2
  343. ##' @param MAF Common minor allele frequency vector to be used for
  344. ##' both dataset1 and dataset2, a shorthand for supplying the same
  345. ##' vector as parts of both datasets
  346. ##' @param p1 prior probability a SNP is associated with trait 1,
  347. ##' default 1e-4
  348. ##' @param p2 prior probability a SNP is associated with trait 2,
  349. ##' default 1e-4
  350. ##' @param p12 prior probability a SNP is associated with both traits,
  351. ##' default 1e-5
  352. ##' @param prior_weights1 Non-negative weights for the prior
  353. ##' probability a SNP is associated with trait 1
  354. ##' @param prior_weights2 Non-negative weights for the prior
  355. ##' probability a SNP is asscoiated with trait 2
  356. ##' @param ... used to pass parameters to approx.bf.estimates, in
  357. ##' particular the effect_priors parameter
  358. ##' @return a list of two \code{data.frame}s: \itemize{ \item summary
  359. ##' is a vector giving the number of SNPs analysed, and the
  360. ##' posterior probabilities of H0 (no causal variant), H1 (causal
  361. ##' variant for trait 1 only), H2 (causal variant for trait 2
  362. ##' only), H3 (two distinct causal variants) and H4 (one common
  363. ##' causal variant) \item results is an annotated version of the
  364. ##' input data containing log Approximate Bayes Factors and
  365. ##' intermediate calculations, and the posterior probability
  366. ##' SNP.PP.H4 of the SNP being causal for the shared signal *if*
  367. ##' H4 is true. This is only relevant if the posterior support for
  368. ##' H4 in summary is convincing. }
  369. ##' @author Claudia Giambartolomei, Chris Wallace, Jeffrey Pullin
  370. ##' @export
  371. coloc.abf <- function(dataset1, dataset2, MAF=NULL,
  372. p1=1e-4, p2=1e-4, p12=1e-5,
  373. prior_weights1 = NULL, prior_weights2 = NULL, ...) {
  374. if(!("MAF" %in% names(dataset1)) & !is.null(MAF))
  375. dataset1$MAF <- MAF
  376. if(!("MAF" %in% names(dataset2)) & !is.null(MAF))
  377. dataset2$MAF <- MAF
  378. check_dataset(d=dataset1,1)
  379. check_dataset(d=dataset2,2)
  380. df1 <- process.dataset(d=dataset1, suffix="df1")
  381. df2 <- process.dataset(d=dataset2, suffix="df2")
  382. if (!is.null(prior_weights1) && (nrow(df1) != length(prior_weights1))) {
  383. stop("Length of prior_weights1 must match size of dataset 1")
  384. }
  385. if (!is.null(prior_weights2) && (nrow(df2) != length(prior_weights2))) {
  386. stop("Length of prior_weights2 must match size of dataset 2")
  387. }
  388. if (!is.null(prior_weights1) && any(is.na(prior_weights1) | (prior_weights1 < 0))) {
  389. stop("prior_weights1 must contain non-negative weights.")
  390. }
  391. if (!is.null(prior_weights2) && any(is.na(prior_weights2) | (prior_weights2 < 0))) {
  392. stop("prior_weights2 must contain non-negative weights.")
  393. }
  394. if (!is.null(prior_weights1) && !is.null(prior_weights2)) {
  395. warning("Prior weights specified for both traits.\n",
  396. " The two weight vectors should be derived from independent sources of\n",
  397. " information, i.e. not computed using the same method.")
  398. }
  399. p1=adjust_prior(p1,nrow(df1),"1")
  400. p2=adjust_prior(p2,nrow(df2),"2")
  401. merged.df <- merge(df1,df2)
  402. p12=adjust_prior(p12,nrow(merged.df),"12")
  403. prior_weights1 <- prior_weights1[which(df1$snp %in% merged.df$snp)]
  404. prior_weights2 <- prior_weights2[which(df2$snp %in% merged.df$snp)]
  405. if(!nrow(merged.df))
  406. stop("dataset1 and dataset2 should contain the same snps in the same order, or should contain snp names through which the common snps can be identified")
  407. merged.df$internal.sum.lABF <- with(merged.df, lABF.df1 + lABF.df2)
  408. ## add SNP.PP.H4 - post prob that each SNP is THE causal variant for a shared signal
  409. my.denom.log.abf <- logsum(merged.df$internal.sum.lABF)
  410. merged.df$SNP.PP.H4 <- exp(merged.df$internal.sum.lABF - my.denom.log.abf)
  411. is_weighted <- !is.null(prior_weights1) || !is.null(prior_weights2)
  412. if (is_weighted) {
  413. pp.abf <- combine_abf_weighted(merged.df$lABF.df1, merged.df$lABF.df2,
  414. p1, p2, p12, prior_weights1, prior_weights2)
  415. } else {
  416. pp.abf <- combine.abf(merged.df$lABF.df1, merged.df$lABF.df2, p1, p2, p12)
  417. }
  418. common.snps <- nrow(merged.df)
  419. results <- c(nsnps=common.snps, pp.abf)
  420. output<-list(summary=results,
  421. results=merged.df,
  422. priors=c(p1=p1,p2=p2,p12=p12))
  423. if (is_weighted) {
  424. output$weights <- list(
  425. prior_weights1 = prior_weights1,
  426. prior_weights2 = prior_weights2
  427. )
  428. }
  429. class(output) <- c("coloc_abf",class(output))
  430. return(output)
  431. }
  432. ##' Get credible sets from finemapping results
  433. ##'
  434. ##' @title credible.sets
  435. ##' @param dataset data.frame output of `finemap.abf()`
  436. ##' @param credible.size threshold of the credible set (Default: 0.95)
  437. ##' @return SNP ids of the credible set
  438. ##' @author Guillermo Reales, Chris Wallace
  439. ##' @export
  440. credible.sets <- function(dataset, credible.size = 0.95){
  441. if(!"SNP.PP" %in% names(dataset)) stop("Input must be finemap.abf() output and have a SNP.PP column.")
  442. t2 <- dataset[ order(dataset$SNP.PP, decreasing = TRUE),]
  443. t2$csum <- cumsum(t2$SNP.PP)
  444. w=which(cumsum(t2$SNP.PP)>=credible.size)[1]
  445. t2[ 1:w ,c("snp","SNP.PP")]
  446. }

claudia.R at commit 8f20f0b, no license · at the source

Overview

Authors: Yuze Mi1, Zhe Tao2, Zhengbo Xue1, Shaokai Lin1, Yebao Huang3, Qinnan Zhu1, Xinni Zheng1, Yanggang Hong4, Zirong Liu5, Luyao Tong6, Jiawei Zhou1, Minghui Wan1
  1. State Key Laboratory of Eye Health, Eye Hospital and National Engineering Research Center of Ophthalmology and Optometry, Wenzhou Medical University, Wenzhou, China
  2. The Fourth School of Clinical Medicine, Zhejiang Chinese Medical University, Hangzhou, China
  3. Liuzhou People's Hospital, Guangxi Medical University, Liuzhou, China
  4. The Second School of Medicine, Wenzhou Medical University, Wenzhou, China
  5. Department of Ophthalmology, LKS Faculty of Medicine, The University of Hong Kong, Hong Kong SAR, China
  6. Department of Ophthalmology, The First Affiliated Hospital of Ningbo University, Ningbo, China
Journal: Investigative ophthalmology & visual science, volume 67, issue 8, article 61
Dates: received 20 November 2025; accepted 1 July 2026; published online 30 July 2026; in print July 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1167/iovs.67.8.61 · PMID 42530915 · PMCID PMC13436582 · OpenAlex W7171801441
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: genetics / omics (modality), human (organism)
Methods: Statistics, Smoothing, state filtering, decompositions, Preprocessing, Physiology & signal measures
Keywords: myopia, exotropia, genetics, shared genetic architecture
MeSH: Genetic Predisposition to Disease*, Myopia*, Comorbidity, Genome-Wide Association Study, Humans, Multifactorial Inheritance, Polymorphism, Single Nucleotide (* major topic)
Topic: Ophthalmology and Visual Impairment Studies (Epidemiology, Medicine), according to OpenAlex
Citations: not cited yet (Europe PMC); 58 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 4 matches between paragraphs and lines of code.

chr1swallace/coloc

License: none: the authors keep all their rights
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: 8f20f0bc5e60ffc99e4c2f787bd55fd30cfe7c45, 22 September 2026
Languages: R (25), JavaScript (15)
Size: 398 files, 40 scripts
Software Heritage: archived
Found in: the acknowledgements
Holds: README, environment (DESCRIPTION), tests, documentation, 7 notebooks
Not found: license file, CITATION.cff, continuous integration
Tools: data.table (2 files), ggplot2 (2 files), cowplot (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
41 files

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;
  • 40 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

Datasets cited

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, 4 keywords, 7 MeSH terms, 58 references.

Cite

This paper

Mi, Y., Tao, Z., Xue, Z., Lin, S., Huang, Y., Zhu, Q., Zheng, X., Hong, Y., Liu, Z., Tong, L., Zhou, J., & Wan, M. (2026). A Shared Genetic Basis Underlying Myopia-Exotropia Comorbidity. Investigative ophthalmology & visual science, 67(8), 61. https://doi.org/10.1167/iovs.67.8.61

BibTeX

@article{mi2026shared,
author = {Mi, Yuze and Tao, Zhe and Xue, Zhengbo and Lin, Shaokai and Huang, Yebao and Zhu, Qinnan and Zheng, Xinni and Hong, Yanggang and Liu, Zirong and Tong, Luyao and Zhou, Jiawei and Wan, Minghui},
title = {{A Shared Genetic Basis Underlying Myopia-Exotropia Comorbidity}},
journal = {Investigative ophthalmology \& visual science},
year = {2026},
month = jul,
volume = {67},
number = {8},
pages = {61},
publisher = {Association for Research in Vision and Ophthalmology},
issn = {0146-0404},
doi = {10.1167/iovs.67.8.61},
url = {https://doi.org/10.1167/iovs.67.8.61},
pmid = {42530915},
pmcid = {PMC13436582}
}

RIS

TY - JOUR
AU - Mi, Yuze
AU - Tao, Zhe
AU - Xue, Zhengbo
AU - Lin, Shaokai
AU - Huang, Yebao
AU - Zhu, Qinnan
AU - Zheng, Xinni
AU - Hong, Yanggang
AU - Liu, Zirong
AU - Tong, Luyao
AU - Zhou, Jiawei
AU - Wan, Minghui
TI - A Shared Genetic Basis Underlying Myopia-Exotropia Comorbidity
T2 - Investigative ophthalmology & visual science
J2 - Invest Ophthalmol Vis Sci
PY - 2026
DA - 2026/07/01
VL - 67
IS - 8
SP - 61
SN - 0146-0404
PB - Association for Research in Vision and Ophthalmology
DO - 10.1167/iovs.67.8.61
UR - https://doi.org/10.1167/iovs.67.8.61
LA - en
ER -

CSL-JSON

{
"id": "10.1167/iovs.67.8.61",
"type": "article-journal",
"title": "A Shared Genetic Basis Underlying Myopia-Exotropia Comorbidity",
"container-title": "Investigative ophthalmology & visual science",
"author": [
{
"family": "Mi",
"given": "Yuze"
},
{
"family": "Tao",
"given": "Zhe"
},
{
"family": "Xue",
"given": "Zhengbo"
},
{
"family": "Lin",
"given": "Shaokai"
},
{
"family": "Huang",
"given": "Yebao"
},
{
"family": "Zhu",
"given": "Qinnan"
},
{
"family": "Zheng",
"given": "Xinni"
},
{
"family": "Hong",
"given": "Yanggang"
},
{
"family": "Liu",
"given": "Zirong"
},
{
"family": "Tong",
"given": "Luyao"
},
{
"family": "Zhou",
"given": "Jiawei"
},
{
"family": "Wan",
"given": "Minghui"
}
],
"container-title-short": "Invest Ophthalmol Vis Sci",
"volume": "67",
"issue": "8",
"page": "61",
"DOI": "10.1167/iovs.67.8.61",
"PMID": "42530915",
"PMCID": "PMC13436582",
"ISSN": "0146-0404",
"publisher": "Association for Research in Vision and Ophthalmology",
"URL": "https://doi.org/10.1167/iovs.67.8.61",
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
1
]
]
}
}

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.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: cowplot, data.table, ggplot2, genetics / omics, 4 references
[2] doi:10.1186/s12967-026-08266-z [code]
Single-cell multi-omic integration analysis prioritizes druggable genes and reveals cell-type-specific causal effects in glioblastomagenesis.
Journal: Journal of translational medicine
In common: cowplot, data.table, ggplot2, genetics / omics, 3 references
[3] 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 communications
In common: data.table, ggplot2, genetics / omics, 4 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: data.table, ggplot2, genetics / omics, 4 references
[5] doi:10.1007/s00406-026-02302-1 [code]
Exploring the genetic correlation between inflammatory bowel disease and psychiatric disorders: insights from genome-wide association studies.
Journal: European archives of psychiatry and clinical neuroscience
In common: data.table, ggplot2, genetics / omics, 4 references
[6] 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: data.table, ggplot2, genetics / omics, 4 references
[7] 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: data.table, ggplot2, genetics / omics, 4 references
[8] doi:10.1371/journal.pcbi.1014422 [code]
Deciphering cell type-specific causal genetic effects on brain imaging-derived phenotypes and disorders with single-cell Mendelian randomization.
Journal: PLoS computational biology
In common: data.table, ggplot2, genetics / omics, 4 references
[9] 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: data.table, genetics / omics, 4 references
[10] doi:10.1080/20008066.2026.2709174
Exploring the shared genetic architecture between post-traumatic stress disorder (PTSD) and obstructive sleep apnea (OSA).
Journal: European journal of psychotraumatology
In common: genetics / omics, 5 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.