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