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] Embedding model (required)
--output-format [table|json|csv] Output format table
--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.1.tar.gz (13.5 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.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: proteinloc-0.1.1.tar.gz
  • Upload date:
  • Size: 13.5 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.1.tar.gz
Algorithm Hash digest
SHA256 3b2388d8b1651b7d796e544f41322f8c21d102e4a020f7feccb9a8487e4553a5
MD5 060e7baeffac6c47fc43e24f67fb163f
BLAKE2b-256 7bfb57a0400b4ffadab4369f959cccce605f9aec570973d3bd8f06fef0da1943

See more details on using hashes here.

Provenance

The following attestation bundles were made for proteinloc-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: proteinloc-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ad4392b4a449b62bc439ec9816f542045eef4bc583e9300cef83e513fe8c99d
MD5 8bd43d4e2c29417f776b9597e9a15c1f
BLAKE2b-256 b2522d8929b8c17915cb8e4c7b67c4ad9c528e73a6598df7b0ccadbf308d4a7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for proteinloc-0.1.1-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