← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-long-read-sequencing-medaka-polishing / references / usage-guide.md

Medaka Polishing - Usage Guide

Overview

medaka polishes Oxford Nanopore draft assemblies to higher consensus accuracy, produces haploid variant calls (VCF) for microbial, mitochondrial, and viral samples, and generates amplicon/viral consensus sequences. It is a basecaller-model-specific neural consensus net: the single most important rule is that the model must match the basecaller (pore, chemistry, speed, mode, version) or the consensus silently degrades. medaka runs directly on the assembler output as a single pass - the old "Racon then medaka" chain is obsolete for contemporary models. medaka is ONT-only; PacBio HiFi/CLR must never be fed to it. For ONT diploid/germline small-variant calling, use Clair3; for read-level/human polishing, dorado polish is the emerging successor.

Prerequisites

conda install -c bioconda medaka minimap2 samtools seqkit
# Models download on first use; a GPU accelerates inference but is not required.
medaka tools list_models    # see installed/available models

Quick Start

Tell your AI agent what you want to do: - "Polish my ONT Flye assembly with medaka, auto-detecting the model" - "Polish my bacterial isolate assembly with the methylation-aware model" - "Make a haploid consensus VCF for my viral sample" - "Check whether medaka actually improved my assembly"

Example Prompts

Assembly polishing

"I have an ONT-only Flye assembly and the Dorado-basecalled reads. Polish it with medaka, let it auto-detect the model from the reads, and run a single pass. Do not run Racon first."

Bacterial isolate

"Polish my native bacterial isolate assembly with medaka's methylation-aware bacterial model so methylation-motif errors are corrected."

Model matching

"These reads were basecalled with an older Dorado model. Tell me whether the medaka model will match, and whether I should re-basecall before polishing."

Haploid consensus

"Generate a haploid consensus and VCF for my mitochondrial Nanopore reads against the reference."

Honest measurement

"I polished with medaka. Measure whether it helped using held-out k-mers, not the reads I polished with."

What the Agent Will Do

  1. Establish what basecaller model and version produced the reads, so the medaka model matches (preferring auto-detection from the BAM).
  2. Confirm the reads are ONT (and refuse to ONT-polish PacBio HiFi/CLR).
  3. Run medaka_consensus as a single pass directly on the assembler output (no Racon pre-step).
  4. For native bacterial isolates, add --bacteria to use the methylation-aware model.
  5. For haploid samples, run medaka_variant to produce a VCF (apply it to the reference with bcftools consensus for a consensus FASTA).
  6. Recommend a reference-free Merqury QV before/after measurement on held-out data, not the polishing reads.

Tips

Resources