Skip to main content

structpick

tests PyPI Python

Pick a protein structure to dock against.

Given a UniProt accession, structpick lists the experimental structures from the PDB ranked by sequence coverage and resolution, shows which ones have a real ligand bound (ignoring glycerol, sulfate, ions and other crystallisation leftovers) and reports the AlphaFold model as a fallback. It's the first step of most structure-based drug design projects, and usually it means clicking through a dozen PDB pages.

$ structpick list Q27743 --holo --max-resolution 2.0 --top 5
Q27743: L-lactate dehydrogenase | Plasmodium falciparum (isolate CDC / Honduras) | 316 aa
rank  pdb_id  chain  method             resolution  coverage  residues  ligands
1     4plz    A      X-ray diffraction  1.05        100%      1-316     NAI,OXM
2     1t2d    A      X-ray diffraction  1.10        100%      1-316     NAD,OXL
3     2a94    A      X-ray diffraction  1.50        100%      2-316     AP0
4     1t24    A      X-ray diffraction  1.70        100%      1-316     NAD,OXQ
5     1u4o    A      X-ray diffraction  1.70        100%      2-316     NDD
AlphaFold: AF-Q27743-F1 v6, mean pLDDT 97.4, 98% of residues very high confidence

Looking for a structure of EGFR with erlotinib (AQ4) bound:

$ structpick list P00533 --method xray --ligand AQ4 --top 3
P00533 (EGFR): Epidermal growth factor receptor | Homo sapiens | 1210 aa
rank  pdb_id  chain  method             resolution  coverage  residues  ligands
1     1m17    A      X-ray diffraction  2.60        28%       695-1022  AQ4
2     4hjo    A      X-ray diffraction  2.75        28%       696-1022  AQ4
AlphaFold: AF-P00533-F1 v6, mean pLDDT 75.9, 47% of residues very high confidence

Install

pip install structpick

Python 3.10 or newer. The only dependency is httpx.

Usage

structpick list <accession> [filters] [--top N] [--format table|csv|json]
structpick fetch <accession> [filters] [-o DIR] [--alphafold]
Option Meaning
--max-resolution 2.0 drop entries worse than 2.0 Å (also drops NMR, which has no resolution)
--min-coverage 0.8 keep chains covering at least 80% of the UniProt sequence
--method xray xray, em, nmr or the full PDBe method name
--ligand HEM only chains with this ligand bound
--holo only chains with any ligand that isn't an additive or ion

fetch downloads the best match as mmCIF from RCSB. If nothing matches the filters, or with --alphafold, it downloads the AlphaFold model instead.

--format csv and --format json are meant for scripts and notebooks:

structpick list P00533 --holo --format csv > egfr_structures.csv

From Python

from structpick import Filters, select_structures
from structpick.api import Client

with Client() as client:
    structures = client.with_ligands(client.structures("P00533"))
    best = select_structures(structures, Filters(max_resolution=2.5, require_ligand=True))
    for s in best[:3]:
        print(s.pdb_id, s.chain, s.resolution, [lig.code for lig in s.bound_ligands])

How ranking works

  1. Coverage, compared in 10% steps, so a chain covering 99% and one covering 100% count as equal.
  2. Resolution, best first. Entries without a resolution (NMR) go last.

Ligands only count if they sit on the same chain and aren't in the additive list (water, glycerol, ethylene glycol, PEG, sulfate, phosphate, common buffers, ions, detergents). Metal ions are on that list too, so check catalytic metals yourself when they matter.

Data sources

Requests time out after 30 s and are retried with exponential backoff on 429 and 5xx responses. Ligands are only looked up for the chains left after the other filters, one request per PDB entry.

Development

git clone https://github.com/felipsoliveira/structpick
cd structpick
uv sync                   # or: pip install -e . pytest pytest-cov ruff mypy
uv run pytest             # offline, uses recorded API responses in tests/fixtures
uv run pytest -m network  # hits the real APIs
uv run ruff check . && uv run mypy

License

MIT

Metadata

Release files for structpick 0.1.0

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

Source distribution (sdist)

Source distribution for structpick 0.1.0
File Size Uploaded Provenance Actions
structpick-0.1.0.tar.gz 73.7 kB With provenance Details for structpick-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 85.5 kB

Release files / structpick-0.1.0.tar.gz

Download URL structpick-0.1.0.tar.gz
Size 73.7 kB
Tags Source
SHA-256 checksum
How to use checksums
26f358187e7bec80f13a9d9cdad91408f5b4fa5cfa0eb03c53f0d052d1bf7ca6
BLAKE2b-256 checksum
How to use checksums
2c2d8997f7e61ee63d636326347aad49c6140612d9b3cced217e6210d9ed65d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / structpick-0.1.0-py3-none-any.whl

Download URL structpick-0.1.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00922f0c3ad56adf59076893c2275de6f56e5bdc9c547893ae2d8798f9678746
BLAKE2b-256 checksum
How to use checksums
a1d9b28dd377b6494c3d1c614a2fc9268aabb3b618a2be6ceb04bcf7e1fd3e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for structpick 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for structpick-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

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