Skip to main content

A Python package for drawing protein topology diagrams.

Project description

ProTopo

ProTopo is a lightweight Python package for drawing 2D protein topology diagrams — including α-helices, β-strands, linkers, N/C-terminals, and customizable markers.

It helps visualize and annotate simplified protein secondary structure layouts for publications, teaching, or design explanation.

GitHub repo | Issue page | Author


✨ Features

  • Simple, declarative interface (add_alpha, add_beta, add_linker)
  • Tracks residue indices and directions automatically
  • Custom triangle/marker support (for cuts, domains, etc.)
  • Outputs high-quality vector graphics via Matplotlib
  • Built-in EGFP topology example

📦 Installation

pip install protopo
# or if developing locally
poetry install

🚀 Quick Example

from protopo import ProTopo

pt = ProTopo()
pt.add_n_term()
pt.add_alpha(1, 10, label="H1", to="→")
pt.add_linker(10, 13, to="↓→", steps=(0.5, 0.5))
pt.add_beta(13, 22, label="S1", to="→")
pt.add_triangles([15])
pt.add_c_term()
pt.show()
# pt.save("demo.pdf")  # save fig
# pt.close()  # release memory

Qukck Example

🧪 Run EGFP Example

This renders the schematic topology diagram of Enhanced GFP, following literature-reported secondary structure layout.

from protopo.demo import draw_egfp
egfp = draw_egfp()
egfp.add_triangles(idx=[6, 211])
egfp.show()
# egfp.save("egfp.svg")
# egfp.close()  # release memory

then you will see

EGFP demo

🧪 Testing

poetry run pytest

License

MIT License © Huanan Herman Zhao

Contribution

Welcome to contribute codes and ideas

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

protopo-0.1.9.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

protopo-0.1.9-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file protopo-0.1.9.tar.gz.

File metadata

  • Download URL: protopo-0.1.9.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0

File hashes

Hashes for protopo-0.1.9.tar.gz
Algorithm Hash digest
SHA256 6dd0f8c253b1f815086a73ed1a457ac8fcdc3e58e3cd4d4a9f8d535c255eeeb9
MD5 f87639b5139a1bf0ae38622afa316784
BLAKE2b-256 6199b93d5699cc10ee91f5b314aefbff79acb48d09e6fa7edb6c0ec0d94e74a2

See more details on using hashes here.

File details

Details for the file protopo-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: protopo-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0

File hashes

Hashes for protopo-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d5b6d4a2616927c0765f8c28be7ea4a1fea3647ce651b5b2a437432a0fc4065d
MD5 c2467beffa00a8cecc3080794d3e8b4e
BLAKE2b-256 45f0e0c1e873743b6690e43cf59d08d6674041f2fcae4447a06dc0d03af326c6

See more details on using hashes here.

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