LucaVirusCress is a specialized binary classification model for identifying CRESS (Circular Rep-Encoding Single-Stranded) DNA viruses by targeting REP (Replication-associated protein). Built on
LucaProt, it supports high-throughput viral sequence screening in large metagenomic datasets.
The model reached optimal convergence at 4,000 global steps.
The training process used weighted loss to handle extreme class imbalance.
To ensure high specificity, the model was trained on a highly imbalanced dataset (1:40 ratio) with carefully selected hard negatives.
1git clone https://github.com/lpyhhh/LucaVirusCress.git
2cd LucaVirusCress
3
4conda env create -f environment.yaml
5conda activate lucaviruscress
6
7# Download model files from Hugging Face
8git clone https://huggingface.co/Daxiao123/LucaVirusCress hf_model
9
10# Copy model files into checkpoint directory
11mkdir -p models/cress/protein/binary_class/sefn/20230201140320/checkpoint-4000
12cp -r hf_model/* models/cress/protein/binary_class/sefn/20230201140320/checkpoint-4000/
13
14# Clean temporary directory
15rm -rf hf_model
The embedding matrix is generated in real time.
1cd src
2
3python predict_one_sample.py \
4 --protein_id protein_1 \
5 --sequence "MTTSTAFT...(your sequence)" \
6 --emb_dir ../emb \
7 --dataset_name cress \
8 --dataset_type protein \
9 --task_type binary_class \
10 --model_type sefn \
11 --time_str 20260321140320 \
12 --step 4000 \
13 --threshold 0.5 \
14 --gpu_id 0
1cd src
2
3python predict_many_samples.py \
4 --fasta_file ../data/input.fasta \
5 --save_file ../result/prediction_results.csv \
6 --emb_dir ../emb \
7 --dataset_name cress \
8 --model_type sefn \
9 --time_str 20260321140320 \
10 --step 4000 \
11 --gpu_id 0
This project is licensed under the MIT License. See
LICENSE for details.
Thanks to everyone who supported this project.