Fungtion
Predict fungal effectors from FASTA files using ESM-1b embeddings and R SVM models.
Paper: https://doi.org/10.1016/j.jmb.2024.168613
For sequences predicted as fungal effectors, this project also generates:
- ESM-1b-based similarity network visualization
- relationship tree visualization
- an HTML report in the style of the original Fungtion web page
Clone the Repository
git clone https://github.com/noHup-cc/fungtion.git
cd fungtion
Install
Option 1: create the full Conda environment from environment.yml (recommended)
conda env create -f environment.yml
conda activate fungtion
# optional: install Fungtion as a local editable package
pip install -e .
Option 2: create the Conda environment manually
conda create -n fungtion -c conda-forge python=3.10 r-base=4.4 r-e1071 r-caret r-optparse
conda activate fungtion
# install the Python package in editable mode
pip install -e .
Developer tooling:
pip install -e ".[dev]"
pre-commit install
pre-commit run --all-files
PyTorch Compatibility
The default installation will install torch automatically.
If your system has specific CPU/GPU or CUDA driver requirements, you may need to reinstall a compatible PyTorch build manually after installation. For example:
# CPU only
pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cpu
# Example: CUDA 12.6
pip install torch==2.6.0 --index-url https://download.pytorch.org/whl/cu126
Please choose the PyTorch build that matches your local hardware and driver setup:
Example Run
Example FASTA:
data/examples/example.fasta
Download ESM-1b Weights
Before prediction, you can download the pretrained ESM-1b weights through a
separate setup step. This downloads the same ESM-1b model file that Fungtion
would otherwise fetch automatically through fair-esm:
fungtion setup-models
By default, the downloaded file is stored at:
~/.cache/fungtion/models/esm1b_t33_650M_UR50S.pt
You can also choose a custom directory:
fungtion setup-models --model-dir /path/to/models
If the weights already exist locally, the setup step will skip downloading by default. To force a fresh download and overwrite the existing local copy, use:
fungtion setup-models --force
Simple:
fungtion \
--fasta data/examples/example.fasta \
--output-dir outputs \
--prefix example_prediction \
--device auto \
--skip-visualization
With HTML report:
fungtion \
--fasta data/examples/example.fasta \
--output-dir outputs \
--prefix example_prediction \
--device auto \
--html-report
Keep intermediate files:
fungtion \
--fasta data/examples/example.fasta \
--output-dir outputs \
--prefix example_prediction \
--device auto \
--skip-visualization \
--keep-temp
With GPU:
fungtion \
--fasta data/examples/example.fasta \
--output-dir outputs \
--prefix example_prediction \
--device cuda \
--skip-visualization
Note
If the setup-downloaded weights exist in the default Fungtion cache directory, the prediction command will use them automatically.
If you pass --pretrain, Fungtion will use that explicit local path in
preference to the default setup location.
You can also download the model file manually to a local path and run
Fungtion with --pretrain /path/to/esm1b_t33_650M_UR50S.pt.
fungtion \
--fasta data/examples/example.fasta \
--output-dir outputs \
--prefix example_prediction \
--pretrain /path/to/esm1b_t33_650M_UR50S.pt \
--device auto \
--skip-visualization
Official ESM-1b weights:
Example Run Output
The HTML example above generates everything under outputs/example_prediction/:
example_prediction.csv: prediction resultsexample_prediction_analysis/: network and tree intermediate outputsexample_prediction.html: HTML reportexample_prediction_assets/: HTML report assets and per-sequence visualization pagesexample_prediction_temp_folder/: intermediate feature files when--keep-tempis used
Example Run Output CSV Columns
header: FASTA headerscore: prediction scoredecision:yesornotype:Exp.orPred.type_link: external link forExp.entries when available
Notes
- If an input sequence is identical to a reference positive sequence, it is marked as
Exp.and its score is shown as1. - Other sequences are marked as
Pred.and scored by the R SVM models. - The HTML report supports search, sorting, pagination, column toggling, export, help popovers, and visualization links.
- The ESM-1b network page supports clicking non-query nodes to open UniProt or NCBI Protein pages.
- Before committing code changes, run
pre-commit run --all-filesto apply Ruff fixes/formatting and basic whitespace checks.
More Parameters On Run
--fasta: input FASTA file--output-dir: directory where the prefixed output folder will be created--prefix: naming identifier for the output folder and generated files--pretrain: optional local path to pretrained ESM-1b weights--device: device for ESM-1b feature extraction; choose fromauto,cpu, orcuda--html-report: generate the HTML report and bundled assets--skip-visualization: skip network and tree generation--keep-temp: keep intermediate temporary files under<output-dir>/<prefix>/<prefix>_temp_folder/
Data
data/
examples/: example FASTA files for demonstration and example runs
Full training and independent benchmark datasets used in the paper are available on Zenodo:
- https://zenodo.org/records/20808434
- DOI:
10.5281/zenodo.20808434
src/fungtion/reference_data/
FungalEffector_positive.fasta: experimentally validated fungal effector proteinsFungalEffector_positive_esm_uniref50.csv: ESM-1b features of the experimentally validated fungal effector proteinsFungalEffector_positive_similarity_matrix/: precomputed reference similarity matrices used for network and relationship tree visualization
Citation
If you use this project, please cite:
@article{li2024fungtion,
title={Fungtion: A Server for Predicting and Visualizing Fungal Effector Proteins},
author={Li, Jiahui and Ren, Jinzheng and Dai, Wei and Stubenrauch, Christopher and Finn, Robert D. and Wang, Jiawei},
journal={Journal of Molecular Biology},
volume={436},
number={17},
pages={168613},
year={2024},
doi={10.1016/j.jmb.2024.168613}
}
Metadata
Release files for fungtion 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| fungtion-1.0.0.tar.gz | 18.2 MB | Without provenance | Details for fungtion-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fungtion-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for fungtion-1.0.0-py3-none-any.whl |
Total release size: 36.5 MB
Release files / fungtion-1.0.0.tar.gz
| Download URL | fungtion-1.0.0.tar.gz |
|---|---|
| Size | 18.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e8671ef3f0482e98342d356cdf6eee5ae50d05e2549c727b09e0e0072276602
|
|
BLAKE2b-256 checksum How to use checksums |
b9b28cb0313a1c0a7c6323c233fc9f9dd6e69aac33d263dcd59e80fe262d9a8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Release files / fungtion-1.0.0-py3-none-any.whl
| Download URL | fungtion-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e05d6f4ca82dfe3f2d11e4cac044fbfcfb28cc9a627b1edce121681c9cbc46e
|
|
BLAKE2b-256 checksum How to use checksums |
2876724a0aecd7978b1e51b1c2118c598c36652557163f25ebd2d7b194e4e527
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.18
|
Security for fungtion 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.