PDB Backbone Torsion Sampler

Version 1.0.4 (22.5 KB) by Foster
Apply random backbone torsion perturbations to PDB structures while maintaining RMSD and clash constraints. Generates comprehensive plots.
1 Download
Updated 3 Apr 2026

View License

`torsion_sampler` iterates over every backbone phi and psi angle in a PDB structure and applies a random Gaussian perturbation. Each trial rotation is accepted only if:
  1. The Kabsch-aligned Cα RMSD from the original structure remains below a user-defined threshold.
  2. No steric clashes are introduced (heavy-atom distance check via k-nearest neighbors).
When a perturbation is rejected, the Gaussian standard deviation is geometrically shrunk and the angle is resampled, up to a configurable number of attempts. Sidechain conformations are left unchanged.
Rotations are applied via the Rodrigues formula to the minimal atom moveset on one side of each bond, restricted to the parent chain. Multi-chain PDB files are fully supported.
Requirements:
  • | Bioinformatics Toolbox (pdbread, pdbwrite, ramachandran, pdbdistplot, pdbsuperpose)
  • Statistics and Machine Learning Toolbox (knnsearch)
Quick start:
% Using default parameters
results = torsion_sampler('1ZDB.pdb', 'perturbed');
% With custom options
results = torsion_sampler('1ZDB.pdb', 'perturbed', ...
'noise_std_deg', 10, ...
'max_rmsd', 2.0, ...
'verbose', true);

Cite As

Foster (2026). PDB Backbone Torsion Sampler (https://ch.mathworks.com/matlabcentral/fileexchange/183570-pdb-backbone-torsion-sampler), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2025b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.4

Add sample pdb file

1.0.3

Add image

1.0.2

Update file package name

1.0.1

Update sample files

1.0.0