Registry / ai-ml / pydssp

pydssp

JSON →
library0.9.1pypypi✓ verified 86d ago

PyDSSP is a simplified implementation of the DSSP algorithm for assigning secondary structure to protein structures from 3D coordinates. It supports both PyTorch and NumPy backends. Current version is 0.9.1, with a relatively stable release cadence of a few minor versions per year.

pip install pydssp
INSTALL
IMPORT
SIG · PYDSSP
P
pydssp
ai-mlpythonv0.9.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

assign
from pydssp import assign
import pydssp
The main function is 'assign'; importing the module alone doesn't bring assign into scope directly, must use from pydssp import assign.
pydssp.assign
from pydssp import assign; assign(...)
pydssp.assign(...)
If you import pydssp, you must call pydssp.assign, not pydssp.assign.

Assign secondary structure to a protein backbone (N, CA, C atoms) using NumPy backend.

import numpy as np from pydssp import assign # Example coordinates (protein backbone N, CA, C atoms) coords = np.random.randn(10, 3, 3) # 10 residues, 3 atoms, 3 coords secondary = assign(coords, backend='numpy') print(secondary)
Debug
Known issues
gotchaThe input coordinate array shape must be (n_residues, 3, 3) for NumPy, or (batch, n_residues, 3, 3) for PyTorch. A common mistake is to provide (n_residues, 3) or (n_residues, 9).
fix
Ensure coordinates are reshaped to (n_residues, 3, 3) where the last dimension is x,y,z for N, CA, C.
affects: all
gotchaThe backend must be explicitly set to 'numpy' or 'pytorch'. Default is None, which will raise an error.
fix
Pass backend='numpy' or backend='pytorch' to assign().
affects: >=0.9.0
Errors
Common errors & fixes
ValueError: The number of residues must be more than 0
Empty or single-residue input array.
fix
Provide at least 2 residues (n_residues >= 2).
TypeError: assign() missing 1 required positional argument: 'coords'
Calling assign() without arguments or misplacing arguments.
fix
Call assign(coords=your_array, backend='numpy').
Upgrade
Version history
0.9.1latest on PyPI · released Feb 24, 2025
Audit
Dependencies
torchoptionalRequired for PyTorch backend
numpyoptionalRequired for NumPy backend
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
pydssp — pip install pydssp · libregistry