A CLI tool and Python library to analyse protein structure files
Project description
Proteinspy
A CLI tool and Python library for analysing protein structure files.
Supports .cif, .mmcif, .pdb, .ent, and their .gz compressed variants.
Full documentation: akhilteja2209.github.io/Proteinspy
Installation
pip install proteinspy
Windows note
If proteinspy is not recognised after installation, add the Python Scripts
folder to your PATH. Run this once in PowerShell:
$scriptsPath = python -c "import sysconfig; print(sysconfig.get_path('scripts', 'nt_user'))"
$env:PATH += ";$scriptsPath"
[System.Environment]::SetEnvironmentVariable("PATH", $env:PATH, "User")
Then restart PowerShell and run proteinspy again.
Quick start
# See all commands with
proteinspy
# Or
proteinspy --help
# Run all basic analyses on a structure file
proteinspy analyze my_protein.cif
# Works with PDB format too
proteinspy analyze my_protein.pdb
Commands
Format: proteinspy <command> <file> [--output table|json|csv|tsv]
Basic analyses
| Command | Description |
|---|---|
analyze |
Run all basic analyses — resolution, chains, ligands, missing residues |
resolution |
Crystallographic resolution and experimental method |
chains |
All polymer chains with type and residue count |
ligands |
Non-solvent ligand molecules |
missing |
Residues present in the sequence but absent from ATOM records |
Advanced analyses
| Command | Description |
|---|---|
bfactor |
B-factor (temperature factor) statistics — global and per chain |
disulfide |
Disulfide bonds detected by SG–SG distance (≤ 2.5 Å) |
interface |
Inter-chain interface residues by Cα distance (default cutoff 5.0 Å) |
validate |
Quick quality check — resolution, completeness, model count |
export |
Export any analysis to a .json, .csv, or .tsv file |
Examples
# Basic analyses
proteinspy analyze my_protein.cif
proteinspy resolution my_protein.cif
proteinspy chains my_protein.cif
proteinspy ligands my_protein.cif
proteinspy missing my_protein.cif
# Advanced analyses
proteinspy bfactor my_protein.cif
proteinspy disulfide my_protein.cif
proteinspy interface my_protein.cif --cutoff 8.0
proteinspy validate my_protein.cif
# Output formats — any command supports --output / -o
proteinspy chains my_protein.cif --output json
proteinspy bfactor my_protein.cif --output csv
proteinspy analyze my_protein.cif -o tsv
# Export to file (format inferred from extension)
proteinspy export my_protein.cif report.json
proteinspy export my_protein.cif chains.csv --analysis chains
proteinspy export my_protein.cif bonds.json --analysis disulfide
Output formats
Every command accepts --output (or -o):
| Format | Flag | Use case |
|---|---|---|
| Rich table | --output table |
Default — coloured terminal output |
| JSON | --output json |
Downstream scripts, APIs |
| CSV | --output csv |
Excel, pandas, R |
| TSV | --output tsv |
Tab-separated, bioinformatics pipelines |
Supported file formats
| Extension | Format |
|---|---|
.cif, .mmcif, .pdbx |
mmCIF (recommended) |
.pdb, .ent |
Legacy PDB format |
Any of the above + .gz |
Gzip-compressed |
Python API
You can import and use every analysis function directly:
from proteinspy import get_resolution, get_chains, get_bfactor_stats
from proteinspy import to_json, write_output
# Basic
result = get_resolution("my_protein.cif")
print(result["resolution"], result["method"])
# Advanced
stats = get_bfactor_stats("my_protein.cif")
print(stats["overall"]["mean"])
# Export
write_output(get_chains("my_protein.cif"), "json", output_path="chains.json")
Check out API Reference for the list of all the functions.
Requirements
pipinstalled on device- Python 3.10 or later
- Dependencies installed automatically:
gemmi,rich,click
Contributing
Contributions are welcome — new analyses, output formats, bug fixes, or docs. See CONTRIBUTING.md for setup instructions, code standards, and how to add a new analysis command.
Documentation
Full Installation and usage guides at akhilteja2209.github.io/Proteinspy
Version: 1.1.5
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file proteinspy-1.1.5.tar.gz.
File metadata
- Download URL: proteinspy-1.1.5.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42464eb0789bf8a5cad0c1dc361691ee8c1b61e0d584d7c801abc7a4cf6b17b8
|
|
| MD5 |
aa770b4cfd3201a634b5552a6004deb3
|
|
| BLAKE2b-256 |
df12dba184f7ed42377234a6fdddf20b75ec2406fdb56aed5d266886ac89a190
|
Provenance
The following attestation bundles were made for proteinspy-1.1.5.tar.gz:
Publisher:
publish.yml on AkhilTeja2209/Proteinspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proteinspy-1.1.5.tar.gz -
Subject digest:
42464eb0789bf8a5cad0c1dc361691ee8c1b61e0d584d7c801abc7a4cf6b17b8 - Sigstore transparency entry: 1820706627
- Sigstore integration time:
-
Permalink:
AkhilTeja2209/Proteinspy@cafc4478b3ae0c84ce5dc8a0522ff10315f51124 -
Branch / Tag:
refs/tags/v1.1.5 - Owner: https://github.com/AkhilTeja2209
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cafc4478b3ae0c84ce5dc8a0522ff10315f51124 -
Trigger Event:
release
-
Statement type:
File details
Details for the file proteinspy-1.1.5-py3-none-any.whl.
File metadata
- Download URL: proteinspy-1.1.5-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60974726c8b329024af400f6cda8ade1d30b4076574263f377266858791c93b6
|
|
| MD5 |
5ffdd6402709df0f8eca4405f3476c95
|
|
| BLAKE2b-256 |
5bc88a67984a2a197838a5ae97dbd92ed5bda61bbe41fa7e7518271a4da71c04
|
Provenance
The following attestation bundles were made for proteinspy-1.1.5-py3-none-any.whl:
Publisher:
publish.yml on AkhilTeja2209/Proteinspy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proteinspy-1.1.5-py3-none-any.whl -
Subject digest:
60974726c8b329024af400f6cda8ade1d30b4076574263f377266858791c93b6 - Sigstore transparency entry: 1820706636
- Sigstore integration time:
-
Permalink:
AkhilTeja2209/Proteinspy@cafc4478b3ae0c84ce5dc8a0522ff10315f51124 -
Branch / Tag:
refs/tags/v1.1.5 - Owner: https://github.com/AkhilTeja2209
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cafc4478b3ae0c84ce5dc8a0522ff10315f51124 -
Trigger Event:
release
-
Statement type: