Skip to main content

structpick

tests PyPI Python

Pick a protein structure to dock against.

Given a UniProt accession, structpick combines target metadata with experimental structures from PDB/PDBe, ranks them by sequence coverage and resolution, and checks which structures have a non-additive ligand bound on the target chain. If no experimental structure matches the filters, AlphaFold is available as a fallback. It turns the first step of structure-based drug design from manually checking many PDB pages into one reproducible command.

How structpick finds a docking structure

$ 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. Ligand metadata is fetched only after the other filters, for unique PDB entries in batches of up to 500 IDs per request; this replaces one serial ligand-lookup request per 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.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 structpick 0.1.1
File Size Uploaded Provenance Actions
structpick-0.1.1.tar.gz 76.0 kB With provenance Details for structpick-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 88.2 kB

Release files / structpick-0.1.1.tar.gz

Download URL structpick-0.1.1.tar.gz
Size 76.0 kB
Tags Source
SHA-256 checksum
How to use checksums
33e2ed5cf6da1c86c4fba14f3552930ff6d9f7d6d20cfe3c02b43b9f89a504e2
BLAKE2b-256 checksum
How to use checksums
f6179e725ffcdcd3099f5638e57ff1e3486891c3d99a046c3461a3484b23185e
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.1-py3-none-any.whl

Download URL structpick-0.1.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bac949e9c74617602a4d73abe7d9c1aa93b2867e9f3775358e11ee1086b41c4
BLAKE2b-256 checksum
How to use checksums
18e800b51a2b6864faa6a5b3dc343c5c955a8870a9afddb34b42778e030f8e89
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.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.

Full provenance

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

Select from 2 files

Attestation for structpick-0.1.1.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