Beta-barrel-like chain detector for PDB/mmCIF structures.
Project description
Cooper-Beta
Cooper-Beta detects beta-barrel-like protein chains in PDB, CIF, and mmCIF structures. It parses structures with Biopython, runs DSSP, slices beta-sheet C-alpha coordinates, fits ellipses to cross sections, applies geometric consistency rules, and returns chain-level results.
Quick Start
Cooper-Beta requires Python 3.10 or newer and a DSSP executable (mkdssp or
dssp) on PATH.
pip install cooper-beta
cooper-beta --check-env
cooper-beta path/to/structures --out cooper_beta_results.csv
If DSSP is installed outside PATH, pass its location as a configuration
override:
cooper-beta path/to/structures runtime.dssp_bin_path=/absolute/path/to/mkdssp
Installation
Install the detector:
pip install cooper-beta
Install optional tools:
pip install "cooper-beta[eval]" # pandas for evaluation helpers
pip install "cooper-beta[full]" # all optional extras
For development from a source checkout:
pip install -e ".[full,dev]"
The repository also includes environment.yml and scripts/setup_env.sh for a
Conda or Mamba environment that installs DSSP from conda-forge:
bash scripts/setup_env.sh --dev
Command Line
Run Cooper-Beta on a single file or a directory:
cooper-beta path/to/structure.cif --out results.csv
cooper-beta path/to/structures --workers 8 --prepare-workers 8 --out results.csv
Useful options:
--check-env: print the Python executable and resolved DSSP executable.--workers: number of analysis worker processes.--prepare-workers: number of structure-preparation worker processes.--out: output CSV path.--version: print the installed Cooper-Beta version.
Advanced configuration uses Hydra-style KEY=VALUE overrides:
cooper-beta path/to/structures \
runtime.dssp_bin_path=/absolute/path/to/mkdssp \
analyzer.rules.angle.max_gap_deg=160 \
output.summary_limit=-1
Python API
The recommended Python entry point is detect, which returns a structured
PipelineRunResult. CSV output is written only when output is provided or
write_csv=True.
from cooper_beta import detect
run = detect(
"path/to/structures",
workers=4,
output="results.csv",
overrides={"runtime.dssp_bin_path": "/usr/bin/mkdssp"},
)
print(run.result_counts)
for row in run.rows:
print(row.filename, row.chain, row.result, row.reason)
Public interfaces:
cooper_beta.detect(...): run detection and return structured results.cooper_beta.main(...): backward-compatible entry point returning row dicts.cooper_beta.build_config(...): build anAppConfigfrom overrides.cooper_beta.PipelineRunResult: complete run result withrows,input_files,output_path, andresult_counts.cooper_beta.DetectionResult: one chain-level result row.cooper_beta.ProteinLoader: parse structures and collect per-chain C-alpha and DSSP annotations.cooper_beta.PCAAligner,ProteinSlicer, andBarrelAnalyzer: lower-level analysis components for custom workflows.
User-facing failures raise Cooper-Beta exceptions such as
InputValidationError, DsspNotFoundError, DsspError, StructureParseError,
and ChainNotFoundError.
Output
The result CSV includes one row per chain. Core columns include:
filenameandchainresult:BARREL,NON_BARREL,FILTERED_OUT, orERRORresult_stageandreasondecision_score,decision_basis, anddecision_thresholdscore_rawandscore_adjustvalid_layers,scored_layers,total_layers,junk_layers, andinvalid_layerschain_residues,sheet_residues, andinformative_slices
Large directory runs use bounded prepare and analysis batches, and the CLI writes
the CSV incrementally. The console summary is capped by default; set
output.summary_limit=-1 to print every row.
Evaluation Helpers
Evaluation utilities are available after installing cooper-beta[eval]:
cooper-beta-eval \
--positives path/to/positive-structures \
--negatives path/to/negative-structures \
--save-dir evaluation-results
python -m cooper_beta.evaluation \
--positives path/to/positive-structures \
--negatives path/to/negative-structures \
--ablation
The GitHub repository also contains helper scripts for local datasets and Cooper-Beta CSV outputs. Local structure datasets, manual review notes, and research-only helper scripts are intentionally excluded from the package artifacts.
Changelog
0.1.0
- Initial public release.
- CLI and Python API for PDB/CIF/mmCIF beta-barrel-like chain detection.
- DSSP-backed secondary-structure parsing.
- Ellipse fitting, PCA axis search, geometric rules, and CSV output.
- Evaluation helpers and ablation utilities.
License
Cooper-Beta is released under the MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
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 cooper_beta-0.1.0.tar.gz.
File metadata
- Download URL: cooper_beta-0.1.0.tar.gz
- Upload date:
- Size: 61.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7299d75f162c491fb95aac2d1e9ea2b3d169ae59438f89a5f4fba80279a9077a
|
|
| MD5 |
14b9a6a1841ab6199950fb4321231f29
|
|
| BLAKE2b-256 |
cc733feecad1c01da989350b4746471a9a090002c62d343c0bf2260ceedfb0b0
|
Provenance
The following attestation bundles were made for cooper_beta-0.1.0.tar.gz:
Publisher:
publish.yml on GeraltZeroZhong/Cooper-Beta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cooper_beta-0.1.0.tar.gz -
Subject digest:
7299d75f162c491fb95aac2d1e9ea2b3d169ae59438f89a5f4fba80279a9077a - Sigstore transparency entry: 1382992812
- Sigstore integration time:
-
Permalink:
GeraltZeroZhong/Cooper-Beta@cf98264bead66a96cf97eb937d11abf954a2a0bd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/GeraltZeroZhong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cf98264bead66a96cf97eb937d11abf954a2a0bd -
Trigger Event:
release
-
Statement type:
File details
Details for the file cooper_beta-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cooper_beta-0.1.0-py3-none-any.whl
- Upload date:
- Size: 57.4 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 |
fa0bfebc79a2910c413be9f8fe1c06864582ef90b234a5383ee8a55aa6c51b64
|
|
| MD5 |
b7a0d4d2e8e6a517a16c25c1751c66d8
|
|
| BLAKE2b-256 |
85fbc07d7b50b5d1f8133a485654a5790dead96f5de54e2ea82dd2c882a5e018
|
Provenance
The following attestation bundles were made for cooper_beta-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on GeraltZeroZhong/Cooper-Beta
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cooper_beta-0.1.0-py3-none-any.whl -
Subject digest:
fa0bfebc79a2910c413be9f8fe1c06864582ef90b234a5383ee8a55aa6c51b64 - Sigstore transparency entry: 1382992924
- Sigstore integration time:
-
Permalink:
GeraltZeroZhong/Cooper-Beta@cf98264bead66a96cf97eb937d11abf954a2a0bd -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/GeraltZeroZhong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cf98264bead66a96cf97eb937d11abf954a2a0bd -
Trigger Event:
release
-
Statement type: