Skip to main content

GraphTFactor

GraphTFactor logo

GraphTFactor predicts whether a protein is a tran4scription factor using protein language model embeddings and a graph neural network. It segments protein sequences with a minimum description length method, builds a graph from the segments, and predicts a class for each sequence.

Install

PyPI Downloads

python -m pip install graphtfactor

Python 3.10 or newer is required. The package includes the pretrained GraphTFactor classifier checkpoints for all supported organism groups and ESM layer configurations. The first time a configuration is used, fair-esm downloads the corresponding ESM-2 model weights; internet access is needed for that download. ESM-2 models range from 8 million to 15 billion parameters, so memory and accelerator requirements vary substantially. Start with 6 layers if you are unsure.

PyTorch supports CPU, NVIDIA CUDA, and Apple Silicon MPS, subject to the PyTorch build installed for your platform. For CUDA, install the matching PyTorch build using the instructions on the official PyTorch site before installing GraphTFactor.

Quick start

import torch
from graphtfactor import GraphTFactor

if torch.cuda.is_available():
    device = "cuda"
elif torch.backends.mps.is_available():
    device = "mps"
else:
    device = "cpu"

model = GraphTFactor(device=device, esm_layers=6, org="Virus")
predictions, probabilities = model.predict([
    "MDQYITLVELYIYDCNLFKSKNLKSFYKVHRVPEGDIVPKRRGGQLAGVTKSWVETNLVH"
])

print(predictions)    # class: 0 (non-TF) or 1 (TF)
print(probabilities)  # probability for the predicted class

predict() takes a list of amino-acid sequences and returns two lists, one with predicted class labels and one with their predicted-class probabilities. Unrecognized amino-acid symbols are treated as X.

Supported models

Choose org from "All", "Virus", "Eukaryotic", or "Prokaryotic". Choose esm_layers from 6, 12, 30, 33, 36, or 48.

esm_layers ESM-2 model Parameters
6 esm2_t6_8M_UR50D 8M
12 esm2_t12_35M_UR50D 35M
30 esm2_t30_150M_UR50D 150M
33 esm2_t33_650M_UR50D 650M
36 esm2_t36_3B_UR50D 3B
48 esm2_t48_15B_UR50D 15B

Larger ESM-2 models require considerably more memory and may not run on every device.

Streamlit app

Try the GraphTFactor Streamlit app. Paste a protein sequence, select an ESM-2 model and organism group, and view the predicted class, confidence, and protein graph.

Screenshot of the GraphTFactor Streamlit app

The app source and research experiments are available in the GitHub repository.

Citation

@misc{amato2026graphtfactorgraphbasedapproachproteins,
      title={GraphTFactor: A graph-based approach for proteins transcription factor prediction}, 
      author={Domenico Amato and Salvatore Calderaro and Giosuè Lo Bosco and Riccardo Rizzo and Filippo Vella},
      year={2026},
      eprint={2610.40867},
      archivePrefix={arXiv},
      primaryClass={q-bio.QM},
      url={https://arxiv.org/abs/2610.40867}, 
}

License

GraphTFactor is distributed under the MIT License. See LICENSE.

Contact

For questions, feedback, or collaboration inquiries, email Salvatore Calderaro or open an issue in the GitHub repository.

Metadata

Release files for graphtfactor 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphtfactor 0.1.3
File Size Uploaded Provenance Actions
graphtfactor-0.1.3.tar.gz 87.5 MB Without provenance Details for graphtfactor-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for graphtfactor 0.1.3
File Interpreter ABI Platform Actions
graphtfactor-0.1.3-py3-none-any.whl Python 3 none any Details for graphtfactor-0.1.3-py3-none-any.whl

Total release size: 175.0 MB

Release files / graphtfactor-0.1.3.tar.gz

Download URL graphtfactor-0.1.3.tar.gz
Size 87.5 MB
Tags Source
SHA-256 checksum
How to use checksums
41bc3aac842e8dc010a799a856996ac5f8cd01ec7bd0853d9f65c23a0c9b9227
BLAKE2b-256 checksum
How to use checksums
030338eda3bdf233760499d0d698675cb43335ff48bffb6112160caff900cb0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / graphtfactor-0.1.3-py3-none-any.whl

Download URL graphtfactor-0.1.3-py3-none-any.whl
Size 87.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
443b393ced92aa01244caacf4a0c207f56f7ad38c4b399e38b02245c3985ff8e
BLAKE2b-256 checksum
How to use checksums
9fd763091cf6b8268363b41546b3474d63d82e251074a48cc0de68ff822c4ad0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for graphtfactor 0.1.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page