Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

MEGAHIT Metagenome Assembler: What It Does and How to Run It

What the MEGAHIT metagenome assembler does, how its succinct de Bruijn graph works, the documented run options, and a checklist for reproducible runs.

Written and maintained by CASRAI Editorial Board

Last updated

MEGAHIT is a free, open-source assembler that builds contigs from short sequencing reads, and it is optimized for metagenomes. Its project page describes it as an ultra-fast and memory-efficient NGS assembler; it also handles single-genome and single-cell data. This page is for researchers and lab staff who need to understand what it does and what to record when planning a run. It is general software information, not a substitute for the project’s own manual.

Definition and scope

MEGAHIT is released under the GPL-3.0 licence; the version current when this page was checked (2026-11-08) was v1.2.9 on the project’s GitHub repository. It takes sequencing reads as input and produces assembled contigs. The original method paper is Li D, Liu C-M, Luo R, Sadakane K, Lam T-W, “MEGAHIT: an ultra-fast single-node solution for large and complex metagenomics assembly via succinct de Bruijn graph,” Bioinformatics 31(10):1674–1676 (2015), doi:10.1093/bioinformatics/btv033. For the wider topic of reading microbial communities from mixed DNA, see what is metagenomics; for the general trade-offs between assemblers, see choosing a de novo assembler.

How it works

The paper describes MEGAHIT as a de Bruijn graph assembler built on a succinct de Bruijn graph (SdBG), a compressed representation that stores a graph with m edges in O(m) bits while still letting the program move from a vertex to its neighbours in constant time. The practical consequence is lower memory use on large, complex datasets.

In plain terms, the pipeline described in the paper does the following, and each step maps to something you can tune:

  • Multiple k-mer sizes, in increasing order. The assembler iterates over increasing k rather than committing to one value. The intermediate results are kept in the output folder (for example intermediate_contigs/k119.contig.fa).
  • Solid k-mers. A (k+1)-mer must occur at least d times to be kept; the default d is 2, which screens out many sequencing errors.
  • Mercy k-mers. Edges from low-depth regions that would otherwise be lost can be recovered, which helps low-abundance community members.
  • Graph cleaning. At each k the program removes tips, merges bubbles and prunes low-coverage edges. The README notes that --cleaning-rounds 1 --disconnect-ratio 0 applies less pruning and usually yields shorter contigs.

How it is used in practice

The project README lists these installation routes: Conda, Guix, static Linux x86_64 binaries, Docker, or building from source (zlib, cmake 2.8 or later and g++ 4.8.4 or later); gzip and bzip2 are needed at run time. The documented command forms are:

  • Paired-end reads in two files: megahit -1 pe_1.fq -2 pe_2.fq -o out
  • Interleaved paired-end reads: --12 interleaved.fq
  • Single-end reads: -r; several libraries are given as comma-separated lists
  • Self-check: megahit --test
  • Resume an interrupted run: --continue -o out
  • Complex metagenomes such as soil: --presets meta-large
  • Low-depth data when memory allows: --kmin-1pass

The main result is final.contigs.fa in the output directory. megahit_core contig2fastg converts contigs to FASTG. megahit -h prints the full option list; options such as thread count and memory limit are in that manual rather than the README overview.

Planning checklist

This checklist is built from the README options above and is meant to make a run reproducible. It is editorial guidance, not a requirement from the MEGAHIT authors.

Record or decide Why (source basis)
MEGAHIT version and install route (Conda, Docker, binary, source) The README lists several routes and a current release number; results can differ between versions.
Input layout: two paired files, interleaved (--12), or single-end (-r) Each layout uses a different documented flag.
Preset, if any (for example meta-large) The README ties this preset to complex metagenomes such as soil.
Any cleaning or k-mer options changed from defaults The README states that less pruning usually gives shorter contigs; --kmin-1pass is for low-depth, high-memory situations.
Whether the run was resumed with --continue Documents that one output directory spans more than one invocation.
Which file was passed downstream (final.contigs.fa or an intermediate contig set) Both kinds of file are written.

Pair the checklist with general reproducible research practices, and deposit the underlying reads in a public archive such as the Sequence Read Archive where your funder or journal expects it. Taxonomic labels for downstream results are covered in the NCBI Taxonomy guide.

Where it matters: scale of resources

The 2015 paper gives a sourced sense of scale from one dataset, a 252 Gbp soil metagenome assembled on a single node. With a GPU, the assembly took 44.1 hours; without one, about 99.6 hours (the abstract’s figure; the paper’s table reports 99.4). The authors report no preprocessing such as partitioning or normalization was needed. Memory peaked at 345 GB on a 384 GB server in the 44.1-hour run, and the assembly fit in as little as 260 GB at 55.3 hours. For comparison, the authors estimated that SOAPdenovo2 and IDBA-UD would need at least 4 TB on the same data. These are results for one 2015 dataset and hardware setup; your own data, version and settings will differ, so use them only to size the order of magnitude when asking for compute time.

Common misunderstandings

  • “It is only for metagenomes.” It is optimized for metagenomes, but the project states it also works on single-genome and single-cell data.
  • “It needs a GPU.” The paper’s benchmark ran both with and without one; the GPU shortened the sort-dominated graph construction step.
  • “Fast means best.” The sources describe speed and memory efficiency; they do not rank it as the best assembler for every dataset.
  • “Intermediate contigs are final results.” The final assembly is final.contigs.fa; per-k files are intermediate.

Frequently asked questions

How do I cite MEGAHIT?

Cite Li et al. 2015, Bioinformatics 31(10):1674–1676, doi:10.1093/bioinformatics/btv033. The README also points to the 2016 “MEGAHIT v1.0” Methods paper. Also state the version used.

How do I resume an interrupted run?

Rerun the command with --continue and the same output directory (--continue -o out).

Where are the contigs?

In final.contigs.fa in the output directory; per-k intermediate files are under intermediate_contigs/.

Does MEGAHIT need read preprocessing?

The paper reports that no partitioning or normalization was needed for the soil dataset. Routine read quality control is a separate, common step in metagenomics workflows and is not something the paper rules out.

Sources

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about MEGAHIT Metagenome Assembler: What It Does and How to Run It

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →