/hvantk:qtl-cascade --tissues T[,T...] [--eqtl-raw DIR --pqtl-raw DIR] [--out DIR]from hvantk
Runs hvantk's molecular QTL cascade: builds eQTL/pQTL tables, classifies shared variants, colocalises signals per gene, produces HTML reports, and optionally colocalises GWAS loci with eQTLs.
Ships in hvantk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Read the hvantk:workflow-conventions skill (skills/workflow-conventions/SKILL.md)
first; this skill assumes its site-profile rule, its section contract and its
measurement contract.
Building, per tissue, the eQTL and pQTL Hail Tables with the gtex-eqtl and pqtl
plugins, joining them into the QTL cascade (eqtl_mediated, discordant,
eqtl_only, pqtl_only), colocalising eQTL and pQTL signals per gene with the ABF
method, and producing, per tissue: the cascade table, a gene-level summary (table
and TSV), a coloc results TSV, plots, a self-contained HTML report, and a JSON
summary receipt (summarize-cascade.py, step 6). Optionally, hvantk qtlcascade gwas-coloc colocalises one GWAS locus against an eQTL dataset by remote tabix — a
separate, egress-needing step this skill covers as a procedure step and a reference.
Use this skill once the eQTL and pQTL raw files exist on disk (BYO or downloaded
separately) and you want the cascade, the coloc table, and the report. Not this skill:
acquiring GTEx or pQTL raw files (both BYO; the resource specs
hvantk/skills/gtex_eqtl/SKILL.md and hvantk/skills/pqtl/SKILL.md cover acquisition
and raw-format detail) or designing a fine-mapping model (gwas-coloc's optional
SuSiE confirmation only; references/gwas-coloc.md).
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/_site/check-site-profile.sh";
stop and ask for any missing value. Every later command that reads a profile value
starts with the same source "$HVANTK_SITE_PROFILE" &&.git -C "$HVANTK_REPO" rev-parse HEAD and
git -C "$HVANTK_REPO" status --porcelain; compare with the commit the user expects.sha256sum "$(readlink -f "$HVANTK_SIF")"; record the digest.eqtlgen is GRCh38; eqtlgen is GRCh37, and its
builder leaves beta/se null outright, so no row built from it is ever classed as
eQTL and it cannot feed the cascade or coloc at all (references/inputs.md). Never mix
it with a GRCh38 table in one cascade run regardless.--tissue/--tissues) is an exact string
match against both tables' tissue field. GTEx sub-tissue names (Liver,
Colon_Transverse, Heart_Left_Ventricle, ...) and Fang pQTL tissue names (Colon,
Heart, Liver, Lung, Thyroid) are NOT the same vocabulary — some Fang names
split across several GTEx sub-tissues. Confirm which GTEx sub-tissue(s) correspond to
the pQTL tissue you are using before you build either table (references/inputs.md).references/inputs.md); a significant-pairs-only table does not error — coloc still
runs, just on far fewer shared variants than the window actually has, which inflates
H4.hvantk reprocess hgnc:lookup), because the
cascade join needs Ensembl IDs on both sides. Confirm one exists, or build it first: if
the raw complete-set TSV is not staged yet,
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/run-in-image.sh" -- hvantk download hgnc --output <hgnc raw dir>/hgnc_complete_set.txt
on the login node (it exits 1, with a clear message, if that output path already exists
— check first rather than retrying with --overwrite blindly).submit-hail-job.sh; see Preflight step 8 for the download if the raw file is not staged):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" \
--name <run>-hgnc --cpus 2 --mem-gb 8 --time 0-00:20:00 --wait -- \
hvantk reprocess hgnc:lookup --raw-dir <hgnc raw dir> --output <hgnc>.ht \
--skip-download --no-check-drift
cascade applies its own --eqtl-p later, so the same table serves both the
cascade input and the coloc input):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" \
--name <run>-eqtl --cpus 8 --mem-gb 64 --time 0-02:00:00 --wait -- \
hvantk reprocess gtex-eqtl:eqtls --raw-dir <eqtl raw dir> --output <eqtl>.ht \
--skip-download --no-check-drift \
--plugin-arg source=gtex_v8 --plugin-arg tissue=<Tissue> --plugin-arg p_threshold=0
source is one of gtex_v11 (parquet), gtex_v8 (TSV), or eqtlgen (TSV,
GRCh37, whole-genome in one file — see Preflight step 5 for why it cannot feed
the cascade or coloc regardless of how it is built).p_threshold plugin-arg at all
(its builder default is None, not a number); hgnc_ht is required unless you
deliberately want a non-cascade, symbol-keyed table):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" \
--name <run>-pqtl --cpus 8 --mem-gb 64 --time 0-02:00:00 --wait -- \
hvantk reprocess pqtl:metrics --raw-dir <pqtl raw dir> --output <pqtl>.ht \
--skip-download --no-check-drift \
--plugin-arg tissue=<Tissue> --plugin-arg hgnc_ht=<hgnc>.ht
run-in-image.sh (no Hail
table is read and nothing is written under -o; it only prints the plan):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/run-in-image.sh" -- \
hvantk qtlcascade run --eqtl-ht <eqtl>.ht --pqtl-ht <pqtl>.ht \
--eqtl-allpairs <eqtl>.ht --pqtl-allpairs <pqtl>.ht \
--tissues <Tissue> -o "$HVANTK_WORK/out/qtl" --dry-run
--eqtl-allpairs/--pqtl-allpairs together to skip
coloc — both or neither, never one):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" \
--name <run>-cascade --cpus 8 --mem-gb 64 --time 0-02:00:00 --wait -- \
hvantk qtlcascade run --eqtl-ht <eqtl>.ht --pqtl-ht <pqtl>.ht \
--eqtl-allpairs <eqtl>.ht --pqtl-allpairs <pqtl>.ht \
--tissues <Tissue> -o "$HVANTK_WORK/out/qtl" \
[--eqtl-p 5e-8] [--pqtl-p 5e-8] [--window-kb 500] [--no-plots] [--no-report] [--overwrite]
Component commands (cascade, coloc, report), the output layout and the gene
summary columns are in references/components-and-outputs.md. --tissues can be
omitted (outputs then land under per_tissue/all instead of a per-tissue name);
the printed summary line differs accordingly (step 6 below).summarize-cascade.py reads the per-tissue outputs
and prints and records the class counts, the coloc summary and digests of the two
TSVs (optionally also the .provenance.json sha256 of the eQTL/pQTL/HGNC tables,
via --eqtl-ht/--pqtl-ht/--hgnc-ht):
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" \
--name <run>-summary --cpus 2 --mem-gb 8 --time 0-00:15:00 --wait -- \
python "$HVANTK_REPO/skills/qtl-cascade/templates/summarize-cascade.py" \
--out-dir "$HVANTK_WORK/out/qtl" --tissue <Tissue> --receipt "$HVANTK_WORK/out/qtl/summary.json"
Write its gene count and colocalised count into the run notes as their own
lines, cascade_genes: <n> and colocalised: <m>, not the printed line verbatim.hvantk qtlcascade gwas-coloc) on a node
with egress — it streams FinnGen and the eQTL Catalogue by remote tabix, so it
cannot run on a compute node with no egress. Only gwas-coloc needs it; the tool
manifest's requires.network is group-level, so it reads true for every
qtlcascade subcommand even though cascade/coloc/run/report need no
egress at all (see references/gwas-coloc.md). references/gwas-coloc.md also
covers its other options, the fine-mapping inputs, the LD reference, and using
the GWAS Catalog table to choose a lead locus.All-pairs eQTL and pQTL tables are large (on the order of 10^8 rows for a GTEx
tissue, whether TSV or parquet): build each tissue's table as its own job, 8-16
cores and 64 GB or more regardless of source format, node-local scratch. Several
tissues can share one qtlcascade run --tissues a,b,c invocation, or one job per
tissue when sizes differ a lot; a multi-tissue run writes a cross-tissue heatmap
alongside each tissue's own outputs when at least two tissues complete. Coloc's
memory does NOT follow --window-kb: prepare_coloc_data inner-joins the full
allpairs tables for every cascade-candidate gene and collects every shared pair to
the driver (to_pandas()) before the per-gene window filter ever runs (in pandas,
after collection) — size for the number of SHARED variants across every candidate
gene's FULL allpairs range, not for the window. Plot and report generation are
cheap and run inline. --overwrite replaces an existing output directory's Hail
table checkpoints; see Traps for why that alone is not enough for a clean rerun.
==. Fix: confirm the GTEx sub-tissue name(s) that correspond to the pQTL tissue
before building either table (references/inputs.md); there is no built-in mapping
applied automatically. A quick workaround when you control the raw files: relabel
a tissue by renaming or symlinking its raw file, since the tissue name a builder
assigns is exactly the filename prefix before the first dot.H4 that looks
inflated or otherwise untrustworthy, even though the cascade itself has rows.
Cause: one or both allpairs tables are significant-pairs-only, so the regional
window around the lead eQTL variant (the lowest eQTL p-value among the variants
SHARED with the pQTL table, not the lowest genome-wide) has far fewer real
variants than the true all-pairs window would. Fix: rebuild from an all-pairs
source; references/inputs.md says where to get one per eQTL source.Both eqtl_allpairs_ht and pqtl_allpairs_ht are required for colocalization (or omit both to skip coloc). Cause: --eqtl-allpairs/--pqtl-allpairs were given for only
one side. Fix: pass both, or neither (to run the cascade without coloc).hgnc_ht, or raises because no symbol mapped.
Cause: Fang pQTL rows are keyed by gene symbol, and the cascade join needs Ensembl
IDs; the builder refuses to build a cascade-incompatible, symbol-keyed table unless
told to. Fix: pass --plugin-arg hgnc_ht=<hgnc:lookup .ht path>; or, only for a
deliberately non-cascade use, --plugin-arg no_gene_map=true (that table will never
join an eQTL table, which is keyed by Ensembl ID).No eQTL parquet files matched (tissue=T) (gtex_v11), No eQTL TSV files matched (tissue=T) (gtex_v8), or No pQTL allpairs files matched (tissue=T) —
all three RAISE (FileNotFoundError), they do not silently build an empty table.
Cause: the tissue filter matches the filename prefix before the first dot, exactly
— a spelling or case difference, or a non-matching file sharing the same extension
in the raw directory, picks nothing. Fix: check the raw directory holds one file
per tissue of the right kind and that --plugin-arg tissue= spells the prefix
exactly as named.'join': key mismatch (the two tables' locus fields are different Hail types).
Built with the default GRCh38 instead, the join does not raise, but eQTLGen's
GRCh37 positions are now silently claimed to be GRCh38 positions — wrong loci,
no error. Either way, eQTLGen's beta/se are null regardless of which genome
build it was built with, so no row built from it is ever classed as an eQTL in
the cascade; it cannot feed the cascade or coloc at all (Preflight step 5).'JavaPackage' object is not callable building a gtex_v11 (parquet) table. Cause:
a Spark session was started before Hail initialised one of its own. Fix: build
through hvantk reprocess, never through a hand-started SparkSession — the
builder calls init_hail() before touching Spark for exactly this reason.summarize-cascade.py's digests), never the
report file's bytes, when checking reproducibility.gwas-coloc fails with a connection error. Cause: it streams FinnGen and the eQTL
Catalogue by remote tabix on every call; a compute node with no egress cannot reach
either. Fix: run it on a node with egress (references/gwas-coloc.md); there is no
local-file substitute for the GWAS side, though the eQTL side accepts a local tabix
path..tbi file appears in whatever directory gwas-coloc (or anything else
calling fetch_eqtl_region/fetch_finngen_region) was run from. Cause: pysam's
remote tabix downloads the remote file's index into the current working directory,
not a temp location. Fix: run it from a scratch directory you control, never from
the checkout.fine-mapping requires gwas_N and eqtl_N (or pass --no-fine-map). Cause:
--fine-map is the default and needs both sample sizes to run SuSiE. Fix: pass
--gwas-n/--eqtl-n, or --no-fine-map to keep only the single-variant ABF
ranking.coloc_results.tsv with an empty
(header-only) one, with no error. Cause: run's coloc stage always writes the
file once it runs at all (both allpairs tables were given), whether no cascade
gene has BOTH eQTL and pQTL evidence for the tissue -- a cascade-level
emptiness, checked before coloc runs (references/components-and-outputs.md)
-- or every candidate gene then fails the per-gene window floor. Either way, a
good previous result at that path is gone, not left in place. Fix: read the
gene count the stage logs, not just whether the file exists, to tell a real
empty result from one you did not expect.All tissues failed: <tissues>, with 'Table.aggregate': source mismatch in the
job's log. Cause: a defect in CascadePipeline._stage_coloc in hvantk 0.5.0 and
earlier (it aggregated a gene-id expression from an unfiltered table over a
different, filtered Hail source). Fix: fixed in 0.6.0; update to 0.6.0 or later --
it has nothing to do with the input data.gwas-coloc, or anything else calling
fetch_eqtl_region) looks subtly off, with more variants per gene than the
catalogue should have. Cause: in hvantk 0.5.0 and earlier, fetch_eqtl_region
kept every repeated row the eQTL Catalogue's all-variant files carry per extra
rsid (same (gene, variant), identical statistics), counting some variants twice
in the ABF sums. Fix: fixed in 0.6.0; update to 0.6.0 or later.qtlcascade run and cascade refuse to
overwrite their Hail table checkpoint by default (coloc has no such flag at
all — see the coloc-results-replacement trap above). Fix: --overwrite for
run/cascade; delete the directory for a clean coloc rerun.After a real run, for each tissue: the per-tissue directory (named for the tissue,
or all when --tissues was omitted) holds cascade.ht (with _SUCCESS, keyed
(locus, alleles, gene_id)), gene_summary.ht and gene_summary.tsv, and — when
coloc ran — coloc_results.tsv; the run directory holds qtlcascade_report.html
naming every tissue (or all) analysed. summarize-cascade.py (step 6) prints, per
tissue: the cascade class counts and the cascade table's own row count (its total,
not a derived sum), the number of cascade genes (gene_summary.tsv's row count),
how many of them have a complete cascade, how many genes were coloc-tested and how
many colocalised (H4 > 0.8, at most the tested count), the top five genes by
H4, and the sha256 of gene_summary.tsv and coloc_results.tsv (and, when asked,
the eQTL/pQTL/HGNC tables' own provenance sha256). Write the gene and colocalised
counts into the run notes as cascade_genes: <n> and colocalised: <m>, next to
commit:, container: and the job: lines — they are the receipt a later run can
be compared against.
eval/check.py (opens in a new tab)eval/control.sh (opens in a new tab)eval/reference.json (opens in a new tab)eval/stage.sh (opens in a new tab)eval/stage_qtl.py (opens in a new tab)eval/task.md (opens in a new tab)references/components-and-outputs.md (opens in a new tab)references/gwas-coloc.md (opens in a new tab)references/inputs.md (opens in a new tab)templates/summarize-cascade.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
qtl-cascade, eqtl, pqtl, colocalization, gwas-coloc, hail-tables
npx claudepluginhub bigbio/hvantk --plugin hvantk13 skills in this plugin
/ancestry-inferenceUse when samples of a cohort must be assigned a continental ancestry with hvantk: building a labelled reference MatrixTable from 1000 Genomes, running the PCA and random-forest pipeline as a Slurm job, and reading the predictions and their confidence. Also when the pipeline refuses for too few shared variants, mixed genome builds or a missing label column, or when many samples come back unassigned./callset-subset-exportUse when a sample subset of a joint callset must be delivered as a verified VCF: subsetting the lossless VDS by sample list, densifying and exporting with hvantk, verifying header samples and record counts, writing checksums and a manifest, per contig for large callsets. Also when sample names in a list do not match the callset, when per-contig VCFs refuse to concatenate, or when a delivery must go to a read-only share./cohort-attach-burdenUse when turning a case/control cohort into a gene-level table hvantk can join and rank: running the gene burden test on a cleaned MatrixTable (hvantk cohort burden), writing or checking the cohort manifest (hvantk cohort validate), and attaching the cohort's gene table to the gene index or the composed annotation matrix (hvantk cohort attach) as Slurm jobs, or attaching a gene-level table you already have. Also when attach stops with "mapped ... below the required", "duplicate row(s) for gene key", "missing declared column(s)" or "needs --hgnc", or burden rejects multi-allelic rows or an undefined case/control field./dataset-build-at-scaleUse when building one or many hvantk datasets with hvantk reprocess on a Slurm cluster from staged raw files: raw-directory conventions, staging downloads on the login node, fanning independent builds out as one array job, verifying every output against its plugin's committed schema contract, and checking upstream drift before a build. Also when a build fails with "expected exactly one file matching", "requires data you supply yourself", an HTTP error on a compute node, or an output-extension error./drift-triageUse when hvantk drift or a drift-bot pull request reports a dataset as drifted or its probe as failed: classifying the signal (routine content change, schema change, broken probe), choosing between accepting the new fingerprint and repairing the plugin, rebuilding and verifying the dataset against its committed snapshots, and recording the fingerprint, the rebuild-ledger row and the rebuild. Also when a build that used to work fails with a missing column, a key field not found, or a header marker not found./gene-indexUse when building the gene index that gene-level annotations, cohort tables and rankings join onto (hvantk annotate spine) from the Ensembl gene-structure and HGNC datasets on a Slurm cluster: staging and building the two inputs, choosing the biotype, checking the gene count and the HGNC mapping rate, writing a receipt, and adding annotation axes onto it with hvantk annotate prepare and compose. Also when the gene index comes out empty, the mapping rate is far below what you expect, or a build stops with "HGNC join changed the row count" or "needs --hgnc".