Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Detect contamination and assess genome quality using CheckM, CheckM2, GTDB-Tk, and GUNC for metagenome-assembled genomes and isolate assemblies. Use when checking assemblies for contamination.
.claude/skills/bio-genome-assembly-contamination-detection/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 70% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 164% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 29% | 0% |
<!--
#
#
-->
bash# Run CheckM2 on single genome checkm2 predict --input assembly.fa --output-directory checkm2_output --threads 16 # Run on multiple genomes (directory of FASTAs) checkm2 predict --input genomes/ --output-directory checkm2_output \ --threads 16 --extension fa # Output: quality_report.tsv with Completeness, Contamination, Coding_Density
bash# quality_report.tsv columns: # Name, Completeness, Contamination, Completeness_Model_Used, # Translation_Table_Used, Coding_Density, Contig_N50, Average_Gene_Length, # Genome_Size, GC_Content, Total_Coding_Sequences # Filter high-quality genomes (MIMAG standards) awk -F'\t' 'NR==1 || ($2 > 90 && $3 < 5)' quality_report.tsv > high_quality_mags.tsv # Medium quality awk -F'\t' 'NR==1 || ($2 >= 50 && $3 < 10)' quality_report.tsv > medium_quality_mags.tsv
bash# Run CheckM lineage workflow checkm lineage_wf -t 16 -x fa genomes/ checkm_output/ # Generate summary checkm qa checkm_output/lineage.ms checkm_output/ -o 2 -f checkm_summary.tsv --tab_table # Extended report with marker genes checkm qa checkm_output/lineage.ms checkm_output/ -o 2 --tab_table \ -f checkm_extended.tsv
bash# Completeness vs Contamination plot checkm bin_qa_plot -x fa checkm_output/ genomes/ plots/ # GC and coding density checkm coding_plot -x fa checkm_output/ genomes/ plots/ # Marker gene positions checkm marker_plot -x fa checkm_output/ genomes/ plots/
bash# Classify genomes gtdbtk classify_wf --genome_dir genomes/ --out_dir gtdbtk_output \ --extension fa --cpus 16 # With species-level ANI gtdbtk classify_wf --genome_dir genomes/ --out_dir gtdbtk_output \ --extension fa --cpus 16 --skip_ani_screen # Output files: # gtdbtk.bac120.summary.tsv - bacterial classifications # gtdbtk.ar53.summary.tsv - archaeal classifications
bash# When genomes may include novel taxa gtdbtk de_novo_wf --genome_dir genomes/ --out_dir gtdbtk_denovo \ --bacteria --extension fa --cpus 16
bash# Run GUNC gunc run -d genomes/ -o gunc_output -t 16 -e .fa # Output: GUNC.progenomes_2.1.maxCSS_level.tsv # Key columns: pass.GUNC (true/false), contamination_portion, clade_separation_score # Filter chimeric genomes awk -F'\t' '$8 == "False"' GUNC.progenomes_2.1.maxCSS_level.tsv > chimeric_genomes.tsv
bash# GUNC flags genomes as chimeric if: # - clade_separation_score (CSS) > 0.45 # - contamination_portion > 0.05 # - reference_representation_score > 0.5 # Combine with CheckM2 for full QC join -t$'\t' -1 1 -2 1 \ <(sort checkm2_output/quality_report.tsv) \ <(sort gunc_output/GUNC.progenomes_2.1.maxCSS_level.tsv) \ > combined_qc.tsv
bash#!/bin/bash GENOMES_DIR=$1 OUTPUT_DIR=$2 THREADS=${3:-16} mkdir -p "$OUTPUT_DIR" # Run CheckM2 echo "Running CheckM2..." checkm2 predict --input "$GENOMES_DIR" --output-directory "$OUTPUT_DIR/checkm2" \ --threads "$THREADS" --extension fa # Run GUNC echo "Running GUNC..." gunc run -d "$GENOMES_DIR" -o "$OUTPUT_DIR/gunc" -t "$THREADS" -e .fa # Run GTDB-Tk echo "Running GTDB-Tk..." gtdbtk classify_wf --genome_dir "$GENOMES_DIR" --out_dir "$OUTPUT_DIR/gtdbtk" \ --extension fa --cpus "$THREADS" echo "QC complete!"
pythonimport pandas as pd checkm = pd.read_csv('checkm2_output/quality_report.tsv', sep='\t') gunc = pd.read_csv('gunc_output/GUNC.progenomes_2.1.maxCSS_level.tsv', sep='\t') merged = checkm.merge(gunc, left_on='Name', right_on='genome', how='left') # MIMAG High Quality: >90% complete, <5% contamination, not chimeric hq = merged[(merged['Completeness'] > 90) & (merged['Contamination'] < 5) & (merged['pass.GUNC'] == True)] # MIMAG Medium Quality: >50% complete, <10% contamination mq = merged[(merged['Completeness'] >= 50) & (merged['Contamination'] < 10)] hq.to_csv('high_quality_genomes.tsv', sep='\t', index=False) mq.to_csv('medium_quality_genomes.tsv', sep='\t', index=False)
bash# Use MAGpurify to remove contaminating contigs magpurify phylo-markers genome.fa magpurify_output magpurify clade-markers genome.fa magpurify_output magpurify conspecific genome.fa magpurify_output magpurify tetra-freq genome.fa magpurify_output magpurify gc-content genome.fa magpurify_output magpurify known-contam genome.fa magpurify_output magpurify clean-bin genome.fa magpurify_output cleaned_genome.fa
bash# Contig-level taxonomy with CAT CAT contigs -c assembly.fa -d CAT_database -t CAT_taxonomy \ -o cat_output -n 16 # Parse results CAT add_names -i cat_output.contig2classification.txt \ -o cat_output.contig2classification.named.txt \ -t CAT_taxonomy --only_official # Flag contigs with different taxonomy than majority awk -F'\t' '{print $1, $NF}' cat_output.contig2classification.named.txt | \ sort | uniq -c | sort -rn
bash# Create BlobDB blobtools create -i assembly.fa -b aligned.bam -t blast_hits.txt \ -o blobtools_output # Generate plots blobtools plot -i blobtools_output.blobDB.json # Filter by taxonomy blobtools view -i blobtools_output.blobDB.json -r all -o filtered
<!-- 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-11 | pass→pass | 8,046 | 2,890 | -64% | 1 | 1 | 0% | 1,083 | 2,350 | +117% | 0 | 0 | — |
case-01 | fail→pass | 15,892 | 12,020 | -24% | 1 | 1 | 0% | 3,534 | 4,668 | +32% | 0 | 0 | — |
case-02 | fail→pass | 10,767 | 8,187 | -24% | 1 | 1 | 0% | 2,186 | 3,712 | +70% | 0 | 0 | — |
case-03 | pass→pass | 5,098 | 2,342 | -54% | 1 | 1 | 0% | 1,026 | 2,461 | +140% | 0 | 0 | — |
case-04 | pass→pass | 5,659 | 4,973 | -12% | 1 | 1 | 0% | 1,097 | 2,669 | +143% | 0 | 0 | — |
case-05 | fail→pass | 23,966 | 3,980 | -83% | 1 | 1 | 0% | 1,041 | 2,752 | +164% | 0 | 0 | — |
case-06 | pass→pass | 8,121 | 3,033 | -63% | 1 | 1 | 0% | 1,554 | 2,558 | +65% | 0 | 0 | — |
case-07 | pass→pass | 3,835 | 3,136 | -18% | 1 | 1 | 0% | 735 | 2,581 | +251% | 0 | 0 | — |
case-08 | pass→pass | 6,307 | 2,644 | -58% | 1 | 1 | 0% | 1,211 | 2,521 | +108% | 0 | 0 | — |
case-09 | fail→pass | 10,877 | 4,109 | -62% | 1 | 1 | 0% | 2,138 | 2,761 | +29% | 0 | 0 | — |
case-10 | pass→pass | 4,060 | 2,634 | -35% | 1 | 1 | 0% | 751 | 2,472 | +229% | 0 | 0 | — |
case-12 | pass→pass | 7,069 | 1,641 | -77% | 1 | 1 | 0% | 1,424 | 2,278 | +60% | 0 | 0 | — |
case-13 | pass→pass | 7,974 | 3,493 | -56% | 1 | 1 | 0% | 1,523 | 2,454 | +61% | 0 | 0 | — |
case-14 | fail→pass | 9,658 | 2,948 | -69% | 1 | 1 | 0% | 1,994 | 2,573 | +29% | 0 | 0 | — |
case-15 | fail→pass | 8,499 | 3,698 | -56% | 1 | 1 | 0% | 1,818 | 2,757 | +52% | 0 | 0 | — |
case-16 | pass→pass | 18,358 | 5,700 | -69% | 1 | 1 | 0% | 1,656 | 2,984 | +80% | 0 | 0 | — |
case-17 | pass→pass | 14,697 | 8,098 | -45% | 1 | 1 | 0% | 3,019 | 3,675 | +22% | 0 | 0 | — |
case-18 | pass→pass | 17,597 | 7,446 | -58% | 1 | 1 | 0% | 1,792 | 2,997 | +67% | 0 | 0 | — |
case-19 | pass→pass | 23,007 | 5,189 | -77% | 1 | 1 | 0% | 2,239 | 2,970 | +33% | 0 | 0 | — |
case-20 | pass→pass | 16,639 | 7,436 | -55% | 1 | 1 | 0% | 3,804 | 3,634 | -4% | 0 | 0 | — |
case-21 | pass→pass | 3,500 | 2,616 | -25% | 1 | 1 | 0% | 683 | 2,513 | +268% | 0 | 0 | — |
case-22 | pass→pass | 6,415 | 7,027 | +10% | 1 | 1 | 0% | 1,203 | 2,871 | +139% | 0 | 0 | — |
case-23 | pass→pass | 4,343 | 2,851 | -34% | 1 | 1 | 0% | 938 | 2,598 | +177% | 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, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +26 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/24/2026 | +14% |
Other measured skills in the registry, with their headline benchmark lift.