Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Metagenome assembly from long reads using metaFlye and metaSPAdes with binning strategies. Use when reconstructing genomes from microbial communities, recovering metagenome-assembled genomes (MAGs), or resolving strain-level variation in complex samples.
.claude/skills/bio-genome-assembly-metagenome-assembly/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 298% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 327% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 236% | 0% |
| case-09 | ✓→✓ | = Same ✓ | 391% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 304% | 0% |
<!--
#
#
-->
Metagenome assembly reconstructs genomes from mixed microbial communities. Long reads enable recovery of complete circular genomes and resolution of strain-level differences.
bash# ONT metagenome assembly flye --nano-raw reads.fastq.gz \ --meta \ --out-dir flye_meta \ --threads 32 # PacBio HiFi metagenome flye --pacbio-hifi reads.hifi.fastq.gz \ --meta \ --out-dir flye_meta_hifi \ --threads 32 # Key output files: # assembly.fasta - assembled contigs # assembly_graph.gfa - assembly graph # assembly_info.txt - contig statistics
bash# Illumina paired-end metagenome metaspades.py -1 R1.fastq.gz -2 R2.fastq.gz \ -o spades_meta \ -t 32 \ -m 500 # With multiple libraries metaspades.py \ --pe1-1 lib1_R1.fq.gz --pe1-2 lib1_R2.fq.gz \ --pe2-1 lib2_R1.fq.gz --pe2-2 lib2_R2.fq.gz \ -o spades_meta -t 32
bash# Combine short and long reads flye --nano-raw ont_reads.fastq.gz \ --meta \ --out-dir flye_hybrid \ --threads 32 # Polish with short reads pilon --genome flye_hybrid/assembly.fasta \ --frags short_reads.bam \ --output polished \ --threads 16
| Parameter | Description | |-----------|-------------| | --meta | Metagenome mode (handles uneven coverage) | | --min-overlap | Minimum overlap for assembly (default: auto) | | --genome-size | Estimated total size (optional for meta) | | --iterations | Polishing iterations (default: 1) | | --keep-haplotypes | Preserve strain variants |
| Parameter | Description | |-----------|-------------| | -m | Memory limit in GB | | --only-assembler | Skip error correction | | -k | K-mer sizes (auto-selected by default) | | --phred-offset | Quality encoding (33 or 64) |
bash# Step 1: Map reads back to assembly minimap2 -ax map-ont -t 32 assembly.fasta reads.fastq.gz | \ samtools sort -o mapped.bam - # Step 2: Generate depth file jgi_summarize_bam_contig_depths --outputDepth depth.txt mapped.bam # Step 3: Bin with MetaBAT2 metabat2 -i assembly.fasta -a depth.txt -o bins/bin -t 32 # Step 4: Assess bin quality with CheckM2 checkm2 predict --input bins/ --output-directory checkm2_out -x fa --threads 32
bash# Single-sample binning SemiBin2 single_easy_bin \ -i assembly.fasta \ -b mapped.bam \ -o semibin_out \ --environment global # Multi-sample binning (better for time-series) SemiBin2 multi_easy_bin \ -i assembly.fasta \ -b sample1.bam sample2.bam sample3.bam \ -o semibin_multi
bash# Assembly stats seqkit stats assembly.fasta # CheckM2 for bin completeness checkm2 predict -i bins/ -o checkm2_out -x fa -t 32 # GTDB-Tk for taxonomic classification gtdbtk classify_wf --genome_dir bins/ --out_dir gtdbtk_out --cpus 32 # QUAST for assembly metrics metaquast.py -o metaquast_out assembly.fasta -t 32
bash# Flye marks circular contigs in assembly_info.txt grep "Y" flye_meta/assembly_info.txt | cut -f1 > circular_contigs.txt # Extract circular contigs seqkit grep -f circular_contigs.txt assembly.fasta > circular_genomes.fasta
pythonimport subprocess from pathlib import Path import pandas as pd def run_metaflye(reads, output_dir, read_type='nano-raw', threads=32): cmd = ['flye', f'--{read_type}', reads, '--meta', '--out-dir', output_dir, '--threads', str(threads)] subprocess.run(cmd, check=True) return Path(output_dir) / 'assembly.fasta' def run_binning(assembly, bam, output_dir, threads=32): depth_file = Path(output_dir) / 'depth.txt' subprocess.run(['jgi_summarize_bam_contig_depths', '--outputDepth', str(depth_file), bam], check=True) bins_dir = Path(output_dir) / 'bins' bins_dir.mkdir(exist_ok=True) subprocess.run(['metabat2', '-i', assembly, '-a', str(depth_file), '-o', str(bins_dir / 'bin'), '-t', str(threads)], check=True) return bins_dir def assess_bins(bins_dir, output_dir, threads=32): subprocess.run(['checkm2', 'predict', '--input', str(bins_dir), '--output-directory', output_dir, '-x', 'fa', '--threads', str(threads)], check=True) results = pd.read_csv(Path(output_dir) / 'quality_report.tsv', sep='\t') high_quality = results[(results['Completeness'] > 90) & (results['Contamination'] < 5)] return high_quality # Example workflow assembly = run_metaflye('ont_reads.fq.gz', 'flye_out') bins = run_binning(str(assembly), 'mapped.bam', 'binning_out') hq_bins = assess_bins(bins, 'checkm2_out') print(f'High-quality MAGs: {len(hq_bins)}')
| Metric | Good Assembly | |--------|---------------| | N50 | >50 kb | | Largest contig | >1 Mb | | HQ MAGs (>90% complete, <5% contam) | Varies by sample | | Circular genomes | Sample dependent |
| Issue | Solution | |-------|----------| | Few long contigs | Increase read depth or length | | High chimeric rate | Use --keep-haplotypes in Flye | | Poor binning | Add more samples for differential coverage | | Missing taxa | Check read QC; consider targeted enrichment |
<!-- 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-06 | pass→pass | 3,302 | 3,251 | -2% | 1 | 1 | 0% | 586 | 2,504 | +327% | 0 | 0 | — |
case-07 | fail→pass | 3,450 | 2,439 | -29% | 1 | 1 | 0% | 590 | 2,347 | +298% | 0 | 0 | — |
case-08 | pass→pass | 3,809 | 2,940 | -23% | 1 | 1 | 0% | 690 | 2,319 | +236% | 0 | 0 | — |
case-09 | pass→pass | 2,681 | 2,014 | -25% | 1 | 1 | 0% | 466 | 2,290 | +391% | 0 | 0 | — |
case-10 | pass→pass | 3,034 | 2,545 | -16% | 1 | 1 | 0% | 573 | 2,316 | +304% | 0 | 0 | — |
case-15 | pass→pass | 6,757 | 2,291 | -66% | 1 | 1 | 0% | 1,328 | 2,306 | +74% | 0 | 0 | — |
case-21 | pass→pass | 8,078 | 7,991 | -1% | 1 | 1 | 0% | 1,640 | 2,552 | +56% | 0 | 0 | — |
case-22 | pass→pass | 10,208 | 1,738 | -83% | 1 | 1 | 0% | 1,909 | 2,180 | +14% | 0 | 0 | — |
case-03 | pass→pass | 12,207 | 7,850 | -36% | 1 | 1 | 0% | 2,210 | 3,304 | +50% | 0 | 0 | — |
case-04 | pass→pass | 7,231 | 3,329 | -54% | 1 | 1 | 0% | 1,285 | 2,425 | +89% | 0 | 0 | — |
case-05 | pass→pass | 8,347 | 3,472 | -58% | 1 | 1 | 0% | 1,611 | 2,546 | +58% | 0 | 0 | — |
case-20 | pass→pass | 6,665 | 2,758 | -59% | 1 | 1 | 0% | 1,161 | 2,385 | +105% | 0 | 0 | — |
case-01 | pass→pass | 11,591 | 7,869 | -32% | 1 | 1 | 0% | 2,205 | 3,381 | +53% | 0 | 0 | — |
case-02 | pass→pass | 7,057 | 5,572 | -21% | 1 | 1 | 0% | 1,143 | 2,852 | +150% | 0 | 0 | — |
case-11 | pass→pass | 3,804 | 2,564 | -33% | 1 | 1 | 0% | 625 | 2,358 | +277% | 0 | 0 | — |
case-12 | pass→pass | 3,647 | 2,063 | -43% | 1 | 1 | 0% | 615 | 2,191 | +256% | 0 | 0 | — |
case-13 | pass→pass | 6,081 | 3,545 | -42% | 1 | 1 | 0% | 1,204 | 2,584 | +115% | 0 | 0 | — |
case-14 | pass→pass | 6,066 | 1,745 | -71% | 1 | 1 | 0% | 1,028 | 2,170 | +111% | 0 | 0 | — |
case-16 | pass→pass | 12,500 | 10,163 | -19% | 1 | 1 | 0% | 2,202 | 3,832 | +74% | 0 | 0 | — |
case-17 | pass→pass | 7,943 | 2,416 | -70% | 1 | 1 | 0% | 1,453 | 2,370 | +63% | 0 | 0 | — |
case-18 | pass→pass | 4,042 | 5,022 | +24% | 1 | 1 | 0% | 658 | 2,789 | +324% | 0 | 0 | — |
case-19 | pass→pass | 5,145 | 2,584 | -50% | 1 | 1 | 0% | 1,013 | 2,340 | +131% | 0 | 0 | — |
case-23 | pass→pass | 12,712 | 4,618 | -64% | 1 | 1 | 0% | 2,333 | 2,654 | +14% | 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 +4 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 | +23% |
Other measured skills in the registry, with their headline benchmark lift.