Views
No views yet
https://github.com/luanbei/PACMTscript/ directory. The three prediction scripts require pacmt_retrained_common.py in that same directory.1PACMT/
2├── README.md
3├── backbone/
4│ ├── config.json
5│ ├── pytorch_model.bin
6│ ├── tokenizer.json
7│ ├── tokenizer_config.json
8│ ├── configuration_bert.py
9│ ├── bert_layers.py
10│ ├── bert_padding.py
11│ └── flash_attn_triton.py
12├── binary_model/
13│ ├── config.json
14│ ├── pytorch_model.bin
15│ ├── head_config.json
16│ ├── tokenizer.json
17│ ├── tokenizer_config.json
18│ └── special_tokens_map.json
19├── hierarchy_model/
20│ ├── pytorch_model.bin
21│ ├── head_config.json
22│ ├── tokenizer.json
23│ ├── tokenizer_config.json
24│ ├── special_tokens_map.json
25│ ├── label_taxonomy_mapping.csv
26│ ├── taxonomy_paths.csv
27│ ├── taxonomy_paths_with_names.csv
28│ └── label_sizes.json
29└── taxonomy/
30 ├── label_taxonomy_mapping.csv
31 └── taxonomy_paths.csv1backbone/
2binary_model/
3hierarchy_model/
4taxonomy/label_taxonomy_mapping.csv
5taxonomy/taxonomy_paths.csvlabel_taxonomy_mapping.csv file maps internal label IDs to taxonomy names and should contain at least:rank,label_id,taxonomy_nametaxonomy_paths.csv file defines valid hierarchical taxonomy paths and should contain at least:order_id,family_id,genus_id,species_id1git clone https://github.com/luanbei/PACMT.git
2cd PACMT
3conda create -n pacmt python=3.8 -y
4conda activate pacmt
5pip install -r requirements.txtmodels/ directory:1pip install -U huggingface_hub
2hf download luanbei/PACMT --local-dir models1models/
2├── backbone/
3├── binary_model/
4├── hierarchy_model/
5└── taxonomy/1python script/predict_bina_hiera.py \
2 --backbone_dir models/backbone \
3 --binary_ckpt_dir models/binary_model \
4 --hierarchy_ckpt_dir models/hierarchy_model \
5 --mapping_csv models/taxonomy/label_taxonomy_mapping.csv \
6 --taxonomy_path_csv models/taxonomy/taxonomy_paths.csv \
7 --input_csv examples/example.csv \
8 --seq_col seq \
9 --id_col id \
10 --seg_len 500 \
11 --stride 250 \
12 --max_length 512 \
13 --batch_size 32 \
14 --device cuda \
15 --virus_threshold 0.5 \
16 --tau 0.2 \
17 --out_csv pacmt_predictions.csv--input_fasta examples/example.fasta1python script/predict_binary.py \
2 --backbone_dir models/backbone \
3 --ckpt_dir models/binary_model \
4 --input_csv examples/example.csv \
5 --seq_col seq \
6 --id_col id \
7 --seg_len 500 \
8 --stride 250 \
9 --max_length 512 \
10 --batch_size 32 \
11 --device cuda \
12 --tau 0.2 \
13 --threshold 0.5 \
14 --out_csv binary_predictions.csv1python script/predict_hierarchy.py \
2 --backbone_dir models/backbone \
3 --ckpt_dir models/hierarchy_model \
4 --mapping_csv models/taxonomy/label_taxonomy_mapping.csv \
5 --taxonomy_path_csv models/taxonomy/taxonomy_paths.csv \
6 --input_csv examples/example.csv \
7 --seq_col seq \
8 --id_col id \
9 --seg_len 500 \
10 --stride 250 \
11 --max_length 512 \
12 --batch_size 32 \
13 --device cuda \
14 --tau 0.2 \
15 --out_csv hierarchy_predictions.csv1id
2seq_len
3n_segments
4is_virus
5virus_confidence
6order_id, order_name, order_conf
7family_id, family_name, family_conf
8genus_id, genus_name, genus_conf
9species_id, species_name, species_conf
10joint_score
11log_joint_scoreis_virus=1 indicates that the input sequence is predicted as viral. If is_virus=0, the hierarchical taxonomic fields are left empty.Luan B, Li P, et al. PACMT: a pretrained language model-based framework for viral identification and hierarchical taxonomic classification of metagenomic data.