Skip to main content

AntiFP2: A tool for prediction of Antifungal Proteins

Project description

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


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

antifp2-1.1.0.tar.gz (29.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

antifp2-1.1.0-py3-none-any.whl (30.0 MB view details)

Uploaded Python 3

File details

Details for the file antifp2-1.1.0.tar.gz.

File metadata

  • Download URL: antifp2-1.1.0.tar.gz
  • Upload date:
  • Size: 29.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for antifp2-1.1.0.tar.gz
Algorithm Hash digest
SHA256 faaac3ffb94f26c5d67e9544465547a9e923fe16189cb3d6adfc6cffd7d50281
MD5 5a483791a7b9e23d95122ac6e95b0c73
BLAKE2b-256 4ddbf8571dd1242c00ae3ef2d8f2ce7cadf4aa6dc1f42c96a1f3e184b878a310

See more details on using hashes here.

File details

Details for the file antifp2-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: antifp2-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for antifp2-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6f36cbbc4c730f1a7ccb92919aa324c0113e90fbb44eb3bb9792fd8ec72e34
MD5 0fc556e94f3562fa05ec1c9fa89d806b
BLAKE2b-256 a1485f25935066ba67b9086f8c0e2589da25f724c7c9dd650850bce3c91aabd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page