FM-GPT: Bayesian fine mapping for phenome-wide transcriptome-wide association studies.
The 2 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
- [1] § Results › FM-GPT accurately detects true causal genes across multiple traits while controlling false positives ↔ R/gen_gene_by_snp.R, lines 2–61 · score 0.66 · cis SNPs, phenotypic heritability, gene expression, variance, LD, binary
- [2] § Results › FM-GPT accurately detects true causal genes across multiple traits while controlling false positives ↔ example/fmgpt_simulation_code.R, the whole file · a weak match · score 0.53 · cis SNPs, ROC, AUC, FDR, power, variable
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 · 179 lines · 6.1 KB · no license · 1 match
- #'@param n_qtl The sample size of the reference qtl dataset
- #'@param n_gwas The sample size of the GWAS dataset
- #'@param snps_per_gene The total number of cis SNPs for each gene
- #'@param block_sizes How many genes are in each block
- #'@param rho_between The correlation between cis SNPs of different genes
- #'@param rho_within The correlation of cis SNPs for the same gene
- #'@param response_types A vector containing the number of continuous, binary and count variables (in that order)
- #'@param r The parameter controlling the negative binomial distribution for count variables
- #'@param k The total number of factors
- #'@param maf The minor allele frequency
- #'@param sigma2 (what is this again?)
- #'@param choice (what is this again?)
- #'@param sig_rho (what is this again?)
- #'@param binflate Inflation factor for the beta coefficients for the covariates. Used to control SNP heritability on gene expression
- #'@param vinfale Inflation factor for outcome variance. Used to control heritability
- #'@param pi0 The underlying probability of selecting any given group of genes
- #'@param pi1 The underlying probability of selecting any gene in a group
- #'@param pi2 The underlying probability of selecting any factor for a gene
- #'@param expression_heritability Used to control how much of an effect gene expression has on phenotype heritability
- gen_twas_sets <- function(n_qtl, n_gwas, n_genes, snps_per_gene, block_sizes, rho_between, rho_within, response_types = c(1,1,1), r = NULL, k, maf, sigma2 = NULL, choice = "Z", sig_rho = 0.66, binflate = 1, vinflate = 1, pi0, pi1, pi2, expression_heritability = 0.1) {
- response_vec <- rep(c("continuous", "binary", "count"), response_types)
- p <- sum(response_types)
- r2 <- numeric(p)
- if(is.null(r)) {
- r2[which(response_vec == "count")] <- 50
- } else {
- r2[which(response_vec == "count")] <- r
- }
- r <- r2
- n <- n_qtl + n_gwas
- xp <- sum(block_sizes) #total number of covariates
- LD_corr_matrix <- matrix(rho_between, xp, xp)
- row_start <- 1
- col_start <- 1
- for (size in block_sizes) {
- block_matrix <- matrix(rho_within, nrow = size, ncol = size)
- LD_corr_matrix[row_start:(row_start + size - 1), col_start:(col_start + size - 1)] <- block_matrix
- row_start <- row_start + size
- col_start <- col_start + size
- }
- diag(LD_corr_matrix) <-1
- mu <- numeric(xp)
- Z <- mvrnorm(n = n, mu, Sigma = LD_corr_matrix)
- prob_g0 <- dbinom(0, 2, maf)
- prob_g1 <- dbinom(1, 2, maf)
- prob_g2 <- dbinom(2, 2, maf)
- c1 <- numeric(xp)
- c2 <- numeric(xp)
- for (j in 1:xp) {
- c1[j] <- qnorm(prob_g0, mean = 0, sd = LD_corr_matrix[j,j])
- c2[j] <- qnorm(prob_g2, mean = 0, sd = LD_corr_matrix[j,j], lower.tail = FALSE)
- }
- G <- Z
- intervals <- c(-Inf, c1[1], c2[1], Inf)
- replacement_values <- c(0, 1, 2)
- for (i in seq_along(intervals)) {
- lower_bound <- intervals[i]
- upper_bound <- intervals[i + 1]
- G[(Z > lower_bound) & (Z <= upper_bound)] <- replacement_values[i]
- }
- G_qtl <- G[1:n_qtl,]
- G_gwas <- G[seq(n_qtl+1,n,1),]
- gene_mat <- matrix(nrow = n_qtl, ncol = n_genes)
- snp_sets <- seq(1, n_genes*snps_per_gene, by = snps_per_gene)
- snp_coef_mat <- matrix(0, nrow = snps_per_gene * n_genes, ncol = n_genes)
- counter <- 1
- for(i in snp_sets) {
- snp_coefs <- snp_coef_mat[seq(i,i+(snps_per_gene-1),1),counter] <- rnorm(n = snps_per_gene, sd = 1)
- eta <- as.numeric(G_qtl[,seq(i,i+(snps_per_gene-1),1)] %*% snp_coefs)
- gene_mat[,counter] <- rnorm(n_qtl, mean = eta, sd = sqrt(1-expression_heritability))
- counter <- counter + 1
- }
- group <- rep(1:length(block_sizes), times = block_sizes)
- Sig <- diag(k)
- Sig[Sig == 0] <- sig_rho
- if(choice == "G") {
- alpha <- rbinom(n = length(block_sizes), size = 1, prob = pi0)
- gamma <- rbinom(n = xp, size = 1, prob = pi1)
- omega <- rbinom(n = xp * k, size = 1, prob = pi2)
- amat <- matrix(rep(rep(alpha, times = table(group)), k), nrow = xp, ncol = k, byrow = FALSE)
- gmat <- matrix(rep(gamma, k), nrow = xp, k, byrow = FALSE)
- omat <- matrix(omega, ncol = k, byrow = FALSE)
- b <- MASS::mvrnorm(n = xp, mu = rep(0, k), Sigma = binflate * vinflate * Sig)
- beta_true <- amat * gmat * omat * b
- } else {
- gamma <- rbinom(n = n_genes, size = 1, prob = pi1)
- omega <- rbinom(n = n_genes * k, size = 1, prob = pi2)
- gmat <- matrix(rep(gamma, k), nrow = n_genes, k, byrow = FALSE)
- omat <- matrix(omega, ncol = k, byrow = FALSE)
- b <- MASS::mvrnorm(n = n_genes, mu = rep(0, k), Sigma = binflate * vinflate * Sig)
- beta_true <- gmat * omat * b
- }
- E_gwas <- G_gwas %*% snp_coef_mat
- A <- as.numeric(rowSums(abs(beta_true)) != 0)
- if(choice == "G") {
- XB <- G_gwas %*% beta_true
- } else {
- XB <- E_gwas %*% beta_true
- }
- Y_latent <- XB + MASS::mvrnorm(n = n_gwas, mu = rep(0,k), Sigma = vinflate * Sig)
- Lambda.true<- matrix(0,p,k)
- if(k == p) {
- for(h in 1:k){
- Lambda.true[sample(1:p,p),h] <- rnorm(k,0,1)
- }
- } else {
- for(h in 1:k){
- Lambda.true[sample(1:p,p)[1:(2*k-(h-1))],h] <- rnorm(2*k-(h-1),0,1)
- }
- }
- if(is.null(sigma2)) {
- Ucov <- diag(1/rgamma(p,shape=1,scale=0.25))
- } else {
- Ucov <- sigma2 * diag(p)
- }
- U <- MASS::mvrnorm(n = n_gwas, rep(0, p), Ucov)
- theta <- Y_latent %*% t(Lambda.true) + U
- Y_observed <- matrix(0, n_gwas, p)
- sigmoid <- function(x) {
- 1/(1 + exp(-x))
- }
- for(q in 1:length(response_vec)) {
- if(response_vec[q] == "continuous") {
- Y_observed[,q] <- matrix(Y_latent %*% Lambda.true[q,], n_gwas, 1) + U[,q] + rnorm(n_gwas, 0, 1)
- } else if(response_vec[q] == "binary") {
- prob <- sigmoid(matrix(Y_latent %*% Lambda.true[q, ], n_gwas, 1) + U[, q])
- Y_observed[,q] <- rbinom(n_gwas, 1, prob)
- } else {
- prob <- sigmoid(matrix(Y_latent %*% Lambda.true[q, ], n_gwas, 1) + U[, q])
- prob[prob > 0.9999] <- 0.9999
- Y_observed[,q] <- stats::rnbinom(n_gwas, size = r[q], prob = 1-prob)
- }
- }
- return(list(G_qtl = G_qtl, G_gwas = G_gwas, E_qtl = gene_mat, SNP_coef = snp_coef_mat, Yl = Y_latent, Yo = Y_observed, Lambda = Lambda.true, Sigma = vinflate * Sig,
- group = group, A = A, beta = beta_true, r = r, responses = response_vec, U = U, Ucov = diag(Ucov), LD = LD_corr_matrix))
- }
gen_gene_by_snp.R at commit 97b0994, no license · at the source
Overview
- Department of Epidemiology and Biostatistics, School of Public Health, University of Maryland, College Park, Maryland, United States of America
- Department of Mathematics, University of Maryland, College Park, Maryland, United States of America
- Maryland Psychiatric Research Center, Department of Psychiatry, School of Medicine, University of Maryland, Baltimore, Maryland, United States of America
- Department of Epidemiology and Public Health, School of Medicine, University of Maryland, Baltimore, Maryland, United States of America
- Graduate Institute of Statistics, National Central University, Taoyuan City, Taiwan
- Department of Statistics and Data Science, University of Central Florida, Orlando, Florida, United States of America
Abstract
The abstract is not reproduced here: the paper's license (none stated) 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 2 matches between paragraphs and lines of code.
tacanida/fm-gpt
97b099405913e854c86dd403df7b0dd0c8c5442e, 10 July 2026Availability: 1 check, the latest on 26 September 2026: the link answers
- 26 September 2026: the link answers
10 files
- R/
RcppExports.R , R, 31 lines - R/
bfdr.R , R, 13 lines - R/
fmgpt.R , R, 615 lines - R/
gen_gene_by_snp.R , R, 179 lines, 1 match - example/
fmgpt_simulation_code.R , R, 62 lines, 1 match - src/
RcppExports.cpp , C++, 151 lines - src/
armadillo.cpp , C++, 42 lines - src/
eigen.cpp , C++, 47 lines - src/
mat_funs.cpp , C++, 18 lines - README.md, Text, 16 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;
- 9 scripts, each with its path and the digest of its content;
- 2 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Code and data availability statement
The paper has a code and data availability statement. Its license (none stated) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: tacanida/
fm-gpt
Read it in the paper: doi.org/10.1371/journal.pgen.1012126.
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, 8 authors, 10 MeSH terms, 1 funder, 62 references.
Cite
This paper
Canida, T., Ye, Z., Wang, S.-H., Huang, H.-H., Pan, Y., Liang, M., Chen, S., & Ma, T. (2026). FM-GPT: Bayesian fine mapping for phenome-wide transcriptome-wide association studies. PLoS genetics, 22(9), e1012126. https://
BibTeX
@article{canida2026fm,
author = {Canida, Travis and Ye, Zhenyao and Wang, Shao-Hsuan and Huang, Hsin-Hsiung and Pan, Yezhi and Liang, Menglu and Chen, Shuo and Ma, Tianzhou},
title = {{FM-GPT: Bayesian fine mapping for phenome-wide transcriptome-wide association studies}},
journal = {PLoS genetics},
year = {2026},
month = sep,
volume = {22},
number = {9},
pages = {e1012126},
publisher = {PLOS},
issn = {1553-7390},
doi = {10.1371/
url = {https://
pmid = {42709879},
pmcid = {PMC13581217}
}
RIS
TY - JOUR
AU - Canida, Travis
AU - Ye, Zhenyao
AU - Wang, Shao-Hsuan
AU - Huang, Hsin-Hsiung
AU - Pan, Yezhi
AU - Liang, Menglu
AU - Chen, Shuo
AU - Ma, Tianzhou
TI - FM-GPT: Bayesian fine mapping for phenome-wide transcriptome-wide association studies
T2 - PLoS genetics
J2 - PLoS Genet
PY - 2026
DA - 2026/
VL - 22
IS - 9
SP - e1012126
SN - 1553-7390
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "FM-GPT: Bayesian fine mapping for phenome-wide transcriptome-wide association studies",
"container-title": "PLoS genetics",
"author": [
{
"family": "Canida",
"given": "Travis"
},
{
"family": "Ye",
"given": "Zhenyao"
},
{
"family": "Wang",
"given": "Shao-Hsuan"
},
{
"family": "Huang",
"given": "Hsin-Hsiung"
},
{
"family": "Pan",
"given": "Yezhi"
},
{
"family": "Liang",
"given": "Menglu"
},
{
"family": "Chen",
"given": "Shuo"
},
{
"family": "Ma",
"given": "Tianzhou"
}
],
"container-title-short":
"volume": "22",
"issue": "9",
"page": "e1012126",
"DOI": "10.1371/
"PMID": "42709879",
"PMCID": "PMC13581217",
"ISSN": "1553-7390",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
8
]
]
}
}
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.1038/s42003-026-10030-4 [code]
- Cell-type-aware transcriptome-wide association studies identify 91 independent risk genes for Alzheimer's disease dementia.Journal: Communications biologyIn common: genetics / omics, cellular / molecular, 6 references
- [2] doi:10.1038/s41467-026-75193-4 [code]
- Multi-ancestry gene expression models amplify transcriptome-wide association study discovery and validation.Journal: Nature communicationsIn common: genetics / omics, cellular / molecular, 6 references
- [3] doi:10.3390/biomedicines14081677 [code]
- Exploratory Genome and Transcriptome-Wide Association Analyses of Addiction-Related Phenotypes in a Twin Cohort.Journal: BiomedicinesIn common: genetics / omics, cellular / molecular, 5 references
- [4] 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 medicineIn common: genetics / omics, cellular / molecular, 5 references
- [5] 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 biologyIn common: genetics / omics, cellular / molecular, 6 references
- [6] doi:10.21203/rs.3.rs-10380518/v1 [code]
- Shared Genetic Architecture of Premenstrual Disorder and Postpartum Depression: Registry-Based and Genetic EvidenceJournal: Research Square (preprint)In common: genetics / omics, cellular / molecular, 4 references
- [7] doi:10.3390/genes17070813
- Multilayer Genomic Characterization of a Shared Genetic Factor Linking Depression-Related Liability and Reduced Physical Function.Journal: GenesIn common: genetics / omics, cellular / molecular, 4 references
- [8] doi:10.1038/s41588-026-02646-3 [code]
- Co-expression-based models improve eQTL predictions for transcriptome-wide association studies and highlight new schizophrenia-associated
genes. Journal: Nature geneticsIn common: genetics / omics, cellular / molecular, 4 references - [9] doi:10.34133/csbj.0108 [code]
- Latent Factor Modeling Reveals Unexpected Spatial Heterogeneity in Human Alzheimer's Disease Brain Transcriptomes.Journal: Computational and structural biotechnology journalIn common: pROC, genetics / omics, cellular / molecular, 2 references
- [10] doi:10.1038/s41467-026-72139-8 [code]
- Early and late RNA eQTL are driven by different genetic mechanisms.Journal: Nature communicationsIn common: genetics / omics, cellular / molecular, 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.
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, 9 scripts, and 2 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:20fe2d4e5d8347d9…
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
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
