/hvantk:callset-subset-export <callset VDS> <sample list> <output directory> [--prefix NAME] [--per-contig]from hvantk
Subsets a joint callset VDS by sample list, densifies and exports as a verified VCF with checksums and manifest. Handles sample name mismatches, per-contig splitting, and delivery to read-only shares.
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. Jobs run through hpc-hail-job.
A recipient asks for some samples of a joint callset. The outcome is a directory with a
biallelic VCF of exactly those samples (<prefix>.vcf.bgz), the subset's own VDS and
MatrixTable, a SHA256SUMS file that validates, and a README.md naming the source
callset, the commit and image that produced the files, the sample list, the commands,
and the counts. The subset is taken from the lossless VDS, so it equals a fresh joint
call of those samples: allele counts and sites are recomputed for the subset, not
inherited from the full cohort.
Use it for any subset size. Not this skill: making the callset (joint-genotyping),
subsetting a cohort VCF with bcftools (that keeps the cohort's sites and stale counts),
and sharing controlled-access data, which is a human decision this skill never makes.
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" &&.hpc-hail-job (commit, digest, run notes).templates/subset-job.sh --list-samples <callset.vds> --name <run>-list;
callsets often carry suffixes or doubled identifiers that a human list lacks. Map
the requested list onto the callset's spelling and keep both lists in the
delivery; never guess a mapping.$HVANTK_WORK; the delivery target, if it is a read-only mount on
compute nodes ($HVANTK_READONLY_MOUNTS), receives a copy from the login node at the
end, never a job's direct write.templates/subset-job.sh:
source "$HVANTK_SITE_PROFILE" && bash "$HVANTK_REPO/skills/callset-subset-export/templates/subset-job.sh" \
--vds "$HVANTK_WORK/callsets/<name>/<name>.vds" --samples "$HVANTK_WORK/deliveries/<id>/samples.txt" \
--requested-samples "<original list>" \
--out "$HVANTK_WORK/deliveries/<id>" --prefix <id> --cpus 8 --mem-gb 32 --time 0-00:30:00 --name <run>-subset
The chain is: subset-vds.py (keeps the listed samples, drops alleles no listed
sample carries, refuses to overwrite, verifies the written sample set), hvantk hgc vds2mt, hvantk hgc mt2vcf (biallelic, adj-filtered, min_ac 1), then
verify-export.py, which checks the header samples against the list, counts
records, writes SHA256SUMS and the README.md. Each step waits for the previous
one and stops the chain on failure.bcftools or tabix (a module or a user install);
Hail writes no index. Record which tool, or that none was available; a .tbi added
afterwards is not in SHA256SUMS unless you append it.<out>/verify.json (references/verification.md lists the checks): the sample set, the record count and the checks, which the
README repeats for the recipient.sha256sum -c SHA256SUMS) before telling anyone it is there.templates/per-contig-subset-array.sbatch runs the
subset, densify and export for one contig per array task, with the same container
environment as a single job; a genome-wide VCF is a bcftools concat in contig
order, re-indexed and re-checksummed.--n-partitions explicitly.zcat ... | head pipeline exits 141 under set -o pipefail. Cause: SIGPIPE. Fix:
{ zcat f || true; } | head.bcftools concat --naive refuses per-contig files. Cause: headers differ, often
only by a bcftools_viewCommand line. Fix: full concat (recompresses), or make the
headers identical before the naive path.bcftools index -n cannot find the index of a .vcf.bgz. Cause: the tool expects
.vcf.gz naming. Fix: pass the index explicitly (file##idx##file.tbi)..tbi. Cause: Hail writes none. Fix: section 3 step 2.seff says the subset used far more memory than requested. Cause: accounting sums
shared pages. Fix: trust the request and the cgroup.vds2mt sorts columns; check headers before concatenating.<out>/verify.json: samples_match true, n_samples equal to the list, records
the count, biallelic true.sha256sum -c <out>/SHA256SUMS passes where the files are, and again at the
delivery target.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/verification.md (opens in a new tab)templates/per-contig-subset-array.sbatch (opens in a new tab)templates/subset-job.sh (opens in a new tab)templates/subset-vds.py (opens in a new tab)templates/verify-export.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
vcf-export, joint-callset, sample-subsetting, hail, bioinformatics
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./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.