|
1 | 1 | # MAGmax |
2 | | -MAGmax is a tool to maximize the yield of Metagenome-Assembled Genomes (MAGs) through bin Merging and reAssembly. |
| 2 | +MAGmax is a dereplication tool designed to maximize the recovery of Metagenome-Assembled Genomes (MAGs) through bin Merging and reAssembly. It performs dereplication in three stages: (i) grouping bins based on average sequence identity, (ii) merging bins within each group, and (iii) reassembling the merged bins. |
3 | 3 |
|
4 | | -### Example run |
| 4 | +## INPUTS |
| 5 | +MAGmax requires three input directories, |
| 6 | +1. `binsdir`, a directory containing bin files in FASTA format that need to be dereplicated. (e.g., output files from any metagenome binning tool) |
5 | 7 |
|
6 | | - magmax -b binsdir -m mapid_dir -r readdir -f fasta -t 24 |
7 | | - magmax -b binsdir -m mapid_dir -r readdir -f fasta -t 24 -q quality_report.tsv // if CheckM2 result is already available |
8 | | - magmax -b binsdir -m mapid_dir -r readdir -f fasta -t 24 --split // if input bins are not already split by sample id |
| 8 | +2. `readdir`, a directory containing read files in FASTQ format for each sample. |
| 9 | + |
| 10 | +3. `mapid_dir`, a directory containing mapping files for each sample. Each file is a text file listing read IDs and the corresponding contig IDs they mapped to. These files are used to retrieve reads that map to each merged bin from the FASTQ files in `readdir` and to generate new bin-specific FASTQ files for reassembly. |
9 | 11 |
|
10 | | -### Test run |
11 | | - magmax -b test/bins -m test/mapids -r test/reads -t 24 -q test/quality_report.tsv |
| 12 | +## OUTPUTS |
| 13 | +An output directory named `mags_<x>comp_<y>purity` will be created, where `x` and `y` correspond to the user-specified completeness and purity thresholds used to select final bins. By default, MAGmax uses a percentage of 50 for completeness and 95 for purity. |
| 14 | +The output directory contains dereplicated bins, and a text file listing the completeness and contamination scores for each bin as calculated by CheckM2. |
| 15 | + |
| 16 | +### Example command line call |
| 17 | + |
| 18 | + magmax -b <binsdir> -r <readdir> -m <mapid_dir> -f fasta -t 24 |
| 19 | + magmax -b <binsdir> -r <readdir> -m <mapid_dir> -f fasta -t 24 -q quality_report.tsv // if CheckM2 result is already available |
| 20 | + magmax -b <binsdir> -r <readdir> -m <mapid_dir> -f fasta -t 24 --split // if input bins are not already split by sample id |
12 | 21 |
|
13 | 22 | ## Install |
14 | 23 | ### Prerequisites |
@@ -49,7 +58,7 @@ Option 2: Build from source |
49 | 58 | cargo install --path . |
50 | 59 | magmax -h |
51 | 60 |
|
52 | | - |
| 61 | + |
53 | 62 | ## Options |
54 | 63 | -b, --bindir <BINDIR> |
55 | 64 | Directory containing fasta files of bins |
@@ -78,19 +87,24 @@ Option 2: Build from source |
78 | 87 | -V, --version |
79 | 88 | Print version |
80 | 89 |
|
| 90 | +### Test run using toy data |
| 91 | +This example test run demonstrates dereplication of bins using the provided toy dataset. In the `test/bins` directory, example bins generated with MetaBAT2 are given. In the `test/reads` directory, paired-end read files for two samples are given and in the `test/mapids` directory, mapid files mapping reads to contigs for each sample are given. Precomputed CheckM2 quality scores for the input bins are given in the `test/quality_report.tsv`. Run the following command to execute the test: |
| 92 | + |
| 93 | + magmax -b test/bins -r test/reads -m test/mapids -t 24 -q test/quality_report.tsv |
| 94 | + |
81 | 95 |
|
82 | 96 | ## Notes |
83 | | -1. Input contigs should have id prefixed with the sample ID, separated by 'C'. Perform mapping and binning on contig files with these updated contig ids. |
| 97 | +1. Input contigs should have id prefixed with the sample ID, separated by 'C', as commonly practiced in the single-sample and multi-sample binning. Perform mapping and binning on contig files with these updated contig ids. |
84 | 98 | 2. Mapid files can be generated using aligner2counts (https://github.com/soedinglab/binning_benchmarking/tree/main/util#aligner2counts) with `only-mapids` option. |
85 | 99 |
|
86 | 100 | File name: `<sampleid>_mapids` |
87 | 101 | ``` |
88 | | - read1_id sampleidCcontig1_id |
89 | | - read2_id sampleidCcontig2_id |
90 | | - read2_id sampleidCcontig4_id |
91 | | - read3_id sampleidCcontig2_id |
92 | | - read4_id sampleidCcontig3_id |
93 | | - read4_id sampleidCcontig4_id |
| 102 | + read1_id <sampleid>Ccontig1_id |
| 103 | + read2_id <sampleid>Ccontig2_id |
| 104 | + read2_id <sampleid>Ccontig4_id |
| 105 | + read3_id <sampleid>Ccontig2_id |
| 106 | + read4_id <sampleid>Ccontig3_id |
| 107 | + read4_id <sampleid>Ccontig4_id |
94 | 108 | ``` |
95 | 109 |
|
96 | 110 | 3. If input bins are not separated by sample IDs, such as when using MetaBAT2 or COMEBin on a concatenated set of contigs, use the `--split` option to automatically separate input bin by sample IDs. |
|
0 commit comments