Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Call SNPs and indels from aligned reads using bcftools mpileup and call. Use when detecting variants from BAM files or generating VCF from alignments.
.claude/skills/bio-variant-calling/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-20 | ✗→✓ | ▲ Improved | — | — |
| case-13 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✗ | = Same ✗ | — | — |
| case-03 | ✗→✗ | = Same ✗ | — | — |
| case-21 | ✗→✗ | = Same ✗ | — | — |
Reference examples tested with: bcftools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Call SNPs and indels from aligned reads using bcftools.
BAM file + Reference FASTA
|
v
bcftools mpileup (generate pileup)
|
v
bcftools call (call variants)
|
v
VCF fileGoal: Detect SNPs and indels from aligned reads using the bcftools pileup-and-call pipeline.
Approach: Generate per-position pileup likelihoods with mpileup, then call genotypes with the multiallelic caller.
"Call variants from my BAM file" → Generate genotype likelihoods from aligned reads and identify variant sites using a Bayesian caller.
bashbcftools mpileup -f reference.fa input.bam | bcftools call -mv -o variants.vcf
bashbcftools mpileup -f reference.fa input.bam | bcftools call -mv -Oz -o variants.vcf.gz bcftools index variants.vcf.gz
bashbcftools mpileup -f reference.fa -r chr1:1000000-2000000 input.bam | \ bcftools call -mv -o region.vcf
bashbcftools mpileup -f reference.fa sample1.bam sample2.bam sample3.bam | \ bcftools call -mv -o variants.vcf
bash# bams.txt: one BAM path per line bcftools mpileup -f reference.fa -b bams.txt | bcftools call -mv -o variants.vcf
Goal: Control pileup generation with quality thresholds, annotations, and region restrictions.
Approach: Set minimum mapping/base quality, request specific FORMAT/INFO tags, and restrict to target regions.
bashbcftools mpileup -f reference.fa \ -q 20 \ # Min mapping quality -Q 20 \ # Min base quality input.bam | bcftools call -mv -o variants.vcf
bashbcftools mpileup -f reference.fa -a DP,AD input.bam | bcftools call -mv -o variants.vcf
bashbcftools mpileup -f reference.fa \ -a FORMAT/DP,FORMAT/AD,FORMAT/ADF,FORMAT/ADR,INFO/AD \ input.bam | bcftools call -mv -o variants.vcf
bashbcftools mpileup -f reference.fa -R targets.bed input.bam | \ bcftools call -mv -o variants.vcf
bashbcftools mpileup -f reference.fa -d 1000 input.bam | bcftools call -mv -o variants.vcf
| Flag | Model | Use Case | |------|-------|----------| | -m | Multiallelic caller | Default, recommended | | -c | Consensus caller | Legacy, single sample |
bashbcftools mpileup -f reference.fa input.bam | bcftools call -mv -o variants.vcf # -v outputs variant sites only (not reference calls)
bashbcftools mpileup -f reference.fa input.bam | bcftools call -m -o all_sites.vcf # Without -v, outputs all sites including reference
bash# Haploid calling bcftools mpileup -f reference.fa input.bam | bcftools call -m --ploidy 1 -o variants.vcf # Specify ploidy file bcftools mpileup -f reference.fa input.bam | bcftools call -m --ploidy-file ploidy.txt -o variants.vcf
bash# Adjust variant prior (default 1.1e-3) bcftools mpileup -f reference.fa input.bam | bcftools call -m -P 0.001 -o variants.vcf
Goal: Run production-ready variant calling workflows for single-sample and multi-sample analyses.
Approach: Chain mpileup and call with quality filters, annotations, and compressed output, optionally parallelized by chromosome.
bashbcftools mpileup -Ou -f reference.fa \ -q 20 -Q 20 \ -a FORMAT/DP,FORMAT/AD \ input.bam | \ bcftools call -mv -Oz -o variants.vcf.gz bcftools index variants.vcf.gz
bashbcftools mpileup -Ou -f reference.fa \ -a FORMAT/DP,FORMAT/AD \ sample1.bam sample2.bam sample3.bam | \ bcftools call -mv -Oz -o cohort.vcf.gz bcftools index cohort.vcf.gz
bashbcftools mpileup -Ou -f reference.fa \ -R targets.bed \ -a FORMAT/DP,FORMAT/AD \ input.bam | \ bcftools call -mv -Oz -o targets.vcf.gz
bashfor chr in chr1 chr2 chr3; do bcftools mpileup -Ou -f reference.fa -r "$chr" input.bam | \ bcftools call -mv -Oz -o "${chr}.vcf.gz" & done wait # Concatenate results bcftools concat -Oz -o all.vcf.gz chr*.vcf.gz bcftools index all.vcf.gz
| Tag | Description | |-----|-------------| | DP | Total read depth | | AD | Allelic depths | | MQ | Mapping quality | | FS | Fisher strand bias | | SGB | Segregation based metric |
| Tag | Description | |-----|-------------| | GT | Genotype | | DP | Read depth per sample | | AD | Allelic depths per sample | | ADF | Forward strand allelic depths | | ADR | Reverse strand allelic depths | | GQ | Genotype quality | | PL | Phred-scaled likelihoods |
bashbcftools mpileup -f reference.fa \ -a FORMAT/DP,FORMAT/AD,FORMAT/SP,INFO/AD \ input.bam | bcftools call -mv -o variants.vcf
Goal: Speed up variant calling for large datasets.
Approach: Use multi-threading and uncompressed BCF piping to reduce I/O overhead.
bashbcftools mpileup -f reference.fa --threads 4 input.bam | \ bcftools call -mv --threads 4 -o variants.vcf
bashbcftools mpileup -Ou -f reference.fa input.bam | bcftools call -mv -Ou | \ bcftools filter -Oz -o filtered.vcf.gz
| Task | Command | |------|---------| | Basic calling | bcftools mpileup -f ref.fa in.bam \| bcftools call -mv -o out.vcf | | With quality filter | bcftools mpileup -f ref.fa -q 20 -Q 20 in.bam \| bcftools call -mv | | Region | bcftools mpileup -f ref.fa -r chr1:1-1000 in.bam \| bcftools call -mv | | Multi-sample | bcftools mpileup -f ref.fa s1.bam s2.bam \| bcftools call -mv | | With annotations | bcftools mpileup -f ref.fa -a DP,AD in.bam \| bcftools call -mv |
| Error | Cause | Solution | |-------|-------|----------| | no FASTA reference | Missing -f | Add -f reference.fa | | reference mismatch | Wrong reference | Use same reference as alignment | | no variants called | Low quality/depth | Lower quality thresholds |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.