AntiFP2: Antifungal Protein Prediction Toolkit
139
This repository provides a fully containerized version of AntiFP2, a toolkit for antifungal protein prediction using:
All dependencies (Python, ESM2 models, BLAST, MERCI, Prokka, etc.) are pre-installed inside the Docker image.
Instead of running individual scripts directly, you should always enter the Docker container first.
docker run -it --rm antifp2 bash
By default, this gives you a working shell inside the container.
If you want to work on files stored on your host machine, mount them into the container:
docker run -it --rm -v /absolute/path/to/data:/workspace -w /workspace antifp2 bash
/absolute/path/to/data β path on your host with FASTA/contigs files./workspace β working directory inside the container (you will be placed here after startup).antifp2.pyAll methods are launched using a single master script:
python3 antifp2.py --method <method-name> [method-specific options]
python3 antifp2.py --list
This will display:
esm2esm2-hybridesm2-metaml-hybridml-hybrid-metaEach corresponds to a backend script or combination pipeline.
esm2Predict antifungal proteins using the fine-tuned ESM2 model (sequence-only, one-by-one).
| 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 |
python3 antifp2.py --method esm2 --input proteins.fasta --output esm2_predictions.csv --threshold 0.5
esm2-hybridCombines ESM2 predictions with BLAST adjustments and motif analysis (MERCI).
| Flag | Description |
|---|---|
--input | Input protein FASTA file |
--outdir | Output directory for results |
--threshold | (Optional) Probability cutoff (default: 0.5) |
--no-cleanup | (Optional) Keep intermediate files |
python3 antifp2.py --method esm2-hybrid --input proteins.fasta --outdir esm2_hybrid_results --threshold 0.6
esm2-metaRuns Prokka genome annotation first, then applies ESM2 predictions on predicted proteins.
| Flag | Description |
|---|---|
--input | Input contigs FASTA file |
--outdir | Directory for all outputs |
--threshold | (Optional) Probability cutoff (default: 0.5) |
--threads | (Optional) CPU threads for Prokka (default: all) |
--no-cleanup | (Optional) Keep intermediate files |
--metagenome | (Optional) Enable Prokka metagenome mode |
python3 antifp2.py --method esm2-meta --input contigs.fasta --outdir esm2_meta_out --threads 8
ml-hybridUses ML classifier (PAAC features) combined with BLAST and MERCI adjustments.
| Flag | Description |
|---|---|
--input | Input protein FASTA file |
--outdir | Directory for outputs |
--threshold | (Optional) Probability cutoff (default: 0.5) |
--envfile | Path to envfile (BLAST/MERCI config) |
python3 antifp2.py --method ml-hybrid --input proteins.fasta --outdir ml_hybrid_out --threshold 0.5
ml-hybrid-metaRuns Prokka annotation, then applies ML + BLAST + MERCI hybrid classifier.
| Flag | Description |
|---|---|
--input | Input contigs FASTA |
--outdir | Directory for outputs |
--threshold | (Optional) Probability cutoff (default: 0.5) |
--threads | (Optional) CPU threads for Prokka |
--no-cleanup | (Optional) Keep intermediate files |
--metagenome | (Optional) Enable Prokka metagenome mode |
--envfile | Path to envfile (BLAST/MERCI config) |
python3 antifp2.py --method ml-hybrid-meta --input contigs.fasta --outdir ml_hybrid_meta_out --threads 8
Depending on the method, outputs include:
| File/Dir | Description |
|---|---|
*_predictions.csv | Main prediction results (probabilities, labels) |
*_antifp2.fasta | FASTA with predicted antifungal proteins |
blast_out.csv, *.locate | Intermediate BLAST/MERCI results |
prokka/ (dir) | Prokka annotation results (in meta pipelines) |
rejected_log.txt | Log of sequences filtered or rejected |
Assume your FASTA files are in /home/user/antifp2_data.
docker run -it --rm -v /home/user/antifp2_data:/workspace -w /workspace antifp2 bash
python3 antifp2.py --method ml-hybrid --input proteins.fasta --outdir results
results/) will appear both inside the container and in your host directory (/home/user/antifp2_data/results).Use --no-cleanup if you want to keep intermediate .faa, .locate, .csv, or Prokka files for debugging. Otherwise, they are automatically removed.
AntiFP2 runs inside a Linux-based Docker container, which is fully compatible with Intel-based Macs and Apple Silicon (M1/M2/M3) using emulation.
π§ macOS does not natively support some Linux tools like Prokka due to architecture or package conflicts β thatβs why Docker is the preferred method.
Install Docker Desktop for macOS
Enable Rosetta Emulation (only needed once):
softwareupdate --install-rosetta
docker run --platform linux/amd64 --rm -it -v /absolute/path/on/mac:/data pratik0297/antifp2
python3 antifp2.py --method
esm2-meta --input /data/your_contigs.fasta --outdir /data/esm2_meta --threads 4 --metagenome
### π§ͺ macOS Example
Assuming your FASTA file is at `~/Downloads/testing/first_100.fasta`:
```bash
docker run --platform linux/amd64 --rm -it -v ~/Downloads/testing:/data pratik0297/antifp2
Then, inside the container:
python3 antifp2.py --method esm2-meta --input /data/test_contigs.fasta --outdir /data/esm2_meta
If you get Bad CPU type in executable or Illegal instruction errors, it likely means:
--platform linux/amd64Prokka and BLAST inside Docker will work even if they don't install on native macOS.
If you use AntiFP2 in your research, please cite: (Add citation / preprint link here)
For issues, please:
Content type
Image
Digest
sha256:134f80ba7β¦
Size
1.6 GB
Last updated
12 months ago
docker pull pratik0297/antifp2