Docker image for MEGAHIT in FH DaSL's WILDS
1.6K
This directory contains Docker images for MEGAHIT, an ultra-fast and memory-efficient NGS assembler optimized for metagenomes. It also works well on generic single genome assembly (small or mammalian size) and single-cell assembly.
latest ( Dockerfile | Vulnerability Report )1.2.9 ( Dockerfile | Vulnerability Report )These Docker images are built from Ubuntu 22.04 and include:
python symlink for compatibility)The images are designed to be minimal and focused on MEGAHIT with its essential runtime dependencies. Build-time dependencies (cmake, g++, make) are removed after compilation to reduce the final image size.
These images are built for AMD64 (x86_64) only. MEGAHIT v1.2.9 contains x86-specific CPU optimizations and intrinsics that prevent compilation on ARM64 architecture. For users on ARM64 systems (e.g., Apple Silicon Macs), the AMD64 image can still be used via emulation (Docker Desktop handles this automatically), which is sufficient for local testing and development.
If you use MEGAHIT in your research, please cite the original authors:
Li, D., Liu, C-M., Luo, R., Sadakane, K., and Lam, T-W. (2015)
MEGAHIT: An ultra-fast single-node solution for large and complex metagenomics
assembly via succinct de Bruijn graph.
Bioinformatics, doi: 10.1093/bioinformatics/btv033
PMID: 25609793
Tool homepage: https://github.com/voutcn/megahit
# Pull the latest version
docker pull getwilds/megahit:latest
# Or pull a specific version
docker pull getwilds/megahit:1.2.9
# Alternatively, pull from GitHub Container Registry
docker pull ghcr.io/getwilds/megahit:latest
# Pull the latest version
apptainer pull docker://getwilds/megahit:latest
# Or pull a specific version
apptainer pull docker://getwilds/megahit:1.2.9
# Alternatively, pull from GitHub Container Registry
apptainer pull docker://ghcr.io/getwilds/megahit:latest
# Example 1: Basic metagenome assembly from paired-end reads
docker run --rm -v /path/to/data:/data getwilds/megahit:latest \
megahit -1 /data/reads_R1.fastq.gz -2 /data/reads_R2.fastq.gz \
-o /data/megahit_output
# Example 2: Assembly with multiple input files
docker run --rm -v /path/to/data:/data getwilds/megahit:latest \
megahit -1 /data/sample1_R1.fq.gz,/data/sample2_R1.fq.gz \
-2 /data/sample1_R2.fq.gz,/data/sample2_R2.fq.gz \
-o /data/megahit_assembly
# Example 3: Assembly with single-end reads
docker run --rm -v /path/to/data:/data getwilds/megahit:latest \
megahit -r /data/reads.fastq.gz -o /data/megahit_se_output
# Example 4: Using custom k-mer sizes and minimum contig length
docker run --rm -v /path/to/data:/data getwilds/megahit:latest \
megahit -1 /data/reads_R1.fastq.gz -2 /data/reads_R2.fastq.gz \
--k-list 21,29,39,59,79,99 --min-contig-len 500 \
-o /data/megahit_custom
# Alternatively using Apptainer
apptainer run --bind /path/to/data:/data docker://getwilds/megahit:latest \
megahit -1 /data/reads_R1.fastq.gz -2 /data/reads_R2.fastq.gz \
-o /data/megahit_output
# ... or a local SIF file via Apptainer
apptainer run --bind /path/to/data:/data megahit_latest.sif \
megahit -1 /data/reads_R1.fastq.gz -2 /data/reads_R2.fastq.gz \
-o /data/megahit_output
MEGAHIT is designed to be memory-efficient, but large datasets may still require significant RAM. By default, MEGAHIT uses 90% of available memory. You can control memory usage with the -m or --memory flag:
# Limit MEGAHIT to 16GB of RAM
docker run --rm -v /path/to/data:/data getwilds/megahit:latest \
megahit -1 /data/reads_R1.fastq.gz -2 /data/reads_R2.fastq.gz \
--memory 0.16 -o /data/megahit_output
MEGAHIT creates temporary files during assembly. Make sure your output directory has sufficient disk space. To use a custom temporary directory, mount it and specify with --tmp-dir:
docker run --rm -v /path/to/data:/data -v /path/to/tmp:/tmp getwilds/megahit:latest \
megahit -1 /data/reads_R1.fastq.gz -2 /data/reads_R2.fastq.gz \
--tmp-dir /tmp -o /data/megahit_output
The Dockerfile follows these main steps:
python symlink to python3 for MEGAHIT wrapper compatibilityThese images are regularly scanned for vulnerabilities using Docker Scout. However, due to the nature of bioinformatics software and their dependencies, some Docker images may contain components with known vulnerabilities (CVEs).
Use at your own risk: While we strive to minimize security issues, these images are primarily designed for research and analytical workflows in controlled environments.
For the latest security information about this image, please check the CVEs_*.md files in this directory, which are automatically updated through our GitHub Actions workflow. If a particular vulnerability is of concern, please file an issue in the GitHub repo citing which CVE you would like to be addressed.
These Dockerfiles are maintained in the WILDS Docker Library repository.
docker pull getwilds/megahit:latest