Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

RSS Fine-mapping and TWAS Weights with QTL Summary Statistics

Fine-maps a cis window and learns TWAS weights from cis-QTL summary statistics plus an LD reference panel, without individual-level genotypes.

Overview

mnm_regression.ipynb fits a cis window from individual-level data: it needs the genotype matrix and the phenotype for every sample. That is not always possible -- summary statistics are shareable where genotypes are not, and a scan that has already run need not be repeated.

This module takes the other route. It reads a cis-QTL nominal association table (effect, standard error and the variant id per SNP), pairs it with an LD reference panel, and hands the resulting QtlSumStats to the same two pipelines the individual-level route uses:

  • qtl_rss_fine_mapping runs SuSiE-RSS (susieR::susie_rss) over the window. The regression-with-summary-statistics likelihood replaces the individual-level one; credible sets and PIPs mean what they always did.

  • qtl_rss_twas_weights learns predictive weights from the same object. Not every method has a summary-statistics implementation: mrash, lasso, scad, mcp, l0learn, mrmash and dpr_gibbs do; enet and the bayes_* family are individual-level only and will be rejected here.

The LD panel is the load-bearing input. RSS reconstructs the joint fit from marginal statistics and LD, so the panel must cover the window’s variants and must be on the same allele orientation. summaryStatsQc() harmonizes the two and reports what it corrected -- read that line. If it says it sign- or strand-flipped everything, the alleles were declared wrong, not fixed (see --variant-id-alleles below).

When to run it. After a cis scan (TensorQTL.ipynb), in place of mnm_regression.ipynb’s susie_twas when only summary statistics are available.

Input

  • --sumstats output/cis/example.cis_qtl.pairs.tsv.gz (the cis-QTL nominal table from TensorQTL.ipynb: one row per (trait, variant) with bhat/sebhat, pvalue, af and n. A z column is used if present, otherwise the Wald z bhat/sebhat is derived.)

  • --ld-sketch tests/fixtures/qtl_mini/protocol_example.genotype.chr22.bed (the LD reference panel: a genotype path/prefix, or a per-chromosome LD meta file. Its variants must cover the window.)

  • --study / --context / --trait -- the tuple this collection describes. --trait is the gene id, and is also what the trait filter matches.

  • --trait-column (default molecular_trait_id) -- a cis scan writes every gene into one table, so the rows for --trait are selected by this column. Set it empty for a file that already holds one gene.

  • --variant-id-alleles (none | A2A1 | A1A2) -- where the alleles come from when the table has no A1/A2 columns, as a cis scan typically does not: they sit inside the variant id. The order cannot be inferred from the string -- a .pvar writes REF:ALT (pecotmr’s canonical A2:A1) while a PLINK .bim writes A1:A2 -- so declare which one your ids use. A real A1/A2 column always wins. Declaring it wrong is silent: QC will “correct” the apparent mismatch by flipping every variant against the panel.

  • --genome (default GRCh38), --region, --n-sample, --column-mapping -- optional.

QC knobs are forwarded to summaryStatsQc(): --maf, --mac, --imiss, --z-mismatch-qc, --pip-cutoff-to-skip, and --skip-qc for diagnostics.

Output

  • {cwd}/sumstats/{study}.{context}.{trait}.qtl_sumstats.rds -- the QtlSumStats: the window’s variants with SNP/A1/A2/Z/N (plus BETA/SE/P/AF when supplied), the LD panel attached as the ldSketch, and a qcInfo audit of what QC did.

  • {cwd}/fine_mapping/{...}.qtl_rss_finemap.rds -- a QtlFineMappingResult: credible sets and PIPs from SuSiE-RSS, the same class the individual-level route produces.

  • {cwd}/twas_weights/{...}.qtl_rss_twas_weights.rds -- a TwasWeights collection.

Each step also writes .stdout / .stderr beside its output. The QC line in the sumstats log is worth reading every time:

[study/context/gene] QC summary: 200 in -> 200 out | corrected: sign-flip 0, strand-flip 0

Minimal Working Example

Runs on the committed chr22 toy data: the TensorQTL nominal table for 16 genes, with the same 49-sample genotypes used as the LD reference (in-sample LD -- fine for a smoke test, optimistic for real inference, where a separate reference panel belongs).

Command Interface

Workflow implementation