The end-to-end pipeline¶
## 1. Getting the assembly
# Assemble the shotgun reads of the sample with MEGAHIT (or metaSPAdes: spades.py --meta),
# keeping the contigs of 500 bp or more.
megahit \
-1 shotgun_R1.fq.gz \
-2 shotgun_R2.fq.gz \
--min-contig-len 500 \
--num-cpu-threads 16 \
--out-dir megahit \
--out-prefix sample
## 2. Mapping the Hi-C pairs
# Align the Hi-C reads on the assembly and make the contact map of its contigs
hicstuff pipeline \
--genome megahit/sample.contigs.fa \
--enzyme DpnII,HinfI \
--matrix metacool \
--threads 16 \
--outdir hicstuff \
--prefix sample \
hic_R1.fq.gz hic_R2.fq.gz
## 3. Annotating MGEs
# Find the viral and plasmid contigs with geNomad
genomad download-database .
genomad end-to-end \
--cleanup \
--splits 8 \
megahit/sample.contigs.fa genomad genomad_db
tail --quiet --lines +2 genomad/sample.contigs_summary/sample.contigs_{virus,plasmid}_summary.tsv | cut --fields 1 > mges.txt
## 4. Clustering and assigning hosts with metaTOR
# Bin the contigs into MAGs, cluster the MGE contigs, and find their hosts.
metator pipeline \
--assembly megahit/sample.contigs.fa \
--enzyme DpnII,HinfI \
--mges mges.txt \
--threads 16 \
--outdir metator \
hicstuff/sample.metacool
This takes a metagenome from its reads to MAGs, MGE clusters and their hosts. It needs a shotgun library (for the assembly) and a Hi-C library of the same sample.
- Assembly. MEGAHIT writes
megahit/sample.contigs.fa. metaTOR does not assemble. Contigs shorter than 500 bp carry too few contacts to be clustered. - Contact map. hicstuff writes the map,
hicstuff/sample.metacool. Give it the enzymes of the library. metaTOR can also make the map itself from pairs or BAM files: see The inputs of a run. - MGEs. geNomad writes its tables in
genomad/sample.contigs_summary/; the first column of each lists the contigs.--mgestakes any list of contig names, one per line, so another annotation tool works too. -
metaTOR.
metator pipelinebuilds the network, partitions it, validates the clusters with miComplete, finds the marker genes of each contig, clusters the MGE contigs and finds the MAGs that host them. Its outputs, inmetator/:Output What it holds sample.metacoolThe contact map of the clusters, with the marker genes of each contig fasta/The MAGs and the MGE clusters, as FASTA files cool/A cool file per MAG, with the MGE clusters it hosts tables/,plots/The tables and plots of the run, among them tables/mge_hosts.txtsample.report.htmlThe report of the run (with sample.report.txtandsample.report_mqc.yaml, for MultiQC)sample.metator_<date>.logThe log
See Running the pipeline for the options, and Clustering mobile genetic elements for the MGE steps.