AntiFP2
AntiFP2 is a Python toolkit for predicting antifungal proteins using multiple approaches:
- ESM2 (fine-tuned language model)
- Machine Learning (PAAC features)
- BLAST (sequence similarity adjustment)
- MERCI (motif adjustment)
It provides both one-by-one protein prediction and batch processing.
⚠️ Note: For genome or metagenome pipelines (requiring Prokka integration), please refer to the GitHub repository or the Docker version.
🚀 Features
-
Fine-tuned ESM2 model for protein sequence prediction
-
Hybrid ML-based predictions using PAAC features
-
Post-prediction adjustments:
- BLAST: Sequence similarity to known antifungal/negative examples
- MERCI: Motif enrichment detection
-
One-by-one and batch prediction modes
-
Logging of rejected or invalid sequences
📦 Installation
Install via PyPI:
pip install antifp2
Requires Python ≥ 3.12.
Ensure BLAST+ and MERCI binaries are properly configured if using BLAST/MERCI adjustments.
📁 Project Structure
antifp2/
│
├── antifp2.py # Master script
├── antifp2_esm2.py # ESM2-only predictions
├── antifp2_esm2_hybrid.py # ESM2 + BLAST + MERCI hybrid predictions
├── antifp2_ml_hybrid.py # ML + BLAST + MERCI hybrid predictions
├── blast_db/ # Preformatted BLAST database
├── MERCI/ # MERCI motif files
├── envfile # Config file for BLAST/MERCI paths
├── README.md
└── setup.py
🧭 Usage
All pipelines are launched using the master script:
python3 antifp2.py --method <method-name> [options]
Available Methods
| Method Name | Description |
|---|---|
esm2 |
ESM2-only predictions (protein sequences) |
esm2-hybrid |
ESM2 + BLAST + MERCI hybrid predictions |
ml-hybrid |
ML (PAAC) + BLAST + MERCI hybrid predictions |
For genome/metagenome pipelines using Prokka, see GitHub or Docker version.
1️⃣ ESM2 Only — esm2
Predict antifungal proteins using the fine-tuned ESM2 model.
Arguments:
| Flag | Description |
|---|---|
--input |
Input protein FASTA file |
--output |
Path to output CSV file |
--threshold |
Optional probability cutoff (default: 0.5) |
--no-cleanup |
Optional: keep intermediate files |
Example:
python3 antifp2.py --method esm2 --input proteins.fasta --output esm2_predictions.csv
2️⃣ ESM2 + BLAST + MERCI — esm2-hybrid
Hybrid prediction combining ESM2, BLAST, and MERCI adjustments.
Arguments:
| Flag | Description |
|---|---|
--input |
Input protein FASTA file |
--outdir |
Output directory |
--threshold |
Optional probability cutoff (default: 0.5) |
--envfile |
Path to envfile with BLAST/MERCI paths |
--no-cleanup |
Optional: keep intermediate files |
Example:
python3 antifp2.py --method esm2-hybrid --input proteins.fasta --outdir esm2_hybrid_results
3️⃣ ML Hybrid — ml-hybrid
Predict antifungal proteins using ML (PAAC features) with BLAST and MERCI adjustments.
Arguments:
| Flag | Description |
|---|---|
--input |
Input protein FASTA file |
--outdir |
Output directory |
--threshold |
Optional probability cutoff (default: 0.6) |
--envfile |
Path to envfile with BLAST/MERCI paths |
--no-cleanup |
Optional: keep intermediate files |
Example:
python3 antifp2.py --method ml-hybrid --input proteins.fasta --outdir ml_hybrid_results
📂 Outputs
| File / Directory | Description |
|---|---|
*_predictions.csv |
Main predictions (probabilities, labels) |
*_antifp2.fasta |
Predicted antifungal protein sequences |
blast_out.csv, *.locate |
Intermediate BLAST/MERCI results |
rejected_log.txt |
Invalid or rejected sequences log |
💾 Model Files
ESM2 models are automatically loaded from the package or can be downloaded from Hugging Face.
✅ Citation
If you use AntiFP2 in your research, please cite it appropriately.
👨💻 Support
- GitHub: https://github.com/raghavagps/antifp2
- Email: raghava@iiitd.ac.in
Metadata
Release files for antifp2 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| antifp2-1.1.0.tar.gz | 29.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| antifp2-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.8 MB
Release files / antifp2-1.1.0.tar.gz
| Download URL | antifp2-1.1.0.tar.gz |
|---|---|
| Size | 29.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
faaac3ffb94f26c5d67e9544465547a9e923fe16189cb3d6adfc6cffd7d50281
|
|
BLAKE2b-256 checksum How to use checksums |
4ddbf8571dd1242c00ae3ef2d8f2ce7cadf4aa6dc1f42c96a1f3e184b878a310
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / antifp2-1.1.0-py3-none-any.whl
| Download URL | antifp2-1.1.0-py3-none-any.whl |
|---|---|
| Size | 30.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e6f36cbbc4c730f1a7ccb92919aa324c0113e90fbb44eb3bb9792fd8ec72e34
|
|
BLAKE2b-256 checksum How to use checksums |
a1485f25935066ba67b9086f8c0e2589da25f724c7c9dd650850bce3c91aabd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|