macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

複数のタンパク質構造から多重構造アライメント(MTSA)を超高速に行う FoldMason

 

 タンパク質構造は配列を超えて保存されているため、遠縁のタンパク質を解析するには多重構造アライメント(MSTA)が不可欠である。計算予測法によって利用可能なタンパク質構造のリポジトリは大幅に拡張され、高速で正確なMSTA法が求められている。本稿では、ペアワイズ構造アライナーFoldseekとTM-alignを活用した、数十万のタンパク質構造の多重アライメントを行う革新的なMSTA法FoldMasonを紹介する。この手法は、最先端のMSTA法と同等かそれ以上のアライメント品質を実現しながら、2桁もの高速化を実現する。フラビウイルス科の糖タンパク質を用いて、FoldMasonのMSTAが「トワイライトゾーン」を超えた系統解析をサポートできることを実証する。FoldMasonは信頼スコアを計算し、インタラクティブな視覚化を提供し、正確な構造予測の時代に求められる大規模タンパク質構造解析に不可欠な速度と精度を提供する。FoldMasonは無料のオープンソースソフトウェアである。

 

インストール

Github

#Linux AVX2 build
wget https://mmseqs.com/foldmason/foldmason-linux-avx2.tar.gz; tar xvzf foldmason-linux-avx2.tar.gz; export PATH=$(pwd)/foldmason/bin/:$PATH

# Linux SSE2 build
wget https://mmseqs.com/foldmason/foldmason-linux-sse2.tar.gz; tar xvzf foldmason-linux-sse2.tar.gz; export PATH=$(pwd)/foldmason/bin/:$PATH

#Linux ARM64 build
wget https://mmseqs.com/foldmason/foldmason-linux-arm64.tar.gz; tar xvzf foldmason-linux-arm64.tar.gz; export PATH=$(pwd)/foldmason/bin/:$PATH

#MacOS
wget https://mmseqs.com/foldmason/foldmason-osx-universal.tar.gz; tar xvzf foldmason-osx-universal.tar.gz; export PATH=$(pwd)/foldmason/bin/:$PATH

#Conda
mamba create -n foldmason -y
conda activate foldmason
mamba install -c conda-forge -c bioconda foldmason -y

> foldmason -h

FoldMason is a progressive aligner for fast and accurate multiple alignment of hundreds of thousands of protein structures.

 

Please cite:

 Gilchrist CLM, Mirdita M, Steinegger S. Multiple Protein Structure Alignment at Scale with FoldMason. bioRxiv, 2024.06.20.44908 (2024).

 

 

foldmason Version: 4bd8b8d8c20d439b52ff8a3fccc50a3aba2be286

© Cameron L.M. Gilchrist, Milot Mirdita, Martin Steinegger

 

usage: foldmason <command> [<args>]

 

Easy workflows for plain text input/output

  easy-msa              Sensitive homology search and build MSAs

 

Alignment

  structuremsa          Multiple structure alignment from a set of protein structures in DB format

  structuremsacluster   MSTA based on an existing (pre-)clustering DB

  msa2lddt              Calculate LDDT of a MSA

  msa2lddtreport        Calculate LDDT of a MSA and generate HTML report

  msa2lddtjson          Calculate LDDT of a MSA and generate HTML report

  refinemsa             Iteratively refine a MSA using structural information

 

> foldmason structuremsa

usage: foldmason structuremsa <i:queryDB> <o:alignmentFile> [options]

options:

 --match-ratio FLOAT       Columns that have a residue in this ratio of all sequences are kept [0.900]

 

 --guide-tree STR          Guide tree in Newick format

 --recompute-scores BOOL   Recompute all-vs-all alignment scores every iteration [0]

 --refine-iters INT        Number of alignment refinement iterations [0]

 --bitfactor-aa FLOAT      AA matrix bit factor [1.100]

 --bitfactor-3di FLOAT     3Di matrix bit factor [2.100]

 --pair-threshold FLOAT    % of pair subalignments with LDDT information [0.0,1.0] [0.000]

 --fast BOOL               Fast mode, disable residue neighbourhood similarity scoring [0]

 --refine-seed INT         Random number generator seed [-1]

 --only-scoring-cols BOOL  Normalise LDDT by no. scoring columns [0]

 --score-bias-pssm FLOAT   PSSM score bias [-0.600]

 --nb-sigma FLOAT          Neighborhood score decay constant [3.841]

 --nb-multiplier FLOAT     Neighborhood score multiplier [13.000]

 --nb-ang-cut FLOAT        Maximum distance cutoff (angstrom) for neighboring residues [45.000]

 --nb-low-cut FLOAT        Minimum neighborhood score threshold [0.020]

 --sw-gap-open INT         Gap open cost for all-vs-all Smith-Waterman alignment [9]

 --sw-gap-extend INT       Gap extension cost for all-vs-all Smith-Waterman alignment [8]

 

 --threads INT             Number of CPU-cores used (all by default) [128]

 -v INT                    Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]

 

references:

 - Kim, W., Mirdita, M., Levy Karin, E., Gilchrist, C.L.M., Schweke, H., Söding, J., Levy, E., and Steinegger, M. Rapid and sensitive protein complex alignment with Foldseek-Multimer. Nature Methods, doi:10.1038/s41592-025-02593-7 (2025)

 

Show an extended list of options by calling 'foldmason structuremsa -h'.

Not enough input paths provided. 2 paths are required.

> foldmason structuremsacluster

usage: foldmason structuremsacluster <i:queryDB> <i:clusterDB> <o:alignmentFile> [options]

options:

 --match-ratio FLOAT       Columns that have a residue in this ratio of all sequences are kept [0.900]

 

 --guide-tree STR          Guide tree in Newick format

 --recompute-scores BOOL   Recompute all-vs-all alignment scores every iteration [0]

 --refine-iters INT        Number of alignment refinement iterations [0]

 --bitfactor-aa FLOAT      AA matrix bit factor [1.100]

 --bitfactor-3di FLOAT     3Di matrix bit factor [2.100]

 --pair-threshold FLOAT    % of pair subalignments with LDDT information [0.0,1.0] [0.000]

 --fast BOOL               Fast mode, disable residue neighbourhood similarity scoring [0]

 --refine-seed INT         Random number generator seed [-1]

 --only-scoring-cols BOOL  Normalise LDDT by no. scoring columns [0]

 --score-bias-pssm FLOAT   PSSM score bias [-0.600]

 --nb-sigma FLOAT          Neighborhood score decay constant [3.841]

 --nb-multiplier FLOAT     Neighborhood score multiplier [13.000]

 --nb-ang-cut FLOAT        Maximum distance cutoff (angstrom) for neighboring residues [45.000]

 --nb-low-cut FLOAT        Minimum neighborhood score threshold [0.020]

 --sw-gap-open INT         Gap open cost for all-vs-all Smith-Waterman alignment [9]

 --sw-gap-extend INT       Gap extension cost for all-vs-all Smith-Waterman alignment [8]

 

 --threads INT             Number of CPU-cores used (all by default) [128]

 -v INT                    Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]

 

references:

 - Kim, W., Mirdita, M., Levy Karin, E., Gilchrist, C.L.M., Schweke, H., Söding, J., Levy, E., and Steinegger, M. Rapid and sensitive protein complex alignment with Foldseek-Multimer. Nature Methods, doi:10.1038/s41592-025-02593-7 (2025)

 

Show an extended list of options by calling 'foldmason structuremsacluster -h'.

Not enough input paths provided. 3 paths are required.

> foldmason msa2lddt

sage: foldmason msa2lddt <i:queryDB> <i:msaFile> [options]

options:

 --pair-threshold FLOAT    % of pair subalignments with LDDT information [0.0,1.0] [0.000]

 --guide-tree STR          Guide tree in Newick format

 --report-command STR      

 --report-paths BOOL        [1]

 --only-scoring-cols BOOL  Normalise LDDT by no. scoring columns [0]

 

 --threads INT             Number of CPU-cores used (all by default) [128]

 -v INT                    Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]

 

references:

 - Kim, W., Mirdita, M., Levy Karin, E., Gilchrist, C.L.M., Schweke, H., Söding, J., Levy, E., and Steinegger, M. Rapid and sensitive protein complex alignment with Foldseek-Multimer. Nature Methods, doi:10.1038/s41592-025-02593-7 (2025)

Not enough input paths provided. 2 paths are required.

> foldmason msa2lddtreport

usage: foldmason msa2lddtreport <i:queryDB> <i:msaFile> <o:htmlFile> [options]

options:

 --pair-threshold FLOAT    % of pair subalignments with LDDT information [0.0,1.0] [0.000]

 --guide-tree STR          Guide tree in Newick format

 --report-command STR      

 --report-paths BOOL        [1]

 --only-scoring-cols BOOL  Normalise LDDT by no. scoring columns [0]

 

 --threads INT             Number of CPU-cores used (all by default) [128]

 -v INT                    Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]

 

references:

 - Kim, W., Mirdita, M., Levy Karin, E., Gilchrist, C.L.M., Schweke, H., Söding, J., Levy, E., and Steinegger, M. Rapid and sensitive protein complex alignment with Foldseek-Multimer. Nature Methods, doi:10.1038/s41592-025-02593-7 (2025)

Not enough input paths provided. 3 paths are required.

>  foldmason msa2lddtjson

usage: foldmason msa2lddtjson <i:queryDB> <i:msaFile> <o:jsonFile> [options]

options:

 --pair-threshold FLOAT    % of pair subalignments with LDDT information [0.0,1.0] [0.000]

 --guide-tree STR          Guide tree in Newick format

 --report-command STR      

 --report-paths BOOL        [1]

 --only-scoring-cols BOOL  Normalise LDDT by no. scoring columns [0]

 

 --threads INT             Number of CPU-cores used (all by default) [128]

 -v INT                    Verbosity level: 0: quiet, 1: +errors, 2: +warnings, 3: +info [3]

 

references:

 - Kim, W., Mirdita, M., Levy Karin, E., Gilchrist, C.L.M., Schweke, H., Söding, J., Levy, E., and Steinegger, M. Rapid and sensitive protein complex alignment with Foldseek-Multimer. Nature Methods, doi:10.1038/s41592-025-02593-7 (2025)

Not enough input paths provided. 3 paths are required.

 

テストラン

git clone https://github.com/steineggerlab/foldmason.git
cd foldmason/
foldmason easy-msa ./lib/foldseek/example/d* example.fasta tmpFolder --report-mode 1

入力ディレクトリ

計算は数秒以内に終了した。

 

アラインメント結果はFASTA形式ファイルとインタラクティブなHTMLで出力される。

アミノ酸配列と3D interaction (3Di) alphabet (Foldseek)の両方の形式でのアライメントFASTAファイルが生成される(_aa.faと_3di.faの接尾辞)。MTSAから系統推定したと思われるnewick treeファイルもできる。

 

easy-msaを"--report-mode 1"付きで実行すると、インタラクティブなHTML Reportも生成される。

example.fasta.html 

 

下のパネルにはMSAが可視化されている。

 

左上のボタンから3Di alphabetに切り替えることができる。

カラーをLDDTから3Diに変更

 

右上のパネルには、予測された構造が回転しながら表示される。初期は上2つの配列の構造だけが色で区別されて重ね合わせて表示されている。

 

下のMSTAのパネルの配列名をクリックするか、上中央パネルの系統樹配列名をクリックすることでさらに構造を重ねて表示することができる。Guide Treeの系統樹もハイライトされるので、系統的に近いものを視覚的に選んで構造の一致を調べられるようになっている。

初期は一番上の配列が青くなっているが、クリックして解除できる。解除後、最初に選んだ配列が青色になり(リファレンス)、2個目以降の配列は黄色になる(系統樹の順番とMTSAの配列の順番は一致している)。

 

右端のボタンでフルスクリーン表示となる。

 

実行方法

実際に使うには、PDB/mmCIF形式(フラットまたはgzip圧縮)でフォーマットされた複数のクエリ構造を指定する。 easy-msaはユーザーフレンドリーな短縮コマンドとなっており、構造データベースを作成し多重構造アライメント、Report生成する操作をワンコマンドで実行できる。またeasy-msaを"--report-mode 1"付きで実行すると、インタラクティブなHTML Reportも生成される。

foldmason easy-msa <PDB/mmCIF files> result.fasta tmpFolder --report-mode 1

 

もしくは順番に実行する。

#1 DB作成
foldmason createdb <PDB/mmCIF files> myDb
=> カレントにmyDbをprefixとする複数のファイルができる

#2 多重構造アライメント
foldmason structuremsa myDb result
=> result*ファイル群ができる

#3 Report生成
foldmason msa2lddtreport myDb result_aa.fa result.html --guide-tree result.nw
=>result.htmlができる


foldmason refinemsaコマンドを使うと、一度出来上がったアライメントを分割再構築し、LDDTスコアが上がるまで繰り返す研磨を行うことができる。 DBファイル群のprefixとresult_3di.fa、出力名、反復数を指定する。

#4 refinement
foldmason refinemsa myDb result_3di.fa refined.fasta --refine-iters 1000

LDDTスコアが改善されていく。

1000回で初期平均平均0.483742 =>0.4927に改善された。refinementの計算が終わると、refined.fastaが保存される。

 

アライメントファイルに対し、myDbを使ってアライメント全体の平均 Local Distance Difference Test (LDDT) スコアを計算。AAも3Diアラインメントもどちらでも使える。

foldmason msa2lddt myDb result_3di.fa

Average MSA LDDT: 0.483742となり中程度の信頼性となった。

 

数千ー数万の構造がある場合、まずFoldseekでクラスタリングしてからアライメントすることで高速化できる。その場合、"--precluster"をつけてfoldmasonを実行する。

foldmason easy-msa <PDB/mmCIF files> result tmpFolder --precluster

 

FoldMason webサーバー

https://search.foldseek.com/foldmason

Foldseek serverと同じ感じで使える。またローカルで--report-mode 2"付きで実行して得られるJSONファイルをwebサーバーにアップしても、HTMLReportを見ることができる(上の画像中央の"UPLOAD PREVIOUS RESULT (JSON)"ボタンを選択)。

 

引用

Multiple protein structure alignment at scale with FoldMason

Cameron L. M. Gilchrist, Milot Mirdita, and Martin Steinegger 

Science,29 Jan 2026, Vol 391, Issue 6784

 

関連