Skip to main content
TSR Research Group

Triangular Spatial Relationship (TSR)

An alignment-free method for comparing 3D protein structures. Every triangle formed by a structure's Cα atoms is encoded as an integer "key", and the structure is represented by its distinct keys and how often each occurs.

Read the paper: Development of a TSR-Based Method for Protein 3-D Structural Comparison With Its Applications to Protein Classification and Motif Discovery (opens in a new tab)Frontiers in Chemistry, 2021

Flowchart of the published TSR method. Three Cα atoms (Leu, Ile and Phe in PDB entry 2ZOQ) form a triangle and their amino acids are labelled l1, l2 and l3. Four rule-based cases order the labels, using the edge lengths d12, d13 and d23 to break ties. The angle θ1 and the distance d3 are computed from the median drawn from the midpoint of edge d12, θ is folded to at most 90 degrees, both are binned, and keys are calculated for all C(n,3) triplets.
The key generation steps and label-assignment rules as published (Kondra et al., 2021).

Overview

The Triangular Spatial Relationship (TSR) method is an approach for comparing 3D protein structures, designed to overcome the limitations of existing structural comparison techniques. Each triangle of Cα atoms receives an integer "key" that encodes its three residue labels and the classes its angle and longest edge fall into, so different triangles can share a key. By representing a protein structure as its distinct keys and their frequencies, TSR provides a comprehensive and efficient way to analyse structural similarities and substructures without needing superimposition or complex alignment.

Key generation process

  • Cα atom selection. TSR begins by selecting Cα atoms from the protein's PDB file as vertices for triangle construction.
  • Triangle construction. All possible triangles formed by these Cα atoms are generated, with their edge lengths and internal angles calculated.
  • Label assignment. Each Cα is assigned an integer identifier (ranging from 4 to 23) which uniquely represents the amino acid. This ensures that identical triangles across different proteins are assigned the same integer identifiers.
  • Key calculation. The identifiers for each triangle are transformed to create labels (li1, li2, li3). Using a rule-based formula, distances and specific angles are determined, which are then used in equations to generate an integer key for each triangle. Triangles with the same labels and the same angle and distance classes receive the same key.
  1. A 3D structure

    Ubiquitin, PDB entry 1UBQ, chain A, drawn as a flat projection of its backbone.

  2. Selected points

    One Cα atom per residue: 76 points. Atomic methods use heavy atoms; cross methods take points from two named sides.

  3. Triangles

    Every three points form a triangle: 70,300 here. One is followed: Val70, Ile44, Leu8.

  4. Labels and geometry

    The labels order the vertices L1, L2, L3, and θ is measured on the base, L1–L2. maxDist is the longest edge: here L2–L3, not the base.

  5. Classes and one key

    θ and maxDist are each binned into a class. The three labels and the two classes are encoded as one integer key.

  6. Count and compare

    A structure is described by which keys occur and how often. Structures are compared through the keys they share.

From a structure to TSR keys, for one triangle of ubiquitin. Computed with BioTSR 1.0.0 (protein Cα TSR, 1UBQ chain A). The structure is a 2-D projection; the triangle in the geometry step is drawn to scale. Step 6 is schematic. The worked example below gives the numbers.

Worked example

The triangle followed in the figure, Val70–Ile44–Leu8 of 1UBQ chain A, as BioTSR 1.0.0 computes it.

Vertices, in label order
L1 Val70 (label 20), L2 Ile44 (label 10), L3 Leu8 (label 8)
Base, L1–L2
7.78 Å
L1–L3
6.56 Å
L2–L3
11.96 Å, the longest edge, so maxDist
θ
136.7° measured towards L2, folded to 43.3°
θ class
11 of 29: 42.64° to under 45.17°
Distance class
5 of 35: 11.00 to under 14.00 Å
Key
17,637,781

The base is chosen by the vertex labels, so it need not be the longest edge, and here it is not: the base is 7.78 Å and maxDist is 11.96 Å.

A key records the labels and the two classes, not the whole triangle. 4 triangles in 1UBQ have this one: their θ lies between 43.3° and 44.4° and their longest edges between 11.0 and 13.2 Å, but their bases run from 7.8 to 12.2 Å.

How the key is encoded

The key is one mixed-radix integer. The labels are digits of base 30: 19·30² + 9·30 + 7 = 17,377. That is weighted by the 35 distance classes and the 29 angle classes, and the two classes are added in, each counted from 0: 17,377·35·29 + 4·29 + 10 = 17,637,781.

All 4 triangles with key 17,637,781
Triangle (L1–L2–L3)Base, L1–L2L1–L3L2–L3maxDistθ
Val70–Ile44–Leu87.78 Å6.56 Å11.96 Å11.96 Å43.3°
Val5–Ile61–Leu5612.24 Å13.22 Å5.60 Å13.22 Å43.7°
Val17–Ile61–Leu1510.63 Å6.20 Å13.11 Å13.11 Å44.4°
Val70–Ile36–Leu7111.02 Å3.83 Å8.70 Å11.02 Å44.0°

The first row is the triangle in the figure. The longest edge is a different edge in different rows, and the shapes differ; what the four share is their labels, their θ class and their distance class.

See it in 3D: Four triangles, one key lets you rotate ubiquitin and switch between the four triangles of this example.

Distinguishing features

  • No structural superimposition. TSR avoids rotation and translation issues, unlike RMSD-based methods, enabling more consistent structural comparison.
  • Shape representation. By using triangles — the simplest form to capture shape — TSR effectively identifies local substructures.
  • Amino acid integration. The inclusion of amino acid information ensures that triangles with the same geometric properties but different amino acids are assigned different keys.
  • Motif discovery. TSR allows for the discovery of shared substructures, from simple triangles to complex motifs, by identifying connected triangles through shared vertices or edges.

Applications

  • Structural comparison. TSR quantifies protein similarity based on the number of identical keys, providing insight into protein relationships.
  • Motif search. Capable of identifying unique and conserved motifs across protein families.
  • Conformational analysis. TSR can capture protein conformational changes and differentiate between homologous and non-homologous structures.

Run it with BioTSR

BioTSR computes protein Cα TSR keys for one chain with one command. To install it, download ubiquitin and compute the keys of its chain A:

bash
python -m pip install "biotsr==1.0.0"
biotsr fetch 1UBQ --pdb-dir structures
biotsr run --method protein --pdb structures/1UBQ.pdb --chain A --output results

This writes results/1UBQ_A_protein.keys, with every key of the chain and how often it occurs, together with the list of triangles and two records of how the result was computed. Getting started explains each file and sets up a virtual environment first. New to BioTSR? Learn BioTSR has an interactive lesson and a guided notebook built on this example.

Amino acid grouping, mirror images, size filtering and secondary structure annotation are options of this same command rather than separate programs. Tutorial 01 shows the first three, and tutorial 03 the secondary-structure annotation. For many structures, biotsr batch runs a CSV manifest (tutorial 05); for an HPC cluster, the command-line guide, §12 has example Slurm job scripts.

Residue labels in BioTSR

In the published method, each Cα is labelled with one of 20 codes, 4 to 23, one for each standard amino acid. BioTSR keeps those 20 codes and adds codes 24 to 33 for ten modified residues, such as phosphothreonine (TPO) and phosphoserine (SEP); selenomethionine (MSE) takes methionine's code. The three labels of a triangle are encoded at radix 30, so two different combinations of residue labels never produce the same key. Keys computed under this scheme are compared only with keys computed under the same scheme.

How BioTSR differs from the earlier implementation

BioTSR has no option to reproduce the output of TSR-Package, the method's first implementation. For protein Cα TSR its documentation lists four differences from that program:

  • angles are divided by π, where the earlier program used the literal 3.14, which moves some triangles across an angle-class boundary;
  • the highest of the 35 distance classes can be reached, where the earlier program had 34 in effect;
  • grouped labels are encoded at radix 30 rather than within the 20-label space;
  • modified residues written as HETATM records, such as TPO and SEP, are read as points, where the earlier program read ATOM records only.

The SSE-TSR method record, §7 gives the details, and the known limitations, §1 the general rule.

Source code

  • BioTSR (opens on GitHub)

    Current software

    Used by the examples on this page.

    Language: Python

    Licence Apache License 2.0

  • TSR-Package (opens on GitHub)

    Earlier implementation

    The method's first implementation. It is kept unchanged for provenance and for work that depends on it; its README has its own installation instructions.

    Language: Python

    Licence MIT License