pgx
PGX — Lightweight Postgres for AI agents. Written in Rust. Thousands of isolated databases in one runtime. 🐘
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证GWAS meta-analysis pipeline functions
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
gwastargets provides a suite of functions for building reproducible multi-cohort GWAS meta-analysis pipelines using the targets framework. It supports both binary (case/control) and quantitative traits and handles the full workflow from raw summary statistics through meta-analysis and downstream quality-control.
The package is organized around two complementary use cases:
1. Generating a targets pipeline — given a cohort manifest and trait metadata, produce the complete _targets.R code for a reproducible analysis:查看完整 README ↗gwastargets provides a suite of functions for building reproducible multi-cohort GWAS meta-analysis pipelines using the targets framework. It supports both binary (case/control) and quantitative traits and handles the full workflow from raw summary statistics through meta-analysis and downstream quality-control.
# install.packages("pak")
pak::pkg_install("mglev1n/gwastargets")
The package is organized around two complementary use cases:
1. Generating a targets pipeline — given a cohort manifest and trait metadata, produce the complete _targets.R code for a reproducible analysis:
library(gwastargets)
manifest <- data.frame(
path = c("/data/UKBB_EUR.txt.gz", "/data/MVP_AFR.txt.gz", "/data/BBJ_EAS.txt.gz"),
file = c("UKBB_EUR.txt.gz", "MVP_AFR.txt.gz", "BBJ_EAS.txt.gz"),
cohort = c("UKBB", "MVP", "BBJ"),
ancestry = c("EUR", "AFR", "EAS"),
study = c("UKBB_EUR", "MVP_AFR", "BBJ_EAS"),
stringsAsFactors = FALSE
)
code <- generate_gwas_meta_pipeline(
trait = "CAD",
trait_type = "binary",
n_col = "EffectiveN",
manifest_df = manifest
)
cat(code)
2. Using the pipeline functions directly — each stage is available as a standalone exported function for interactive use or integration into existing workflows:
| Function | Purpose |
|---|---|
prep_gwas() | Clean, harmonize, and LDSC-correct one cohort's summary statistics |
summarize_sumstats() | Per-cohort QC summary (N, MAF range, median SE, precision) |
meta_analyze_ivw() | Fixed-effects IVW meta-analysis across cohorts |
extract_loci() | Clump significant variants into independent loci with gene annotation |
extract_common_variants() | Identify variants present across all studies (for MR-MEGA) |
calculate_mr_mega_mds() | Compute MR-MEGA MDS coordinates from cross-cohort effect estimates |
snp_match_munge() | Match summary statistics to a reference panel and munge for LDSC |
harmonize_sumstats_headers() | Standardize column names across GWAS file formats |
Raw summary stats (per cohort)
│
▼
prep_gwas() ← clean, match HM3, LDSC intercept correction
│
├──── ldsc_h2() per-cohort heritability (via ldscr)
│
├──── summarize_sumstats() per-cohort QC table
│
├──── meta_analyze_ivw() per-ancestry IVW meta-analysis
│ └── extract_loci()
│
└──── meta_analyze_ivw() all-populations IVW meta-analysis
├── extract_loci()
└── extract_common_variants()
└── calculate_mr_mega_mds()
generate_gwas_meta_pipeline() validates the manifest before generating any code. The required columns are:
| Column | Description |
|---|---|
path | Full path to the raw summary statistics file |
file | Basename of the file (used to join back to per-cohort summaries) |
cohort | Human-readable cohort label (e.g. "UKBB") |
ancestry | Ancestry label matching ldscr reference panels (e.g. "EUR", "AFR", "EAS") |
study | Unique identifier used as the tar_map target name — no spaces or special characters |
Additional columns are preserved in the serialized output and can be used downstream.
ldscr — LDSC heritability and genetic correlation in RtidyGWAS — GWAS summary statistics cleaninggwasRtools — GWAS loci extraction and annotationtargets — reproducible pipeline toolkit