Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Polish genome assemblies to reduce errors using short reads (Pilon), long reads (Racon), or ONT-specific tools (medaka). Essential for improving long-read assembly accuracy. Use when improving assembly accuracy with polishing tools.
.claude/skills/bio-genome-assembly-assembly-polishing/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 53% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 63% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 101% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 184% | 0% |
<!--
#
#
-->
Improve assembly accuracy by correcting errors using additional sequencing data.
| Tool | Input Reads | Best For | |------|-------------|----------| | Pilon | Illumina | Final polishing | | medaka | ONT | ONT assemblies | | Racon | Long reads | Quick polishing | | NextPolish | Both | Combined approach |
bashconda install -c bioconda pilon
bash# Map short reads to assembly bwa index assembly.fasta bwa mem -t 16 assembly.fasta R1.fq.gz R2.fq.gz | samtools sort -o aligned.bam samtools index aligned.bam # Run Pilon pilon --genome assembly.fasta --frags aligned.bam --output polished
| Option | Description | |--------|-------------| | --genome | Input assembly | | --frags | Paired-end BAM | | --output | Output prefix | | --changes | Write changes file | | --vcf | Write VCF of changes | | --fix | What to fix (snps, indels, gaps, all) | | --threads | Threads for alignment | | --mindepth | Min depth for correction |
bash#!/bin/bash ASSEMBLY=$1 R1=$2 R2=$3 ROUNDS=${4:-3} current=$ASSEMBLY for i in $(seq 1 $ROUNDS); do echo "=== Pilon round $i ===" bwa index $current bwa mem -t 16 $current $R1 $R2 | samtools sort -o round${i}.bam samtools index round${i}.bam pilon --genome $current --frags round${i}.bam --output pilon_round${i} --changes current=pilon_round${i}.fasta changes=$(wc -l < pilon_round${i}.changes) echo "Changes made: $changes" if [ $changes -eq 0 ]; then echo "No more changes, stopping" break fi done cp $current final_polished.fasta
bash# Only fix SNPs and small indels pilon --genome assembly.fa --frags aligned.bam --output polished --fix snps,indels # Only fill gaps pilon --genome assembly.fa --frags aligned.bam --output polished --fix gaps
bashconda install -c bioconda medaka
bashmedaka_consensus -i reads.fastq.gz -d assembly.fasta -o medaka_output -t 8
| Option | Description | |--------|-------------| | -i | Input reads | | -d | Draft assembly | | -o | Output directory | | -t | Threads | | -m | Model name |
bash# List available models medaka tools list_models # Use specific model (match your basecaller) medaka_consensus -i reads.fq.gz -d assembly.fa -o output -m r1041_e82_400bps_sup_v5.1.0
| Chemistry | Model | |-----------|-------| | R10.4.1 + SUP | r1041_e82_400bps_sup_ | | R10.4.1 + HAC | r1041_e82_400bps_hac_ | | R9.4.1 + SUP | r941_sup_ |
medaka_output/
├── consensus.fasta # Polished assembly
├── calls_to_draft.bam # Alignments
└── *.hdf # Intermediate filesbashconda install -c bioconda racon
bash# Map reads to assembly minimap2 -ax map-ont assembly.fasta reads.fastq.gz > aligned.sam # Polish racon -t 16 reads.fastq.gz aligned.sam assembly.fasta > polished.fasta
bash#!/bin/bash ASSEMBLY=$1 READS=$2 ROUNDS=${3:-3} current=$ASSEMBLY for i in $(seq 1 $ROUNDS); do echo "=== Racon round $i ===" minimap2 -ax map-ont $current $READS > round${i}.sam racon -t 16 $READS round${i}.sam $current > racon_round${i}.fasta current=racon_round${i}.fasta done cp $current racon_polished.fasta
| Option | Description | |--------|-------------| | -t | Threads | | -m | Match score (default: 3) | | -x | Mismatch score (default: -5) | | -g | Gap penalty (default: -4) | | -w | Window size (default: 500) |
bash#!/bin/bash set -euo pipefail ASSEMBLY=$1 # Flye assembly ONT_READS=$2 # ONT reads ILLUMINA_R1=$3 # Illumina R1 ILLUMINA_R2=$4 # Illumina R2 OUTDIR=$5 mkdir -p $OUTDIR # Step 1: Racon polishing (2 rounds) echo "=== Racon Polishing ===" current=$ASSEMBLY for i in 1 2; do minimap2 -ax map-ont $current $ONT_READS > ${OUTDIR}/racon_${i}.sam racon -t 16 $ONT_READS ${OUTDIR}/racon_${i}.sam $current > ${OUTDIR}/racon_${i}.fasta current=${OUTDIR}/racon_${i}.fasta done # Step 2: medaka polishing echo "=== medaka Polishing ===" medaka_consensus -i $ONT_READS -d $current -o ${OUTDIR}/medaka -t 8 current=${OUTDIR}/medaka/consensus.fasta # Step 3: Pilon polishing (2 rounds) echo "=== Pilon Polishing ===" for i in 1 2; do bwa index $current bwa mem -t 16 $current $ILLUMINA_R1 $ILLUMINA_R2 | samtools sort -o ${OUTDIR}/pilon_${i}.bam samtools index ${OUTDIR}/pilon_${i}.bam pilon --genome $current --frags ${OUTDIR}/pilon_${i}.bam --output ${OUTDIR}/pilon_${i} current=${OUTDIR}/pilon_${i}.fasta done cp $current ${OUTDIR}/final_polished.fasta echo "Done: ${OUTDIR}/final_polished.fasta"
bashconda install -c bioconda nextpolish
bash# Create config file cat > run.cfg << EOF [General] job_type = local job_prefix = nextPolish task = best rewrite = yes rerun = 3 parallel_jobs = 2 multithread_jobs = 8 genome = assembly.fasta genome_size = auto workdir = ./01_rundir [lgs_option] lgs_fofn = lgs.fofn lgs_options = -min_read_len 1k -max_depth 100 lgs_minimap2_options = -x map-ont [sgs_option] sgs_fofn = sgs.fofn sgs_options = -max_depth 100 EOF # File of filenames ls reads.fastq.gz > lgs.fofn ls R1.fq.gz R2.fq.gz > sgs.fofn # Run nextPolish run.cfg
After polishing, assess improvement:
bash# Compare to reference (if available) quast.py -r reference.fa original.fa polished.fa -o quast_comparison # Check error rate minimap2 -ax map-ont polished.fa reads.fq.gz | samtools stats | grep "error rate"
<!-- 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-15 | pass→pass | 21,560 | 11,380 | -47% | 1 | 1 | 0% | 3,365 | 4,398 | +31% | 0 | 0 | — |
case-16 | pass→pass | 28,435 | 12,780 | -55% | 1 | 1 | 0% | 3,229 | 4,675 | +45% | 0 | 0 | — |
case-17 | pass→pass | 4,039 | 1,220 | -70% | 1 | 1 | 0% | 634 | 2,489 | +293% | 0 | 0 | — |
case-23 | pass→pass | 10,539 | 6,190 | -41% | 1 | 1 | 0% | 1,932 | 3,490 | +81% | 0 | 0 | — |
case-01 | fail→pass | 18,865 | 17,609 | -7% | 1 | 1 | 0% | 4,236 | 6,500 | +53% | 0 | 0 | — |
case-02 | fail→pass | 17,038 | 13,000 | -24% | 1 | 1 | 0% | 2,877 | 4,692 | +63% | 0 | 0 | — |
case-03 | fail→pass | 18,264 | 14,461 | -21% | 1 | 1 | 0% | 3,222 | 4,999 | +55% | 0 | 0 | — |
case-04 | fail→pass | 13,137 | 10,513 | -20% | 1 | 1 | 0% | 2,033 | 4,086 | +101% | 0 | 0 | — |
case-05 | fail→pass | 5,184 | 2,067 | -60% | 1 | 1 | 0% | 934 | 2,653 | +184% | 0 | 0 | — |
case-06 | pass→pass | 6,888 | 4,633 | -33% | 1 | 1 | 0% | 1,229 | 3,024 | +146% | 0 | 0 | — |
case-07 | pass→pass | 6,976 | 4,739 | -32% | 1 | 1 | 0% | 1,279 | 3,259 | +155% | 0 | 0 | — |
case-08 | pass→pass | 11,064 | 8,357 | -24% | 1 | 1 | 0% | 2,256 | 4,118 | +83% | 0 | 0 | — |
case-09 | pass→pass | 9,849 | 5,002 | -49% | 1 | 1 | 0% | 2,004 | 3,292 | +64% | 0 | 0 | — |
case-10 | fail→pass | 7,120 | 4,709 | -34% | 1 | 1 | 0% | 1,377 | 3,048 | +121% | 0 | 0 | — |
case-11 | pass→pass | 3,534 | 2,273 | -36% | 1 | 1 | 0% | 644 | 2,696 | +319% | 0 | 0 | — |
case-12 | fail→pass | 4,979 | 2,821 | -43% | 1 | 1 | 0% | 1,013 | 2,872 | +184% | 0 | 0 | — |
case-13 | pass→pass | 10,173 | 8,201 | -19% | 1 | 1 | 0% | 2,025 | 3,988 | +97% | 0 | 0 | — |
case-14 | pass→pass | 9,613 | 5,538 | -42% | 1 | 1 | 0% | 1,961 | 3,350 | +71% | 0 | 0 | — |
case-18 | pass→pass | 11,317 | 5,918 | -48% | 1 | 1 | 0% | 1,950 | 3,341 | +71% | 0 | 0 | — |
case-19 | pass→pass | 4,437 | 2,068 | -53% | 1 | 1 | 0% | 676 | 2,645 | +291% | 0 | 0 | — |
case-20 | pass→pass | 6,809 | 1,916 | -72% | 1 | 1 | 0% | 1,214 | 2,644 | +118% | 0 | 0 | — |
case-21 | pass→pass | 5,472 | 5,026 | -8% | 1 | 1 | 0% | 1,001 | 3,222 | +222% | 0 | 0 | — |
case-22 | pass→pass | 10,555 | 8,588 | -19% | 1 | 1 | 0% | 2,026 | 3,964 | +96% | 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. 23 cases were attempted. The headline lift of +30 percentage points is the difference between those two pass rates over the 23 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/24/2026 | +14% |
Other measured skills in the registry, with their headline benchmark lift.