Skip to main content

ETAP — ESM3-based Transformer Attention Protein classifier

Binary protein sequence classifier built on ESM3 per-residue embeddings with a learned attention pooling layer.
Designed for any study requiring positive/negative classification of protein sequences.

Installation

pip install etap-clf

Or from source:

pip install "git+https://github.com/Sitgttish/summer26.git#subdirectory=eta_package"

ESM3 is a gated model. Before first use:

  1. Accept the license at https://huggingface.co/EvolutionaryScale/esm3-sm-open-v1
  2. Get a token at https://huggingface.co/settings/tokens
  3. Pass it via --hf-token or set HF_TOKEN in your environment.

Usage

Training

etap --train positive.fasta negative.fasta ./model_output/

Outputs saved to ./model_output/:

  • best_model.pth — model checkpoint
  • training_history.csv — epoch-level loss and val-AUC
  • test_metrics.csv — final accuracy, AUC, avg-precision, sensitivity, specificity

Optional flags:

--epochs 30          Max training epochs (default: 30)
--patience 10        Early stopping patience on val-AUC (default: 10)
--batch-size 64      ETA training batch size (default: 64)
--embed-batch-size 16  ESM3 embedding batch size; reduce if OOM (default: 16)
--lr 3e-4            Learning rate (default: 3e-4)
--proj-dim 256       Hidden dimension (default: 256)
--num-layers 4       Transformer encoder layers (default: 4)
--cache-dir ./cache  Reuse ESM3 embedding cache across runs
--hf-token TOKEN     HuggingFace token

Inference

etap --eval model_output/best_model.pth new_sequences.fasta ./results.csv

Output CSV columns: header, gene, prob_positive, predicted_label
If FASTA headers contain |label=1 or |label=0, full metrics are reported automatically.

Attention analysis (optional)

etap --eval best_model.pth sequences.fasta ./results.csv --gene-analyze

Saves five plots to ./analysis/:

  1. attn_aa_analysis.png — mean attention per amino acid type (+ class enrichment if labels present)
  2. attn_motifs.png — top high-attention 5-mer motifs
  3. attn_gene_heatmap.png — gene-level attention heatmap
  4. attn_position.png — positional attention profile (N→C terminus)

FASTA header conventions

Gene name is extracted automatically:

  • UniProt format >sp|P12345|GENE_HUMAN → gene = GENE
  • Generic: first token before space/|/_

Labels (for metric reporting in eval):

>SEQID|label=1    ferroptosis-positive
>SEQID|label=0    negative control

Python API

from etap import ETA, run_training, run_eval

# Training
ckpt_path, metrics = run_training(
    pos_fasta='positive.fasta',
    neg_fasta='negative.fasta',
    output_dir='./output/',
    hf_token='hf_...',
)

# Inference
results = run_eval(
    model_path='./output/best_model.pth',
    sequences_fasta='new_seqs.fasta',
    output_path='./results.csv',
    gene_analyze=True,
)

Metadata

Release files for etap-clf 0.1.1

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

Source distribution (sdist)

Source distribution for etap-clf 0.1.1
File Size Uploaded Provenance Actions
etap_clf-0.1.1.tar.gz 16.9 kB Without provenance Details for etap_clf-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for etap-clf 0.1.1
File Interpreter ABI Platform Actions
etap_clf-0.1.1-py3-none-any.whl Python 3 none any Details for etap_clf-0.1.1-py3-none-any.whl

Total release size: 35.6 kB

Release files / etap_clf-0.1.1.tar.gz

Download URL etap_clf-0.1.1.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
585158aa4710524f4de94ca4830b2da3c6cc1a77911c3199e8f68f23dc971429
BLAKE2b-256 checksum
How to use checksums
269cd842fe20aeac2c65a66bf2cb7097f7f703cc9769636c7344fa09cf88c5ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / etap_clf-0.1.1-py3-none-any.whl

Download URL etap_clf-0.1.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d44b4dce8b0590358d90975d2a1e8785b9798d00152964c086faa2f518a2bf6
BLAKE2b-256 checksum
How to use checksums
b51c2bc58e501d61f9a2bf58fe910a8826f54f592acff2133427b6235c7ff0dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Security for etap-clf 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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