skillfed

pydssp

A simplified implementation of DSSP algorithm for PyTorch and NumPy

pydssp v0.9.1 99.4K downloads/30d#13,023 on PyPI104
Permissive license MIT AGING released

What it is and what it does

PyDSSP is a Python implementation of the DSSP (Dictionary of Secondary Structure of Protein) algorithm that classifies each residue in a protein backbone as alpha-helix (H), beta-strand (E), or loop (-). It takes 3D atomic coordinates as input and outputs secondary structure assignments. The package is not a complete reimplementation of the original 1983 DSSP algorithm—it simplifies some parts, such as omitting β-bulge annotation and using slightly different hydrogen-placement parameters—but achieves over 97% agreement with the original on average.

The main innovation is support for both NumPy arrays and PyTorch tensors, with the latter enabling differentiable computation. PyDSSP can output hydrogen-bond matrices as continuous values in [0, 1] rather than binary assignments, making it suitable for machine learning pipelines where gradients flow through structure prediction. It includes a command-line tool for batch processing PDB files and a Python API for programmatic use.

Use it for:

  • Assign secondary structure to protein backbones in molecular dynamics simulations or structure prediction pipelines.
  • Generate differentiable hydrogen-bond matrices for neural network training on protein structure tasks.
  • Batch-process multiple PDB files to extract C3 secondary structure annotations via the command-line tool.
  • Compute continuous hydrogen-bond scores for structure validation or quality assessment workflows.
  • Integrate structure assignment into deep learning models where gradients must flow through secondary structure computation.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyDSSP assigns protein secondary structure (alpha-helix, beta-strand, or loop) from backbone coordinates using a simplified DSSP algorithm, with support for both NumPy and differentiable PyTorch tensors.

Yes, if you need secondary structure assignment for protein backbones and can work with a simplified DSSP that omits β-bulge annotation. The 97% agreement with original DSSP is suitable for most applications. Install friction is low and the package is actively maintained. No security vulnerabilities are known. Choose this if you need PyTorch differentiability or batch processing; otherwise, consider the original DSSP or STRIDE for full feature parity.

Install

pydssp on PyPI

pip

pip install pydssp

uv

uv add pydssp

poetry

poetry add pydssp

Installing pydssp

Before you install

Low friction: pure Python wheel with four runtime dependencies (numpy, torch, einops, tqdm). Last release was 2025-02-24 and repository is active, though maintenance status is aging with no release in the past 536 days.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in commercial or private projects.

Quickstart

pip install pydssp

import torch
import pydssp

coord = torch.randn([10, 100, 4, 3])  # batch, length, atoms (N,CA,C,O), xyz
dssp = pydssp.assign(coord, out_type='c3')  # returns ['-', 'H', 'E', ...]

Requires PyTorch and NumPy installed; coordinates must be shaped as (batch, length, 4 or 5, 3) where atoms are N, CA, C, O backbone atoms (and optionally H).

Verify before relying

  • Whether the 97% agreement with original DSSP is sufficient for your specific downstream application.
  • Performance characteristics on large protein structures or batches beyond typical use.
  • Whether simplified parameters (hydrogen placement, no β-bulge support) affect your research domain.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 4 — numpy, torch, einops, tqdm
Maintenance aging — 536 days since the last release
Last repo commit
First released
Downloads 99,424/month — #13,023 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pydssp-0.9.1-py3-none-any.whl

Keywords: DSSP, Secondary Structure, Protein Structure

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.8

Tags

protein secondary structure predictionDSSP algorithm pythonprotein backbone annotationhydrogen bond detection proteinalpha helix beta strand assignmentprotein structure analysisdifferentiable DSSP torch
protein-structurebioinformaticsdifferentiable-computing

More Artificial Intelligence packages