WORKS / R.01 University research / Structural biology大学研究 / 構造生物学 / 2025—2026

PROTEINFLEXIBILITY

DSA — Distance Structure Analysis. Given one UniProt ID, it gathers every solved structure of that protein and measures how much each pair of residues moves between them, without ever superposing the structures.DSA(Distance Structure Analysis)。UniProt IDをひとつ与えると、そのタンパク質について解かれた構造をすべて集め、残基ペアごとに構造間でどれだけ動いているかを測ります。構造を重ね合わせる必要はありません。

2025—2026
Gakushuin University / Okada Lab学習院大学 / 岡田研究室
SECTOR領域
Research software研究用ソフトウェア
ROLE担当
Analysis design, engine implementation, API and interface解析設計、エンジン実装、API、インターフェース
YEAR
2025—2026
CONTEXT
Gakushuin University / Okada Lab学習院大学 / 岡田研究室
SOURCEソース
github.com/bbbyk105/protein-flexibility-platform

01 / PROJECT

WHAT THE
PROBLEM IS.

The question is which parts of a protein are rigid and which are flexible. The usual way to answer it is to superpose structures on one another, but superposition needs a reference frame, and the answer changes with the frame you pick.タンパク質のどの部分が硬く、どの部分が柔らかいのかを知りたい、という問いから始まっています。通常は構造同士を重ね合わせて答えを出しますが、重ね合わせには基準系が必要で、どの基準を選ぶかによって答えが変わってしまいます。

Distances between Cα atoms do not have that problem: the distance between two residues is the same however the structure is rotated or translated. So the analysis works entirely in distance space. For every pair of residues it collects the Cα–Cα distance across all the structures, then takes the mean and the standard deviation of that distance. A pair whose distance barely changes across dozens of structures is rigid; one whose distance scatters is flexible.Cα原子間の距離にはその問題がありません。2つの残基の距離は、構造をどう回転・平行移動させても変わらないからです。そこで解析はすべて距離空間で行います。残基ペアごとに全構造でのCα–Cα距離を集め、その平均と標準偏差を取ります。何十という構造を通して距離がほとんど変わらないペアは硬く、ばらつくペアは柔らかい、と判定できます。

The hard part is not the arithmetic — it is getting comparable data. The same protein appears in the PDB as dozens of entries with different chains, different constructs, engineered mutations, chimeras, expression tags, missing residues and inconsistent numbering. Most of the code exists to reconcile all of that against one UniProt sequence before a single distance is computed.難しいのは計算そのものではなく、比較できるデータを揃えるところです。同じタンパク質がPDBには何十というエントリとして存在し、チェーンも構築体も異なり、人工変異やキメラ、発現タグ、欠損残基、不揃いな残基番号が混在しています。コードの大部分は、距離を1つも計算しないうちに、それらをUniProtの配列ひとつに対して突き合わせるために存在しています。

02 / HOW IT WORKS

STEP BY STEP,
END TO END.

INPUT → OUTPUT PER STAGE各段階の 入力 → 出力

01
Resolve the proteinタンパク質を解決する

Fetch the UniProt entry as XML and read out the accession list, the canonical sequence and every cross-referenced PDB entry with its method and resolution.UniProtのエントリをXMLで取得し、アクセッション一覧、正規配列、そして相互参照されている全PDBエントリを構造決定法・分解能つきで読み出します。

accessions, FASTA, PDB table
02
Select structures構造を絞り込む

Keep only the determination methods asked for — X-ray and cryo-EM by default, NMR off, since an NMR ensemble would skew the spread. Explicitly excluded PDB IDs are dropped here, and the run stops early if too few entries survive.指定された構造決定法だけを残します。既定はX線と クライオ電顕で、NMRはオフです。NMRのアンサンブルはばらつきを歪めるためです。除外指定されたPDB IDもここで落とし、残るエントリが少なすぎれば実行を打ち切ります。

PDB ID list
03
Download and parse取得して解析する

Pull each structure as mmCIF through Biopython's PDBList and read it with MMCIF2Dict. Atom records are filtered to ATOM only, alternate locations are resolved to one per residue, and the coordinates are cached per PDB ID so a re-run does not re-download.各構造をmmCIFとしてBiopythonのPDBList経由で取得し、MMCIF2Dictで読みます。原子レコードはATOMのみに絞り、代替配座(altloc)は残基ごとに1つへ解決し、座標はPDB IDごとにキャッシュして再実行時の再ダウンロードを避けます。

atom_coord/{pdbid}.csv
04
Judge each entryエントリを判定する

Compare the structure's sequence references against UniProt and classify the entry as normal, substitution, chimera or delins. Differences annotated as expression tag, linker, conflict or microheterogeneity are ignored — they are artefacts of crystallography, not real sequence changes.構造側の配列参照をUniProtと突き合わせ、エントリをnormal / substitution / chimera / delinsに分類します。expression tag、linker、conflict、microheterogeneityと注釈された差分は無視します。これらは結晶学上の産物であって、実際の配列変化ではないためです。

normal / substitution / chimera / delins
05
Align to one sequenceひとつの配列に揃える

Lay every chain against the UniProt sequence, padding each to the same length from its alignment range. Chains where too few residues actually have coordinates are dropped by a ratio threshold, duplicate residue numbers are collapsed, and chains that will not align after a bounded shift search are discarded with a note.各チェーンをUniProt配列に対して並べ、アラインメント範囲から同じ長さになるよう前後を詰めます。実際に座標を持つ残基が少なすぎるチェーンは割合の閾値で落とし、重複する残基番号は畳み込み、範囲を区切ったシフト探索でも整合しないチェーンは理由を残して除外します。

aligned residue × chain table
06
Take the Cα coordinatesCα座標を取り出す

From the cached atom tables, keep only Cα atoms and assemble one matrix of coordinates: every surviving residue position down the rows, every surviving chain across the columns. Rows with any gap are removed, so every pair is measured on exactly the same set of structures.キャッシュした原子テーブルからCα原子だけを残し、座標の行列を1枚に組み立てます。行は残った残基位置、列は残ったチェーンです。欠けのある行は取り除くので、すべてのペアがまったく同じ構造集合の上で測られます。

residue × chain Cα matrix
07
Measure every pair全ペアを測る

For each of the N(N−1)/2 residue pairs, compute the Cα–Cα distance in every chain. The inner distance function is JIT-compiled with numba and rounds coordinates to a fixed precision first, so the same input always gives bit-identical output across runs.N(N−1)/2 通りの残基ペアそれぞれについて、全チェーンでCα–Cα距離を計算します。内側の距離関数はnumbaでJITコンパイルし、先に座標を固定精度へ丸めるため、同じ入力なら実行のたびにビット単位で同じ結果が出ます。

pair × chain distance matrix
08
Score the flexibility揺らぎをスコア化する

Per pair, take the mean and the population standard deviation of that distance across chains, then divide: score = mean / std. A pair that holds the same distance in every structure gets a high score; one that scatters gets a low one. Averaging the score over all pairs gives the protein a single number, UMF.ペアごとにチェーン間での距離の平均と母標準偏差を取り、平均÷標準偏差でスコアとします。どの構造でも同じ距離を保つペアは高スコア、ばらつくペアは低スコアです。全ペアで平均すると、そのタンパク質を1つの数値(UMF)で表せます。

score, UMF
09
Detect cis bondscis結合を検出する

Any residue pair whose Cα–Cα distance falls under the threshold — about 3.3 Å against the roughly 3.8 Å of a normal trans peptide bond — is a cis peptide bond. These are counted and scored separately, since a cis bond sitting in a flexible region means something different from one in a rigid core.Cα–Cα距離が閾値を下回る残基ペア(通常のtransペプチド結合の約3.8 Åに対して3.3 Å前後)をcisペプチド結合として検出します。これらは別途カウントしスコア化します。柔らかい領域にあるcis結合と、硬いコアにあるcis結合とでは意味が違うためです。

cis count, cis score
10
Reportレポートする

Emit a heatmap of the pair scores laid out as a residue × residue matrix, a per-residue score for colouring a 3D model, the full pair table as CSV, and a one-row summary — entries, chains, length, mean resolution, UMF, cis statistics — appended to a running CSV so results accumulate across proteins.ペアスコアを残基×残基の行列として配置したヒートマップ、3Dモデルの着色に使う残基ごとのスコア、ペア表のCSV全量、そしてエントリ数・チェーン数・長さ・平均分解能・UMF・cis統計を1行にまとめたサマリーを出力します。サマリーは追記式のCSVに積み上がり、タンパク質をまたいで結果が蓄積します。

heatmap.png, CSV, summary row

03 / ARCHITECTURE

THREE TIERS,
ONE PIPELINE.

01
Interface

Takes UniProt IDs and parameters, creates the job, polls it to completion, then renders the result: the structure in a 3D viewer coloured by per-residue score, the score plots, and the heatmap.UniProt IDとパラメータを受け取ってジョブを作成し、完了までポーリングしたうえで結果を描画します。残基ごとのスコアで着色した3Dビューア、スコアのプロット、ヒートマップを表示します。

Next.jsReactTypeScriptMol*RechartsTanStack QueryZustand
02
Job API

Splits a batch of UniProt IDs into one job each, assigns an ID, runs the analysis engine as a subprocess under a timeout, persists status and progress, and serves the finished artefacts. Long analyses survive a page reload because the job, not the request, holds the state.UniProt IDのまとまりを1件ずつのジョブに分割し、IDを振り、解析エンジンをタイムアウト付きのサブプロセスとして実行し、状態と進捗を永続化して、完成した成果物を配信します。状態を持つのはリクエストではなくジョブなので、長い解析でもページを再読み込みして問題ありません。

GoGinUUID
03
Analysis engine

The pipeline above, packaged as an installable library with a CLI. It runs on its own from a terminal, which is what makes it usable in the lab without the rest of the platform.上記のパイプラインを、CLIを備えたインストール可能なライブラリとしてパッケージしたものです。ターミナルから単体で動くので、プラットフォームの他の部分がなくても研究室で使えます。

PythonNumPypandasBiopythonnumbaPydanticClick

04 / THE CORE

THE WHOLE IDEA,
IN ONE DIVISION.

score.pyPython
# One row per residue pair, one column per chain.
dis   = distance.iloc[:, 2:]
means = dis.mean(axis='columns')
stds  = dis.std(axis='columns', ddof=0)

# Hold the same distance everywhere -> high score.
score = means / stds
Python7 LINES

05 / OUTPUT

WHAT IT
PRODUCES.

  1. 01

    UMF — one number per protein, the mean of mean/std over all residue pairsUMF — タンパク質ごとに1つの数値。全残基ペアの平均÷標準偏差の平均

  2. 02

    Pair scores — every residue pair with its mean distance, standard deviation and scoreペアスコア — 全残基ペアの平均距離、標準偏差、スコア

  3. 03

    Per-residue scores, used to colour the structure in the 3D viewer残基ごとのスコア。3Dビューアで構造を着色するのに使用

  4. 04

    A residue × residue heatmap of the pair scoresペアスコアの残基×残基ヒートマップ

  5. 05

    Cis peptide bonds: count, mean distance, spread and scorecisペプチド結合の個数、平均距離、ばらつき、スコア

  6. 06

    A summary row per run — entries, chains, length covered, mean resolution — appended to a cumulative CSV実行ごとのサマリー行(エントリ数、チェーン数、カバーした長さ、平均分解能)を累積CSVに追記

06 / TECHNOLOGY

THE STACK
BEHIND IT.

PythonNumPypandasBiopythonnumbaFastAPIGoGinNext.jsMol*
ALL WORKS実績一覧WORKSGET IN TOUCHお問い合わせ