Skip to main content

ViTax-RAG: Retrieval-Augmented Language Model for Viral Taxonomy Classification

Introduction

ViTax-RAG is a hybrid viral taxonomy classification framework that integrates BLAST-based retrieval with a Bi-Hyena genomic language model to achieve adaptive, accurate, and robust taxonomic assignment from metagenomic sequences.

Installation

ViTax-RAG can be installed either via pip (recommended) or from source.

External Dependency: NCBI BLAST+ (Optional but Recommended)

ViTax-RAG optionally uses NCBI BLAST+ for retrieval-augmented inference.

Install via conda (recommended)

conda install -c bioconda blast

Verify installation:

which blastn
blastn -version

Option 1️⃣ (Recommended): Install via pip

pip install vitax-rag

This installs the ViTax-RAG command-line tool:

vitax-rag --help

Required External Data

ViTax-RAG requires external BLAST database files, which are not packaged inside the Python wheel.

git clone https://github.com/Ying-Lab/ViTax-Rag.git
cd ViTax-Rag

Quick Start

Basic run (automatic device selection)

vitax-rag \
  --contigs test_contigs.fasta \
  --data_dir ./data \
  --out result.txt

Option 2️⃣ : Install from Source (Development Mode)

Install dependencies:

git clone https://github.com/Ying-Lab/ViTax-Rag.git
cd ViTax-Rag
pip install -r requirements.txt

Install NCBI BLAST+:

# 1) Download the latest BLAST+ tarball (adjust version if needed)
mkdir -p ~/downloads && cd ~/downloads
wget https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.12.0+-x64-linux.tar.gz

# 2) Extract and move to a permanent location
tar -zxvf ncbi-blast-2.12.0+-x64-linux.tar.gz
mv ncbi-blast-2.12.0+ ~/blast+

# 3) Persist PATH (so BLAST commands are available in every shell)
echo 'export PATH="$HOME/blast+/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# 4) Verify installation
which blastn
blastn -version

Quick Start

Basic run (auto device selection):

python predict.py --contigs test_contigs.fasta --out output.txt --device auto

Adjust chunking and batch size for long contigs:

python predict.py --contigs test_contigs.fasta --chunk_size 2000 --window_size 400 

Command-Line Options

  • --contigs FASTA input path, default test_contigs.fasta
  • --out output predictions file, default output.txt
  • --confidence confidence threshold, default 0.6
  • --window_size sliding step size, default 400
  • --chunk_size chunk length, default 2000
  • --batch_size batch size, default 64
  • --rc Use bidirectional prediction, default true
  • --augment use BLAST augmentation, default true
  • --augment_len target augmented length, default 4000
  • --device auto/cpu/cuda, default auto

Output

  • One line per input sequence; fields are space-separated: sequence_id label confidence

  • sequence_id: taken from the FASTA header (text after > up to the first space)

  • label: either unclassified or TaxonName_TaxonLevel

  • TaxonLevel: one of Genus, Family, Order, Class; if genus confidence is below --confidence, the classifier backs off to higher levels

  • confidence: normalized score in [0, 1], formatted to two decimals; higher means stronger support for the predicted taxon

  • Ordering: lines follow the order of sequences in the input FASTA

  • Device and augmentation: enabling --rc (reverse complement) and --augment (BLAST) can change predictions and confidence

  • Output file: written to the path specified by --out and printed as Done, please check the output file: <path>

Metadata

Release files for vitax-rag 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vitax-rag 0.2.1
File Size Uploaded Provenance Actions
vitax_rag-0.2.1.tar.gz 159.9 kB Without provenance Details for vitax_rag-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vitax-rag 0.2.1
File Interpreter ABI Platform Actions
vitax_rag-0.2.1-py3-none-any.whl Python 3 none any Details for vitax_rag-0.2.1-py3-none-any.whl

Total release size: 359.6 kB

Release files / vitax_rag-0.2.1.tar.gz

Download URL vitax_rag-0.2.1.tar.gz
Size 159.9 kB
Tags Source
SHA-256 checksum
How to use checksums
191e5927ab7def89794c76d1db109c1602c93003e61f7f22ad91aafef1a5ce6c
BLAKE2b-256 checksum
How to use checksums
be9824bb261475ad70922f0a6385f6a0baf61a1c12ef864bf8e8a32e3786e2fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.18

Release files / vitax_rag-0.2.1-py3-none-any.whl

Download URL vitax_rag-0.2.1-py3-none-any.whl
Size 199.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43662ac6621019cb41d756df1ed184dbbbec1d6382dbc6d9e9a82c67c3f8b460
BLAKE2b-256 checksum
How to use checksums
2e47e893702bb32a09333abc4d6922c2b882b068aa8900562ea8d632df7c12ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.18

Security for vitax-rag 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page