Describe the bug
RGI 6.0.8 fails in contig mode on the official NCBI RefSeq genome GCF_000005845.2 (Escherichia coli K-12 MG1655).
The program exits with:
Requested rname NC does not exist!
This issue is reproducible.
Interestingly, another NCBI RefSeq genome (GCF_000240185.1, Klebsiella pneumoniae HS11286) runs successfully in the same environment, suggesting a genome-specific reference name parsing or mapping issue.
I also replaced the FASTA header from:
NC_000913.3
to
contig1
while keeping the sequence identical.
The error still occurs:
Requested rname contig does not exist!
This suggests that the internal rname used by RGI no longer matches the original FASTA identifier.
Input
rgi main
-i GCF_000005845.2_ASM584v2_genomic.fna
-o ecoli
-t contig
--clean
I also tested:
rgi main
-i GCF_000005845.2_ASM584v2_genomic.fna
-o ecoli
-t contig
-a DIAMOND
--clean
The same error occurs.
Input file
Official NCBI RefSeq genome:
Accession:
GCF_000005845.2
Organism:
Escherichia coli str. K-12 substr. MG1655
Downloaded using:
datasets download genome accession GCF_000005845.2
FASTA header:
NC_000913.3 Escherichia coli str. K-12 substr. MG1655, complete genome
Error log
ERROR 2026-06-16 14:08:21,512 :
(Base.py::results::289)
Requested rname NC does not exist!
Please check your FASTA file.
The same error occurs when using:
-a DIAMOND
CARD Version
4.0.1
Obtained by:
rgi database --version
RGI version
Resistance Gene Identifier - 6.0.8
Obtained by:
rgi main -h
Expected behavior
RGI should successfully analyze the official NCBI RefSeq genome:
GCF_000005845.2
Escherichia coli K-12 MG1655
which is one of the most widely used bacterial reference genomes.
The output files such as:
ecoli.json
ecoli.txt
should be generated without errors.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS:Ubuntu 24.04 LTS
Browser:Chrome
Version:149
Additional context
Additional observations:
The original FASTA header is:
NC_000913.3
RGI reports:
Requested rname NC does not exist
which appears to truncate the original identifier.
I replaced the FASTA header:
NC_000913.3
with
contig1
while keeping the nucleotide sequence identical.
RGI then reports:
Requested rname contig does not exist
which again appears to truncate the identifier.
Another NCBI RefSeq genome:
GCF_000240185.1
with header:
NC_016845.1
runs successfully in the exact same environment.
The issue occurs with both:
BLAST (default)
and
DIAMOND
alignment modes.
Environment:
Python: Conda environment
RGI: 6.0.8
CARD: 4.0.1
OS: Ubuntu 24.04 LTS
Installation: Bioconda
Complete terminal output
cd ~/rgi_issue_test
(base) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda activate rgi
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ which rgi
/home/ymq/anaconda3/envs/rgi/bin/rgi
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ rgi main -h | head -20
usage: rgi main [-h] -i INPUT_SEQUENCE -o OUTPUT_FILE [-t {contig,protein}]
[-a {DIAMOND,BLAST}] [-n THREADS] [--include_loose]
[--include_nudge] [--local] [--clean] [--keep] [--debug]
[--low_quality] [-d {wgs,plasmid,chromosome,NA}] [-v]
[-g {PRODIGAL,PYRODIGAL}]
Resistance Gene Identifier - 6.0.8 - Main
options:
-h, --help show this help message and exit
-i INPUT_SEQUENCE, --input_sequence INPUT_SEQUENCE
input file must be in either FASTA (contig and
protein) or gzip format! e.g myFile.fasta,
myFasta.fasta.gz
-o OUTPUT_FILE, --output_file OUTPUT_FILE
output folder and base filename
-t {contig,protein}, --input_type {contig,protein}
specify data input type (default = contig)
-a {DIAMOND,BLAST}, --alignment_tool {DIAMOND,BLAST}
specify alignment tool (default = BLAST)
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ rgi database
usage: rgi database [-h] -v [--local] [--all]
rgi database: error: the following arguments are required: -v/--version
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ rgi database -V
usage: rgi database [-h] -v [--local] [--all]
rgi database: error: the following arguments are required: -v/--version
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ rgi database --version
4.0.1
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda deactivate
(base) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda activate ncbidata
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ datasets download genome accession GCF_000005845.2
New version of client (18.30.1) available at https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/LATEST/linux-amd64/datasets.
Collecting 1 genome record [================================================] 100% 1/1
Downloading: ncbi_dataset.zip 1.38MB valid data package
Validating package files [================================================] 100% 5/5
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ unzip ncbi_dataset.zip
Archive: ncbi_dataset.zip
inflating: README.md
inflating: ncbi_dataset/data/assembly_data_report.jsonl
inflating: ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna
inflating: ncbi_dataset/data/dataset_catalog.json
inflating: md5sum.txt
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ find ncbi_dataset -name "*.fna"
ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda deactivate
(base) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda activate rgi
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ head -1 \
ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna
>NC_000913.3 Escherichia coli str. K-12 substr. MG1655, complete genome
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ mkdir result
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ rgi main \
-i ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna \
-o result/ecoli_k12 \
-t contig \
--clean
ERROR 2026-06-16 14:08:21,512 : (Base.py::results::289) : Requested rname NC does not exist! Please check your FASTA file.
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ grep "^>" \
ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna
>NC_000913.3 Escherichia coli str. K-12 substr. MG1655, complete genome
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ grep "^>" ... | wc -l
grep: ...: 没有那个文件或目录
0
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ mkdir result_diamond
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ rgi main \
-i ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna \
-o result_diamond/ecoli_k12 \
-t contig \
-a DIAMOND \
--clean
ERROR 2026-06-16 14:10:04,331 : (Base.py::results::289) : Requested rname NC does not exist! Please check your FASTA file.
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ mkdir -p ~/rgi_issue_test/header_fix
cp \
~/rgi_issue_test/ncbi_dataset/data/GCF_000005845.2/GCF_000005845.2_ASM584v2_genomic.fna \
~/rgi_issue_test/header_fix/genome_contig1.fna
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ head -1 ~/rgi_issue_test/header_fix/genome_contig1.fna
>NC_000913.3 Escherichia coli str. K-12 substr. MG1655, complete genome
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ sed -i '1s/.*/>contig1/' \
~/rgi_issue_test/header_fix/genome_contig1.fna
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ head -1 ~/rgi_issue_test/header_fix/genome_contig1.fna
>contig1
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ mkdir -p ~/rgi_issue_test/header_fix/result
rgi main \
-i ~/rgi_issue_test/header_fix/genome_contig1.fna \
-o ~/rgi_issue_test/header_fix/result/ecoli \
-t contig \
--clean
ERROR 2026-06-16 14:11:31,970 : (Base.py::results::289) : Requested rname contig does not exist! Please check your FASTA file.
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda deactivate
(base) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ conda activate ncbidata
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test$ mkdir -p ~/rgi_issue_test/kp_test
cd ~/rgi_issue_test/kp_test
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ datasets download genome accession GCF_000240185.1
New version of client (18.30.1) available at https://ftp.ncbi.nlm.nih.gov/pub/datasets/command-line/LATEST/linux-amd64/datasets.
Collecting 1 genome record [================================================] 100% 1/1
Downloading: ncbi_dataset.zip 1.68MB valid data package
Validating package files [================================================] 100% 5/5
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ unzip ncbi_dataset.zip
Archive: ncbi_dataset.zip
inflating: README.md
inflating: ncbi_dataset/data/assembly_data_report.jsonl
inflating: ncbi_dataset/data/GCF_000240185.1/GCF_000240185.1_ASM24018v2_genomic.fna
inflating: ncbi_dataset/data/dataset_catalog.json
inflating: md5sum.txt
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ find ncbi_dataset -name "*.fna"
ncbi_dataset/data/GCF_000240185.1/GCF_000240185.1_ASM24018v2_genomic.fna
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ head -1 \
ncbi_dataset/data/GCF_000240185.1/*.fna
>NC_016845.1 Klebsiella pneumoniae subsp. pneumoniae HS11286 chromosome, complete genome
(ncbidata) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ conda deactivate
conda activate rgi
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ mkdir result
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ GENOME=$(find ncbi_dataset -name "*.fna")
rgi main \
-i $GENOME \
-o result/kp \
-t contig \
--clean
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ ls result
kp.json kp.txt
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$ head -1 $GENOME
>NC_016845.1 Klebsiella pneumoniae subsp. pneumoniae HS11286 chromosome, complete genome
(rgi) ymq@ymq-ROG-Strix-G614JV-G614JV:~/rgi_issue_test/kp_test$
Describe the bug
RGI 6.0.8 fails in contig mode on the official NCBI RefSeq genome GCF_000005845.2 (Escherichia coli K-12 MG1655).
The program exits with:
Requested rname NC does not exist!
This issue is reproducible.
Interestingly, another NCBI RefSeq genome (GCF_000240185.1, Klebsiella pneumoniae HS11286) runs successfully in the same environment, suggesting a genome-specific reference name parsing or mapping issue.
I also replaced the FASTA header from:
to
while keeping the sequence identical.
The error still occurs:
Requested rname contig does not exist!
This suggests that the internal rname used by RGI no longer matches the original FASTA identifier.
Input
rgi main
-i GCF_000005845.2_ASM584v2_genomic.fna
-o ecoli
-t contig
--clean
I also tested:
rgi main
-i GCF_000005845.2_ASM584v2_genomic.fna
-o ecoli
-t contig
-a DIAMOND
--clean
The same error occurs.
Input file
Official NCBI RefSeq genome:
Accession:
GCF_000005845.2
Organism:
Escherichia coli str. K-12 substr. MG1655
Downloaded using:
datasets download genome accession GCF_000005845.2
FASTA header:
Error log
ERROR 2026-06-16 14:08:21,512 :
(Base.py::results::289)
Requested rname NC does not exist!
Please check your FASTA file.
The same error occurs when using:
-a DIAMOND
CARD Version
4.0.1
Obtained by:
rgi database --version
RGI version
Resistance Gene Identifier - 6.0.8
Obtained by:
rgi main -h
Expected behavior
RGI should successfully analyze the official NCBI RefSeq genome:
GCF_000005845.2
Escherichia coli K-12 MG1655
which is one of the most widely used bacterial reference genomes.
The output files such as:
ecoli.json
ecoli.txt
should be generated without errors.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS:Ubuntu 24.04 LTS
Browser:Chrome
Version:149
Additional context
Additional observations:
The original FASTA header is:
RGI reports:
Requested rname NC does not exist
which appears to truncate the original identifier.
I replaced the FASTA header:
with
while keeping the nucleotide sequence identical.
RGI then reports:
Requested rname contig does not exist
which again appears to truncate the identifier.
Another NCBI RefSeq genome:
GCF_000240185.1
with header:
runs successfully in the exact same environment.
The issue occurs with both:
BLAST (default)
and
DIAMOND
alignment modes.
Environment:
Python: Conda environment
RGI: 6.0.8
CARD: 4.0.1
OS: Ubuntu 24.04 LTS
Installation: Bioconda
Complete terminal output