conda config --add envs_dirs /zfs/omics/projects/bioinformatics/software/miniconda3/envs/MetaBAT2
Introduction
MetaBAT2 is a binning tool that uses tetranucleotide frequency and coverage/abundance information (from mapping reads back to the assembly) to group contigs from a metagenome assembly into genome bins (Kang et al. 2019).
For metagenomic binning pipelines, it is recommended to use MetaBAT2 alongside other binners (i.e. COMEbin, SemiBin, VAMB, …), and then consolidate the results using either DAS Tool or Binette to get the best results.
Installation
Installed on Crunchomics: yes, MetaBAT v2.18 is installed via conda.
If you have access to Crunchomics and have not yet access to the bioinformatics share you can send an email with your UvA netID to Nina Dombrowski. Afterwards, you can add the bioinformatics share as follows (if you have already done this in the past, you don’t need to run this command):
If you want to install it yourself, the command below installs the version verified on Crunchomics. Before running it, check the tool’s Bitbucket page for a newer version and swap the version number if one is available.
mamba create -n metabat_2.18 -c bioconda -c conda-forge metabat2=2.18Usage
Input file format:
- Contigs [-i/–inFile]: The metagenome assembly in fasta format.
- Depth file [-a/–abdFile]: A tab-separated contig depth/coverage file, generated from one or more BAM files (reads mapped back to the assembly) using the
jgi_summarize_bam_contig_depthsscript that ships with MetaBAT2.
Step 1: generate the depth file from sorted, indexed BAM file(s) (one BAM per sample if you have multiple samples for differential coverage binning):
conda activate metabat_2.18
jgi_summarize_bam_contig_depths --outputDepth depth.txt \
sample1.sorted.bam sample2.sorted.bamStep 2: run MetaBAT2 using the assembly and the depth file:
metabat2 -i assembly.fasta \
-a depth.txt \
-o metabat2_output/bin \
-t 10After running this, you will find the resulting bins as separate fasta files (bin.1.fa, bin.2.fa, …) in the specified output directory (metabat2_output above).
Allowed options:
-h [ --help ] produce help message
-i [ --inFile ] arg Contigs in (gzipped) fasta file format [Mandatory]
-o [ --outFile ] arg Base file name and path for each bin. The default output is fasta format.
Use -l option to output only contig names [Mandatory].
-a [ --abdFile ] arg A file having mean and variance of base coverage depth (tab delimited;
the first column should be contig names, and the first row will be
considered as the header and be skipped) [Optional].
-m [ --minContig ] arg (=2500) Minimum size of a contig for binning (should be >=1500).
--minSmallContig arg (=1000) Minimum size of a small contig for recruiting into established bins
(should be >=500)
--maxP arg (=95) Percentage of 'good' contigs considered for binning decided by connection
among contigs. The greater, the more sensitive.
--minS arg (=60) Minimum score of a edge for binning (should be between 1 and 99). The
greater, the more specific.
--maxEdges arg (=200) Maximum number of edges per node. The greater, the more sensitive.
--pTNF arg (=0) TNF probability cutoff for building TNF graph. Use a %% value between 1
and 100 to skip the auto preparation step. (0: auto).
--noAdd Turning off additional binning for lost or small contigs.
--minRecruitingSize arg (=10) (if not noAdd) Minimum cluster size for recruiting of small and leftover
contigs
--recruitToAbdCentroid [EXPERIMENTAL] If set (and not noAdd), use the weighted-by-abundance
centroid of a cluster to recruit small and lost contigs. Potentially
reduces sensitivity and improves speed
--recruitWithTNF arg (=0) [EXPERIMENTAL] If non-zero (and not noAdd), uses this factor against the
large-contig TNF threshold to require small and lost contigs have at
least that TNF distance from the centroid of the recruiting cluster.
Recommend 0.9-1.0.
--cvExt When a coverage file without variance (from third party tools) is used
instead of abdFile from jgi_summarize_bam_contig_depths.
--fullHeader Preserve full FASTA headers from input assembly (default: trim at first
space).
-x [ --minCV ] arg (=1) Minimum mean coverage of a contig in each library for binning.
--minCVSum arg (=1) Minimum total effective mean coverage of a contig (sum of depth over
minCV) for binning.
-s [ --minClsSize ] arg (=200000) Minimum size of a bin as the output.
-t [ --numThreads ] arg (=0) Number of threads to use (0: use all cores).
-l [ --onlyLabel ] Output only sequence labels as a list in a column without sequences.
--saveCls Save cluster memberships as a matrix format
--unbinned Generate [outFile].unbinned.fa file for unbinned contigs
--noBinOut No bin output. Usually combined with --saveCls to check only contig
memberships
--noSampleDepths Do not include per-sample depths in bin fasta headers
--seed arg (=0) For exact reproducibility. (0: use random seed)
-d [ --debug ] Debug output
-q [ --quiet ] Be less verbose verbose output
-v [ --verbose ] Be more verbose in output (on by default)