This application is used to predict antibiotic resistome(s) from protein or nucleotide data based on homology and SNP models. The application uses reference data from the Comprehensive Antibiotic Resistance Database (CARD).
RGI analyses can be performed via the CARD website RGI portal, via the Galaxy platform (see Install RGI in Galaxy below), or alternatively you can install RGI from Conda or run RGI from Docker (see below). The instructions below discuss use of RGI at the command line, following a general overview of how RGI works for genomes, genome assemblies, proteomes, and metagenomic sequencing.
May 2023: Chan Zuckerberg ID (CZ ID) has implemented a web-based platform for RGI analysis of assembled contigs (FASTA) or metagenomic sequencing reads (FASTQ): CZ ID AMR Pipeline Workflow.
CARD reference sequences and significance cutoffs are under constant curation - as CARD curation evolves, the results of RGI evolve.
- CARD Frequently Asked Questions
- CBW 2025 Infectious Disease Genomic Epidemiology - Antimicrobial Resistant Gene (AMR) Analysis using CARD & RGI
Table of Contents
- Overview and Use of RGI
- Help Menu and Usage
- Loading CARD Reference Databases
- Analyzing Genomes, Genome Assemblies, Metagenomic Contigs, or Proteomes
- Analyzing Metagenomic Reads
- CARD k-mers: Pathogen-of-Origin and Genomic Context Prediction for AMR Genes
- Running RGI on Digital Research Alliance of Canada (formerly Compute Canada) Serial Farm
- License
- Citation
- Support & Bug Reports
- Installation
RGI is run at the command line as rgi <command>, with commands for loading and managing CARD reference data (e.g. load, auto_load, database), analyzing sequences (main, bwt), k-mer prediction of pathogen-of-origin (kmer_query, kmer_build), and generating summaries (e.g. heatmap, tab). See Help Menu and Usage for the full list of commands and their options.
Before analysis, RGI must be loaded with CARD's reference data, optionally together with CARD's Resistomes & Variants data (WildCARD) and the pre-compiled k-mer libraries. Data can be loaded into the working directory (--local) or for the RGI installation as a whole. See Loading CARD Reference Databases.
RGI main predicts open reading frames from DNA FASTA (or uses protein FASTA directly) and detects AMR genes and mutations using CARD's protein homolog, protein variant, protein overexpression, and rRNA gene variant models under the Perfect, Strict, and Loose paradigm, using BLAST or DIAMOND. See Analyzing Genomes, Genome Assemblies, Metagenomic Contigs, or Proteomes.
RGI bwt aligns short FASTQ reads to CARD's protein homolog model reference sequences (and optionally to CARD's Resistomes & Variants alleles) using KMA (default and recommended), Bowtie2, or BWA, and reports gene- and allele-level read mapping results. See Analyzing Metagenomic Reads.
CARD k-mers, run as RGI kmer_query, uses k-mers derived from CARD's Resistomes & Variants data to predict the likely pathogen-of-origin (species or genus) and genomic context (chromosome or plasmid) of AMR genes detected by RGI main or RGI bwt. Predictions are limited to the host species sampled for each gene in Resistomes & Variants, so a gene from an unsampled host may be labelled with a sampled species. Pre-compiled 61-mer and 15-mer libraries are available from CARD, and custom libraries can be built with RGI kmer_build. See CARD k-mers for usage; validation data and the analysis workflow are at mawlodarski/card-kmers.
Example scripts for running many RGI jobs in parallel (illustrated with RGI bwt) using the Digital Research Alliance of Canada serial farm method. See Running RGI on Digital Research Alliance of Canada Serial Farm.
Use or reproduction of these materials, in whole or in part, by any commercial organization whether or not for non-commercial (including research) or commercial purposes is prohibited, except with written permission of McMaster University. Commercial uses are offered only pursuant to a written license and user fee. To obtain permission and begin the licensing process, see the CARD website.
Alcock et al. 2023. CARD 2023: expanded curation, support for machine learning, and resistome prediction at the Comprehensive Antibiotic Resistance Database. Nucleic Acids Research, 51, D690-D699 [PMID 36263822]
Please log an issue on GitHub Issues.
You can email the CARD curators or developers directly at card@mcmaster.ca.
The recommended installation method for most users is via Conda or Docker. This will handle dependency management and ensure installation of the correct version of RGI's external dependencies e.g., BLAST, DIAMOND.
Install conda on your system if not already available.
Install mamba from mamba on your system if not already available.
Search for the RGI package and show available versions:
mamba search --channel conda-forge --channel bioconda --channel defaults rgi
Create a new Conda environment
mamba create --name rgi --channel conda-forge --channel bioconda --channel defaults rgi
Install RGI package:
mamba install --channel conda-forge --channel bioconda --channel defaults rgi
Install a specific version of RGI:
mamba install --channel conda-forge --channel bioconda --channel defaults rgi=5.1.1
Remove RGI package:
mamba remove rgi
RGI is available via biocontainers fully installed with all databases appropriately loaded.
Install docker on your system if not already available.
Pull the Docker container from biocontainers (built from Conda package at https://quay.io/repository/biocontainers/rgi?tab=tags&tag=latest).
docker pull quay.io/biocontainers/rgi:6.0.8--pyh05cac1d_0
RGI can be executed from the container as follows:
docker run -v $PWD:/data quay.io/biocontainers/rgi:6.0.8--pyh05cac1d_0 rgi -h
RGI is available in the Galaxy web platform through a community-maintained suite of Galaxy tools written by @tcollins2011 and published in the Galaxy Tool Shed. The CARD team recommends this suite for Galaxy users:
- RGI main - resistome prediction from genome assemblies (contigs) or protein sequences, equivalent to
rgi main. - RGI bwt - alignment of metagenomic sequencing reads to CARD, equivalent to
rgi bwt. - CARD and WildCARD data managers, which Galaxy administrators use to install CARD reference data on their servers.
On usegalaxy.org, RGI main and RGI bwt are installed in the Metagenomic Analysis tool section, with CARD reference data provided by the server administrators. Other Galaxy servers can install the suite from the Tool Shed. The Galaxy tools may lag the latest RGI release, so check the tool version shown in Galaxy. Questions about the Galaxy tools themselves should go to the wrapper repository; questions about RGI or CARD should go to this repository's issue tracker or card@mcmaster.ca.
The earlier CARD-maintained Galaxy wrapper (card/rgi in the Tool Shed, from the rgi_wrapper and rgi_database_builder repositories) is retired and no longer updated; its last version wraps RGI 5.2.1.
The following conda command will install all RGI dependencies (listed below):
git clone https://github.com/arpcard/rgi
cd rgi
conda env create -f conda_env.yml
conda activate rgi- Python 3.6+
- NCBI BLAST 2.16.0
- zlib
- Prodigal 2.6.3
- DIAMOND 2.1.16
- Biopython 1.78
- filetype 1.0.0+
- pytest 3.0.0+
- pandas 0.15.0+
- Matplotlib 2.1.2+
- seaborn 0.8.1+
- pyfaidx 0.5.4.1+
- pyahocorasick 1.1.7+
- OligoArrayAux 3.8
- samtools 1.22.1
- bamtools 2.5.2
- bedtools 2.31.1
- Jellyfish 2.2.10
- Bowtie2 2.5.4
- BWA 0.7.18
- KMA 1.6.10
pip install git+https://github.com/arpcard/rgi.gitor
python setup.py build
python setup.py test
python setup.py installcd tests
pytest -v -rxs