Run Binning Tools

Let’s use different binning tools to group the contigs into bins, which we’ll refine in the next section with Binette.

MetaBAT2

#!/bin/bash
# Generate depth file from BAM file for MetaBAT2 and MaxBin2
jgi_summarize_bam_contig_depths --outputDepth depth_Kickstart.txt Kickstart.bam

# Run MetaBAT2
mkdir -p metabat2_bins
metabat2 --inFile Kickstart.megahit/R1.contigs.fa --abdFile depth_Kickstart.txt --outFile metabat2_bins/metabat2 --numThreads 12 --seed 1

MaxBin2

#!/bin/bash
# Run MaxBin2 using the depth file from MetaBAT2
mkdir -p maxbin2_bins
run_MaxBin.pl -contig Kickstart.megahit/R1.contigs.fa \
                -abund depth_Kickstart.txt -thread 12 -out maxbin2_bins/maxbin2

CONCOCT

#!/bin/bash
# Run CONCOCT binning

# Create directory
mkdir -p concoct/

# Cut up the FASTA file into chunks for processing
cut_up_fasta.py Kickstart.megahit/R1.contigs.fa --chunk_size 10000 \
                --overlap_size 0 --merge_last \
                --bedfile concoct/contigs_10K.bed > concoct/contigs_10K.fa

# Generate the coverage table from the BAM file
concoct_coverage_table.py concoct/contigs_10K.bed Kickstart.bam > concoct/coverage_table.tsv

# Run CONCOCT with the composition and coverage files
concoct --composition_file concoct/contigs_10K.fa \
        --coverage_file concoct/coverage_table.tsv \
        --basename concoct/bins --threads 12

# Merge the clustering results and extract bins
merge_cutup_clustering.py concoct/bins_clustering_gt1000.csv > concoct/clustering_merge.csv

mkdir -p concoct_bins

extract_fasta_bins.py Kickstart.megahit/R1.contigs.fa concoct/clustering_merge.csv --output_path concoct_bins

SemiBin2

#!/bin/bash
# Run SemiBin2 with single_easy_bin command
SemiBin2 single_easy_bin -i Kickstart.megahit/R1.contigs.fa \
                            -b Kickstart.bam \
                            -o semibin2_output -p 12

⌛ Expected Time

This process take around 1 hour to complete.