Repository navigation
RAT
RAT estimates the taxonomic composition of metagenomes by integrating taxonomic signals from MAGs, contigs, and reads. RAT has been added to the CAT pack from version 6.0. To use RAT, you need the CAT pack database files (see reference database for more information).
RAT makes an integrated profile using MAGs/bins, contigs, and reads. To specify which elements should be integrated, use the --mode argument. Possible letters for --mode are m (for MAGs), c (for contigs), and r (for reads). All combinations of the three letters are possible, except r alone.
To run RAT's complete workflow, specify the mode, read files, contig files, bin folder, and database files:
CAT_pack rat --mode mcr -b bin_folder/ -c contigs.fasta -r forward_reads.fq.gz -r reverse_reads.fq.gz -d db/Currently, RAT supports single read files as well as paired-end read files. Interlaced read files are currently not supported. RAT will run CAT and BAT on the contigs and MAGs, will map the reads back to the contigs, and then try to annotate any unmapped reads separately.
RAT defaults to a classification fraction (-f / --fraction) of 0.5 and allows you to change it for its CAT, BAT, and direct sequence classification steps. RAT requires one classification per sequence in tables supplied with --c2c, --b2c, or --u2c. If a lower fraction produces multiple assignments for the same sequence, RAT reports an error; regenerate those classifications with --fraction 0.5 to obtain a single assignment.
If you already have a sorted mapping file, you can supply it and RAT will skip the mapping step:
CAT_pack rat --mode mcr -b bin_folder/ -c contigs.fasta --bam_file mapping_file_sorted.bam -r forward_reads.fq.gz -r reverse_reads.fq.gz -d db/If CAT and/or BAT have already been run on your data, you can supply the output files to RAT to skip the CAT and BAT runs:
CAT_pack rat --mode mcr -b bin_folder/ -c contigs.fasta -r forward_reads.fq.gz -r reverse_reads.fq.gz -d db/ --c2c CAT_contig2classification_file.txt --b2c BAT_bin2classification_file.txtSimilarly, if a previous RAT run crashed after the unmapped reads have already been aligned to the database with DIAMOND or MMseqs2, you can supply the intermediate files to continue the run:
CAT_pack rat --mode mcr -b bin_folder/ -c contigs.fasta -r forward_reads.fq.gz -r reverse_reads.fq.gz -d db/ --c2c CAT_contig2classification_file.txt --b2c BAT_bin2classification_file.txt --alignment_unmapped unmapped_alignment_file.diamondAfter a RAT run is finished, you can run add_names on the abundance files (only for RAT runs with nr database):
CAT_pack add_names -i out.RAT.RAT.complete.abundance.txt -o out.RAT.RAT.complete.abundance.names.txt -d db/ Similar to CAT and BAT, the paths to all dependencies can be supplied via an argument:
CAT_pack rat --mode mcr -b bin_folder/ -c contigs.fasta --read_file forward_reads.fq.gz --read_file reverse_reads.fq.gz -d db/ --path_to_samtools /path/to/samtoolsThe RAT output consists of:
- A log file.
- CAT output files for the contig fasta (when the mode contains
c). - BAT output files for the MAGs (when the mode contains
m. Protein predictions and alignments are reused from CAT when available). - A table that contains the abundance of each MAG (
<prefix>.RAT.bin.reads.txt, when the mode containsm). - A table that contains all detected taxa and their abundance in the sample (
<prefix>.RAT.complete.abundance.txt). - A table that contains the lineage for each read, as well as which step the annotation was made in (
<prefix>.RAT.read2classification.txt, only with--read2classification, in any mode). - A table that contains the abundance of each contig in the contig fasta (
<prefix>.RAT.contig.abundance.txt). - A fasta containing the sequences of all unmapped reads and contigs that could not be annotated by CAT (when the mode contains
r). - The DIAMOND or MMseqs2 alignment of unmapped reads and unannotated contigs (when the mode contains
r). - A table that contains the annotations for unmapped reads and (previously) unannotated contigs (
<prefix>.RAT.unmapped2classification.txt, when the mode containsr).