Skip to main content

Predict protein subcellular localization using protein language model embeddings.

Project description

proteinloc

PyPI version Python versions License: MIT CI

Predict protein subcellular localization for prokaryotic proteins using state-of-the-art protein language model embeddings — ESM Cambrian and ProstT5.

proteinloc classifies sequences into six possible subcellular localizations:

  • Cellwall
  • Cytoplasmic
  • CytoplasmicMembrane
  • Extracellular
  • OuterMembrane
  • Periplasmic

Classifier artifacts (~18–23 MB each) are not bundled in the package. They are downloaded from Hugging Face Hub on first use and cached locally.


Installation

Using pip

pip install proteinloc

Using uv

uv tool install proteinloc

[!IMPORTANT] proteinloc requires Python ≥ 3.10 and PyTorch ≥ 2.2.
The esm package (EvolutionaryScale ESM Cambrian) requires accepting a license agreement on Hugging Face before model weights can be downloaded. Run huggingface-cli login and accept the license at https://huggingface.co/EvolutionaryScale/esmc-300m-2024-12.


Quick start

# Predict from a FASTA file (classifiers download automatically on first run)
proteinloc predict --fasta sequences.fasta --model esm_300

# Output as JSON
proteinloc predict --fasta sequences.fasta --model esm_600 --output-format json

# Save to a file
proteinloc predict --fasta sequences.fasta --model prost --output-format csv --output results.csv

CLI Reference

proteinloc predict

Embed sequences with a protein language model, then classify subcellular localization.

Option Description Default
--fasta PATH Input FASTA file (required)
`--model [esm_300 esm_600 prost]`
`--output-format [table json csv]`
--output PATH Write output to file instead of stdout
--device TEXT Torch device (cpu, cuda:0, …) auto
--weights-dir PATH Local directory with .joblib files (overrides HF Hub)

proteinloc models download

Pre-fetch classifier artifacts for offline use.

# Download all models
proteinloc models download

# Download a specific model
proteinloc models download --model esm_300

proteinloc info

Show authorship, project context, and version information.

proteinloc models-list

List all available embedding models and their classifier details.

proteinloc output-formats

List available output formats and their descriptions.


Authorship & Context

proteinloc was developed by Juan Diego Puglia as part of a Degree Thesis in Biotechnology at Universidad ORT Uruguay.

The project aims to leverage the power of Protein Language Models (pLMs) to provide fast and accurate subcellular localization predictions for prokaryotic research.


Developing

To set up a local development environment:

  1. Clone the repository:

    git clone https://github.com/jpuglia/proteinloc
    cd proteinloc
    
  2. Install dependencies using uv:

    uv sync
    
  3. Run tests:

    uv run pytest tests/ -v
    

License

MIT © Juan Puglia

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

proteinloc-0.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

proteinloc-0.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file proteinloc-0.1.0.tar.gz.

File metadata

  • Download URL: proteinloc-0.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for proteinloc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 040384b14248e78b9bfcd2d1623de8688dbf515f5e1cec10b72852271d41f967
MD5 fe3d614c075bc0a2d21ab5e92b5ef3ae
BLAKE2b-256 450cc6bda074f65cfa2834e3a08c75502f75b7c92b0996a904b2fa6e16a66f1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for proteinloc-0.1.0.tar.gz:

Publisher: publish.yml on jpuglia/proteinloc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file proteinloc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: proteinloc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for proteinloc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b281807276b6d198182f54e8170b0246f699481dc75c6923fe82648b3a2d57c3
MD5 5280f116682d68fc8653e1081b6ae94c
BLAKE2b-256 427dc31056ed0ca1b81dff023a8e2dd979a3507ac3914159bd5300adbc3c81fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for proteinloc-0.1.0-py3-none-any.whl:

Publisher: publish.yml on jpuglia/proteinloc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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