Install any skill in seconds. Free to start, no credit card required.
Get Started Free →End-to-end DNA sequencing workflow from FASTQ files to variant calls. Covers QC, alignment with BWA, BAM processing, and variant calling with bcftools or GATK HaplotypeCaller. Use when calling variants from raw sequencing reads.
.claude/skills/bio-workflows-fastq-to-variants/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 133% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 253% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 233% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 207% | 0% |
| case-07 | ✓→✓ | = Same ✓ | 141% | 0% |
<!--
#
#
-->
Complete pipeline from raw DNA sequencing FASTQ files to filtered variant calls.
FASTQ files
|
v
[1. QC & Trimming] -----> fastp
|
v
[2. Alignment] ---------> bwa-mem2
|
v
[3. BAM Processing] ----> sort, markdup, index
|
v
[4. Variant Calling] ---> bcftools (primary) or GATK
|
v
[5. Filtering] ---------> Quality filters
|
v
Filtered VCFbash# Single sample fastp -i sample_R1.fastq.gz -I sample_R2.fastq.gz \ -o sample_R1.trimmed.fq.gz -O sample_R2.trimmed.fq.gz \ --detect_adapter_for_pe \ --qualified_quality_phred 20 \ --length_required 50 \ --html sample_fastp.html # Batch processing for sample in sample1 sample2 sample3; do fastp -i ${sample}_R1.fastq.gz -I ${sample}_R2.fastq.gz \ -o trimmed/${sample}_R1.fq.gz -O trimmed/${sample}_R2.fq.gz \ --detect_adapter_for_pe \ --html qc/${sample}_fastp.html done
QC Checkpoint 1: Check fastp reports
bash# Index reference (once) bwa-mem2 index reference.fa # Align with read group info for sample in sample1 sample2 sample3; do bwa-mem2 mem -t 8 \ -R "@RG\tID:${sample}\tSM:${sample}\tPL:ILLUMINA\tLB:lib1" \ reference.fa \ trimmed/${sample}_R1.fq.gz \ trimmed/${sample}_R2.fq.gz \ | samtools view -bS - > aligned/${sample}.bam done
QC Checkpoint 2: Check alignment stats
bashsamtools flagstat aligned/${sample}.bam
bashfor sample in sample1 sample2 sample3; do # Sort by coordinate samtools sort -@ 8 -o aligned/${sample}.sorted.bam aligned/${sample}.bam # Mark duplicates (samtools method) samtools fixmate -m aligned/${sample}.sorted.bam - | \ samtools sort -@ 8 - | \ samtools markdup -@ 8 - aligned/${sample}.markdup.bam # Index samtools index aligned/${sample}.markdup.bam # Cleanup intermediate rm aligned/${sample}.bam aligned/${sample}.sorted.bam done
QC Checkpoint 3: Check duplication rate
bashsamtools flagstat aligned/${sample}.markdup.bam | grep "duplicates"
bash# Single sample calling bcftools mpileup -Ou -f reference.fa aligned/sample1.markdup.bam | \ bcftools call -mv -Oz -o variants/sample1.vcf.gz # Multi-sample calling (joint calling) bcftools mpileup -Ou -f reference.fa \ aligned/sample1.markdup.bam \ aligned/sample2.markdup.bam \ aligned/sample3.markdup.bam | \ bcftools call -mv -Oz -o variants/cohort.vcf.gz bcftools index variants/cohort.vcf.gz
bash# Basic quality filter bcftools filter -Oz \ -e 'QUAL<20 || DP<10 || MQ<30' \ -o variants/cohort.filtered.vcf.gz \ variants/cohort.vcf.gz # More stringent filter bcftools filter -Oz \ -e 'QUAL<30 || DP<10 || DP>200 || MQ<40 || MQB<0.1' \ -s "LowQual" \ -o variants/cohort.filtered.vcf.gz \ variants/cohort.vcf.gz # Stats bcftools stats variants/cohort.filtered.vcf.gz > variants/vcf_stats.txt
QC Checkpoint 4: Check variant stats
bash# Create sequence dictionary (once) gatk CreateSequenceDictionary -R reference.fa # Index reference (once) samtools faidx reference.fa # Base Quality Score Recalibration (BQSR) gatk BaseRecalibrator \ -R reference.fa \ -I aligned/sample1.markdup.bam \ --known-sites dbsnp.vcf.gz \ -O recal_data.table gatk ApplyBQSR \ -R reference.fa \ -I aligned/sample1.markdup.bam \ --bqsr-recal-file recal_data.table \ -O aligned/sample1.recal.bam # HaplotypeCaller (per-sample GVCF mode) gatk HaplotypeCaller \ -R reference.fa \ -I aligned/sample1.recal.bam \ -O variants/sample1.g.vcf.gz \ -ERC GVCF # Joint genotyping (for multiple samples) gatk GenomicsDBImport \ -V variants/sample1.g.vcf.gz \ -V variants/sample2.g.vcf.gz \ -V variants/sample3.g.vcf.gz \ --genomicsdb-workspace-path genomicsdb \ -L intervals.bed gatk GenotypeGVCFs \ -R reference.fa \ -V gendb://genomicsdb \ -O variants/cohort.vcf.gz
bash# Hard filtering (for small cohorts) gatk VariantFiltration \ -R reference.fa \ -V variants/cohort.vcf.gz \ --filter-expression "QD < 2.0" --filter-name "LowQD" \ --filter-expression "FS > 60.0" --filter-name "HighFS" \ --filter-expression "MQ < 40.0" --filter-name "LowMQ" \ --filter-expression "MQRankSum < -12.5" --filter-name "LowMQRS" \ --filter-expression "ReadPosRankSum < -8.0" --filter-name "LowRPRS" \ -O variants/cohort.filtered.vcf.gz # VQSR (for large cohorts >30 samples) gatk VariantRecalibrator \ -R reference.fa \ -V variants/cohort.vcf.gz \ --resource:hapmap,known=false,training=true,truth=true,prior=15.0 hapmap.vcf.gz \ --resource:omni,known=false,training=true,truth=false,prior=12.0 omni.vcf.gz \ --resource:1000G,known=false,training=true,truth=false,prior=10.0 1000G.vcf.gz \ --resource:dbsnp,known=true,training=false,truth=false,prior=2.0 dbsnp.vcf.gz \ -an QD -an MQ -an MQRankSum -an ReadPosRankSum -an FS -an SOR \ -mode SNP \ -O cohort.snp.recal \ --tranches-file cohort.snp.tranches gatk ApplyVQSR \ -R reference.fa \ -V variants/cohort.vcf.gz \ -O variants/cohort.vqsr.vcf.gz \ --recal-file cohort.snp.recal \ --tranches-file cohort.snp.tranches \ -mode SNP \ --truth-sensitivity-filter-level 99.5
| Step | Parameter | WGS | Exome/Targeted | |------|-----------|-----|----------------| | bwa-mem2 | -t | 8-16 | 8 | | samtools markdup | - | Required | Required | | bcftools mpileup | -d | 250 (default) | 1000 | | bcftools mpileup | -q | 20 | 20 | | bcftools filter | QUAL | >20 | >30 | | bcftools filter | DP | >10, <2x mean | >20 | | GATK | intervals | - | Target BED |
| Criterion | bcftools | GATK | |-----------|----------|------| | Speed | Faster | Slower | | Memory | Lower | Higher | | Best for | Germline SNPs/indels | Germline, somatic | | Cohort size | Any | Scales well | | BQSR | Not supported | Recommended | | VQSR | Not supported | For large cohorts |
| Issue | Likely Cause | Solution | |-------|--------------|----------| | Low mapping rate | Wrong reference, contamination | Verify reference genome version | | High duplication | PCR over-amplification, low input | Check library prep, may need more input DNA | | Low Ti/Tv | False positives | Increase quality filters | | Missing variants | Too stringent filters, low depth | Relax filters, check coverage | | Many indels at homopolymers | Sequencing errors | Filter homopolymer regions |
bash#!/bin/bash set -e # Configuration THREADS=8 REF="reference.fa" SAMPLES="sample1 sample2 sample3" OUTDIR="results" mkdir -p ${OUTDIR}/{trimmed,aligned,variants,qc} echo "=== Step 1: QC with fastp ===" for sample in $SAMPLES; do fastp -i ${sample}_R1.fastq.gz -I ${sample}_R2.fastq.gz \ -o ${OUTDIR}/trimmed/${sample}_R1.fq.gz \ -O ${OUTDIR}/trimmed/${sample}_R2.fq.gz \ --detect_adapter_for_pe \ --html ${OUTDIR}/qc/${sample}_fastp.html \ -w ${THREADS} done echo "=== Step 2: Alignment with bwa-mem2 ===" for sample in $SAMPLES; do bwa-mem2 mem -t ${THREADS} \ -R "@RG\tID:${sample}\tSM:${sample}\tPL:ILLUMINA" \ ${REF} \ ${OUTDIR}/trimmed/${sample}_R1.fq.gz \ ${OUTDIR}/trimmed/${sample}_R2.fq.gz | \ samtools view -@ ${THREADS} -bS - > ${OUTDIR}/aligned/${sample}.bam done echo "=== Step 3: BAM Processing ===" for sample in $SAMPLES; do samtools fixmate -@ ${THREADS} -m ${OUTDIR}/aligned/${sample}.bam - | \ samtools sort -@ ${THREADS} - | \ samtools markdup -@ ${THREADS} - ${OUTDIR}/aligned/${sample}.markdup.bam samtools index ${OUTDIR}/aligned/${sample}.markdup.bam rm ${OUTDIR}/aligned/${sample}.bam done echo "=== Step 4: Joint Variant Calling ===" bcftools mpileup -Ou -f ${REF} ${OUTDIR}/aligned/*.markdup.bam | \ bcftools call -mv -Oz -o ${OUTDIR}/variants/cohort.vcf.gz bcftools index ${OUTDIR}/variants/cohort.vcf.gz echo "=== Step 5: Filtering ===" bcftools filter -Oz \ -e 'QUAL<20 || DP<10 || MQ<30' \ -o ${OUTDIR}/variants/cohort.filtered.vcf.gz \ ${OUTDIR}/variants/cohort.vcf.gz bcftools index ${OUTDIR}/variants/cohort.filtered.vcf.gz echo "=== Stats ===" bcftools stats ${OUTDIR}/variants/cohort.filtered.vcf.gz > ${OUTDIR}/variants/stats.txt echo "=== Pipeline Complete ===" echo "Filtered VCF: ${OUTDIR}/variants/cohort.filtered.vcf.gz"
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 15,891 | 26,117 | +64% | 1 | 1 | 0% | 3,540 | 6,343 | +79% | 0 | 0 | — |
case-02 | fail→fail | 19,062 | 14,637 | -23% | 1 | 1 | 0% | 3,992 | 6,839 | +71% | 0 | 0 | — |
case-07 | pass→pass | 9,186 | 5,432 | -41% | 1 | 1 | 0% | 1,913 | 4,603 | +141% | 0 | 0 | — |
case-16 | pass→pass | 12,521 | 8,455 | -32% | 1 | 1 | 0% | 2,187 | 4,927 | +125% | 0 | 0 | — |
case-17 | pass→pass | 17,953 | 12,807 | -29% | 1 | 1 | 0% | 3,071 | 5,498 | +79% | 0 | 0 | — |
case-03 | fail→pass | 9,563 | 5,232 | -45% | 1 | 1 | 0% | 1,943 | 4,531 | +133% | 0 | 0 | — |
case-04 | fail→fail | 8,231 | 5,837 | -29% | 1 | 1 | 0% | 1,604 | 4,624 | +188% | 0 | 0 | — |
case-05 | pass→pass | 9,669 | 9,746 | +1% | 1 | 1 | 0% | 1,959 | 5,224 | +167% | 0 | 0 | — |
case-06 | pass→pass | 5,678 | 4,386 | -23% | 1 | 1 | 0% | 1,174 | 4,330 | +269% | 0 | 0 | — |
case-08 | pass→pass | 8,336 | 5,693 | -32% | 1 | 1 | 0% | 1,614 | 4,570 | +183% | 0 | 0 | — |
case-09 | fail→pass | 5,859 | 4,906 | -16% | 1 | 1 | 0% | 1,267 | 4,467 | +253% | 0 | 0 | — |
case-10 | fail→pass | 7,311 | 5,982 | -18% | 1 | 1 | 0% | 1,394 | 4,639 | +233% | 0 | 0 | — |
case-11 | fail→pass | 7,507 | 4,571 | -39% | 1 | 1 | 0% | 1,367 | 4,202 | +207% | 0 | 0 | — |
case-12 | pass→pass | 12,996 | 9,263 | -29% | 1 | 1 | 0% | 2,388 | 5,081 | +113% | 0 | 0 | — |
case-13 | pass→pass | 11,523 | 8,095 | -30% | 1 | 1 | 0% | 2,061 | 4,743 | +130% | 0 | 0 | — |
case-14 | pass→pass | 12,380 | 2,568 | -79% | 1 | 1 | 0% | 2,194 | 3,791 | +73% | 0 | 0 | — |
case-15 | pass→pass | 7,676 | 6,521 | -15% | 1 | 1 | 0% | 1,453 | 4,601 | +217% | 0 | 0 | — |
case-18 | pass→pass | 2,883 | 1,956 | -32% | 1 | 1 | 0% | 515 | 3,727 | +624% | 0 | 0 | — |
case-19 | pass→pass | 6,135 | 3,630 | -41% | 1 | 1 | 0% | 1,073 | 4,034 | +276% | 0 | 0 | — |
case-20 | pass→pass | 23,199 | 12,859 | -45% | 1 | 1 | 0% | 3,046 | 6,170 | +103% | 0 | 0 | — |
case-21 | pass→pass | 15,797 | 15,443 | -2% | 1 | 1 | 0% | 3,202 | 6,757 | +111% | 0 | 0 | — |
case-22 | pass→pass | 14,269 | 12,758 | -11% | 1 | 1 | 0% | 2,745 | 5,983 | +118% | 0 | 0 | — |
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 +18 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/26/2026 | +14% |
Other measured skills in the registry, with their headline benchmark lift.