/hvantk:hpc-hail-job <hvantk subcommand and its arguments> [--cpus N --mem-gb G --time D-HH:MM:SS]from hvantk
Runs Hail-backed hvantk commands (reprocess, hgc, annotate, cohort, qtlcascade) as single-node Slurm jobs with node-local scratch, job submission, triaging, and output verification.
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.
One hvantk command, one Slurm job, one node, Hail in Spark local mode inside the
container image. The outcome is the command's output (for a dataset build, a Hail table
or matrix table directory plus its .provenance.json sidecar), the job log under the
log directory, and a line in your run notes with the commit, the image digest and the
job id.
Use it for every Hail-backed command: reprocess, hgc, annotate, cohort,
qtlcascade, utils check-install. Use it for small commands too. Nothing runs on the
login node except git, file inspection, downloads and job submission, and the small
commands templates/run-in-image.sh runs inside the image there (downloads, drift
probes, bookkeeping, a verification of a few seconds).
Not this skill: building the image (hvantk:hpc-container), multi-node Spark (section 4
says when, and that it is rarely worth it), commands with no Hail in them (they still
run fine through the same template, with a small request).
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/_site/check-site-profile.sh".
If it reports a missing value, stop and ask the user for it. One tool call's
environment does not survive into the next, so every later command that reads a
profile value starts with the same source "$HVANTK_SITE_PROFILE" &&. Never guess a partition, a path or an image. Values such as
HVANTK_SCRATCH_ROOT and HVANTK_BIND are set in that file, not exported in your
shell: the job sources the profile and an export is overwritten.git -C "$HVANTK_REPO" rev-parse HEAD and git -C "$HVANTK_REPO" status --porcelain.
Compare with the commit the user expects. A clone that is behind runs old code with
no error of any kind; if it is behind, say so before submitting anything. The job
runs the checkout's code inside the image's environment (the template exports
PYTHONPATH), so the commit decides what runs; the image only has to carry the
dependencies, and needs rebuilding only when the lock file or the package's entry
points change.readlink -f "$HVANTK_SIF" (the configured path is often a symlink to a
versioned image) and its digest, computed from the resolved file:
sha256sum "$(readlink -f "$HVANTK_SIF")" (about ten seconds). If the profile
carries HVANTK_SIF_SHA256, treat it as a cache that must match this value, not as
the truth. Record both.$HVANTK_WORK or another path that is writable from compute nodes.
Never write under the home directory (quota) and never under a path listed in
$HVANTK_READONLY_MOUNTS. Pass absolute paths: the job's working directory is the
log directory, not the checkout.$HVANTK_EGRESS is blocked or unset, treat compute nodes as offline.
Downloads happen on the login node first, through the image -- in practice via
templates/run-in-image.sh, which wraps the same exec call the template itself
runs below -- and the build then runs with --skip-download --no-check-drift:
"${HVANTK_CONTAINER_BIN:-singularity}" exec -B "$HVANTK_WORK:$HVANTK_WORK" \
-B "$HVANTK_REPO:$HVANTK_REPO" --env PYTHONPATH="$HVANTK_REPO" "$HVANTK_SIF" \
hvantk download <source> --help # each source has its own output option; put raw files under "$HVANTK_WORK/raw/<source>/"
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" --name <run>-check --cpus 4 --mem-gb 16 --time 0-00:20:00 --wait -- hvantk utils check-install
must print the Hail version and pass its smoke test.references/sizing.md. Starting points: a gene-level table
4 cores, 16 GB, 30 minutes; a variant-level table 16 cores, 120 GB, 4 hours; joint
genotyping the whole node, exclusive, 12 hours. On the CPU partition the submit
script refuses more than $HVANTK_NODE_CPUS cores or $HVANTK_NODE_MEM_GB GB.--dry-run runs sbatch --test-only
and prints the resolved request without submitting.
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" --name <run>-<what> \
--cpus 4 --mem-gb 16 --time 0-00:30:00 --dry-run -- \
hvantk reprocess gencc:submissions --raw-dir "$HVANTK_WORK/raw/gencc" \
--output "$HVANTK_WORK/out/gencc.ht" --skip-download --no-check-drift
--dry-run. The script prints the job id; write job: <id> into your
run notes at once, with commit: and container: from the preflight. Name every
job with your run's prefix, so accounting can be filtered by it later.--wait on the submit script polls
accounting until the job reaches a terminal state and exits non-zero unless that
state is COMPLETED. A foreground wait outlives most tool timeouts, so run it in
the background and poll:
nohup bash -c 'source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" --name <run>-<what> ... --wait -- ...' > <run>-<what>.submit.log 2>&1 &
squeue -j <id> -o "%i %j %T %M %L %R" # while it runs
sacct -j <id> -X -o JobID,JobName%30,State,ExitCode,Elapsed,ReqMem,AllocCPUS # when it is gone
${HVANTK_LOG_DIR:-$HVANTK_WORK/hvantk-logs}/<name>_<id>.out;
Hail's own hail-<timestamp>.log sits next to it. A job that failed goes to
references/triage.md; fix the request or the input and resubmit under a new name.
Do not rerun on the login node "to see the error faster".The template templates/hail-job.sbatch sets up node-local scratch, binds it, the
work root and the checkout into the container, caps Spark at the allocation, exports
PYTHONPATH so the checkout's code runs, passes the checkout's commit as
HVANTK_BUILDER_COMMIT (the image has no git) so a dataset it builds records that
commit, and runs the command inside the image from the log directory.
containers/hvantk_run.sh is not its interactive equivalent: it sets no PYTHONPATH,
does not bind the work root, and hardcodes singularity, so it runs the image's own
installed copy, not the checkout. For an interactive shell, use
templates/run-in-image.sh inside srun --pty instead.
--partition "${HVANTK_FAT_PARTITION:-$HVANTK_CPU_PARTITION}" --exclusive --cpus <its cores> --mem-gb <its memory>.
The template keeps the Spark driver at 80 percent of the request so the kernel's
memory cgroup does not kill it.df -h "$SLURM_TMPDIR" inside a job, or the scratch: line of the job banner); a
variant-scale build can spill hundreds of GB. If the node has no local scratch, set
HVANTK_SCRATCH_ROOT in the site profile to the fastest filesystem you have, never
to home.tar when moving.sbatch --array=1-N%K with one line of the list per task
(hvantk:dataset-build-at-scale).--sif <image>
on the submit script; the job template honours it, where a shell export of
HVANTK_SIF would be overwritten when the job sources the profile.HVANTK_SKIP_HAIL_INIT makes hvantk adopt an existing session) and almost never
worth it: both the scheduler and Spark must agree on resources, and the failure modes
are opaque. Stay on one fat node until the working set does not fit.[Errno 111] Connection refused at Hail start inside the container. Cause: Spark has
no writable node-local scratch, and the real message, DiskBlockManager: Failed to create any local dir, is one line up. Fix: run through the template or the wrapper;
they set SPARK_LOCAL_DIRS.sacct says OUT_OF_MEMORY or the log just
stops. Cause: the Spark driver was allowed the whole request and the cgroup killed
it. Fix: the template caps the driver at 80 percent; if you set it yourself, keep it
there and raise --mem-gb instead.Executor heartbeat timed out on a shared node. Cause: Spark took every core on the
node, not the allocation. Fix: the template pins local[<cpus>]; do not override it
with local[*] unless the job is --exclusive.UnsupportedClassVersionError.
Cause: a host Java module leaked into the environment. Fix: never module load
anything around the container; the image carries Java 11.seff or MaxRSS reports far more memory than requested for a job that completed.
Cause: some accounting plugins sum per-process RSS including shared pages. Fix:
trust the request and the cgroup; size from failures, not from MaxRSS.hvantk reprocess fails inside the job with a download or HTTP error. Cause: the
compute node has no internet. Fix: stage the raw file on the login node, then
--skip-download --no-check-drift.$HVANTK_WORK; copy into the read-only tree from the login node afterwards.No such file or directory on a relative path that exists in the checkout. Cause:
the job's working directory is the log directory. Fix: absolute paths in the
command.zcat f | head exits 141 under set -o pipefail. Cause:
SIGPIPE when the reader closes early. Fix: { zcat f || true; } | head.AF=0,25). Cause: the JVM took a locale with a
comma decimal separator. Fix: the template exports JAVA_TOOL_OPTIONS with an
English locale; keep it when you run the container by hand.PENDING for hours. Cause: the partition's queue, not your job. Fix:
squeue -p "$HVANTK_CPU_PARTITION" --start -j <id> for the estimate; many sites have a
short-job partition for anything under two hours, and its name is a site value: ask,
do not guess.HVANTK_BIND
in the site profile takes a comma-separated list (a shell export is overwritten when
the job sources the profile).--mail-user in a #SBATCH line. Cause: Slurm does not expand variables in
directives, so people write the address in. Fix: the submit script passes
$SLURM_EMAIL_NOTIFICATION on the command line when it is set; never write an
address into a script.hvantk:hpc-sync
brings the clone forward.hvantk: command not found, or a command that silently wrote into the wrong
checkout. Cause and fix: see workflow-conventions's Runtime rules (section 4) --
route every command through run-in-image.sh or submit-hail-job.sh, never bare
hvantk or python -m hvantk.sacct -j <id> -X -n -o State prints COMPLETED._SUCCESS, and the
sidecar <output>.provenance.json exists and names the schema_id you expected.source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/hpc-hail-job/templates/submit-hail-job.sh" --name <run>-describe \
--cpus 2 --mem-gb 8 --time 0-00:15:00 --wait -- \
python "$HVANTK_REPO/skills/hpc-hail-job/templates/hail-describe.py" \
"$HVANTK_WORK/out/gencc.ht" --receipt "$HVANTK_WORK/out/gencc.receipt.json"
The log shows the key, the row count and the fields; the receipt carries the row
count, the key and the SHA-256 of the provenance sidecar, so a verdict about this
output is tied to exactly this output.commit:, container: and every job: line in the run notes next to the
output. A result without them cannot be reproduced.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/task.md (opens in a new tab)references/sizing.md (opens in a new tab)references/triage.md (opens in a new tab)templates/hail-describe.py (opens in a new tab)templates/hail-job.sbatch (opens in a new tab)templates/run-in-image.sh (opens in a new tab)templates/submit-hail-job.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
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".