macでインフォマティクス

macでインフォマティクス

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

超大規模データに特化した高速多重タンパク質配列アラインメントツール FAMSA2

 

本稿では、これまでにない高速で高精度な多重タンパク質配列アラインメントを生成するアルゴリズム、FAMSA2を紹介する。構造、系統発生、機能の各ベンチマークにおいて、FAMSA2は最先端のツールと同等以上の精度を実現し、最大400倍高速で動作し、既存の最速アライナーを凌駕する。FAMSA2は、64GBのRAMを搭載したワークステーションで1200万配列を40分で処理できるため、これまで不可能だった規模での進化解析や構造解析が可能になる。

 

インストール

Github

#from source (macosでのコンパイルはレポジトリ参照)
git clone https://github.com/refresh-bio/FAMSA --recursive
cd FAMSA && gmake

#conda
mamba install -c bioconda famsa -y

> ./bin/famsa

FAMSA (Fast and Accurate Multiple Sequence Alignment)

  version 2.5.2-2598410 (2026-03-23)

  S. Deorowicz, A. Debudaj-Grabysz, A. Gudys

Usage:

  famsa [options] <input_file> [<input_file_2>] <output_file>

Positional parameters:

  input_file, input_file_2 - input files in FASTA format; action depends on the number of input files:

      * one input - multiple sequence alignment (input gaps, if present, are removed prior the alignment),

      * two inputs - profile-profile aligment (input gaps are preserved).

      First input can be replaced with STDIN string to read from standard input.

  output_file - output file (pass STDOUT when writing to standard output); available outputs:

      * alignment in FASTA format,

      * guide tree in Newick format (-gt_export option specified),

      * distance matrix in CSV format (-dist_export option specified),

Options:

  -help - print help message (including advanced parameters)

  -t <value> - no. of threads, NOTE: exceeding number of physical (not logical) cores decreases performance,

      0 indicates half of all the logical cores (default: 0)

  -v - verbose mode, show timing information (default: disabled)

  -gt <sl | upgma | nj | import <file>> - guide tree method (default: sl):

      * sl - single linkage

      * upgma - UPGMA

      * nj - neighbour joining

      * import <file> - imported from a Newick file

  -medoidtree - use medoid tree heuristic for speeding up tree construction (default: disabled)

  -medoid_seeds <value> - number of seeds k in medoid trees (default: 100)

  -medoid_threshold <value> - minimum subset size M to apply medoid tree heuristic (default: 2000, -medoid_threshold >= -medoid_seeds)

  -gt_export - export a guide tree to output file in Newick format

  -dist_export - export a distance matrix to output file in CSV format

  -square_matrix - generate a square distance matrix instead of a default triangle

  -pid - generate pairwise identity (the number of matching residues divided by the shorter sequence length) instead of distance

  -keep_duplicates - keep duplicated sequences during alignment

                     (default: disabled - duplicates are removed prior and restored after the alignment).

  -gz - enable gzipped output (default: disabled)

  -gz_lev <value> - gzip compression level [0-9] (default: 7)

  -trim_columns <fraction> - remove columns with less <fraction> of non-gap characters

  -refine_mode <on | off | auto> - refinement mode (default: auto - the refinement is enabled for sets <= 1000 seq.)

 

 

実行方法

1、入力の配列、出力のMSAの順で指定する。

./bin/famsa ./test/adeno_fiber/adeno_fiber sl.aln

カレントパスにsl.alnができる。

 

2、ガイドツリーの構築アルゴリズムをUPGMA法に変更(デフォルトのSingle-linkageより精度が向上する)、マルチスレッド、gzip圧縮出力

famsa -gt upgma -t 8 -gz ./test/adeno_fiber/adeno_fiber upgma.aln.gz
  • -gz    enable gzipped output (default: disabled)
  • -t      no. of threads, NOTE: exceeding number of physical (not logical) cores decreases performance
  • -gt     guide tree method (default: sl):

              * sl - single linkage

              * upgma - UPGMA

              * nj - neighbour joining

              * import <file> - imported from a Newick file 

 

3、完全なMSA計算はせずに、系統樹(ガイドツリー)のデータだけをNeighbour Joiningツリーとして出力する。

famsa -gt nj -gt_export ./test/adeno_fiber/adeno_fiber nj.dnd
  • -gt_export    export a guide tree to output file in Newick format

 

4、外部で作成したガイドツリー(NJ)を使ってアライメント

famsa -gt import nj.dnd ./test/adeno_fiber/adeno_fiber nj.aln

 

5、MedoidツリーとUPGMAのハイブリッド。Medoidツリーは配列全体から代表配列(Medoid)を抽出し、それを使って大まかなツリーを近似作成する。その近似ツリー内のサブツリーの構築にUPGMA法を適用する。

famsa -medoidtree -gt upgma ./test/hemopexin/hemopexin upgma.medoid.aln
  • -medoidtree     use medoid tree heuristic for speeding up tree construction (default: disabled)

数万配列のような超大量のデータを扱う場合、完全なUPGMAやNJは計算が重くなる。このハイブリッド方式は速度と精度のバランスを取りやすくする。

 

6、距離行列のエクスポートのみ行う。

famsa -dist_export ./test/adeno_fiber/adeno_fiber dist.csv
  • -dist_export    export a distance matrix to output file in CSV format

 

 

7、6の距離ではなく、PID(一致率 (%))を計算し、正方行列として出力(下流の可視化ツールなどで扱いやすい)

famsa -dist_export -pid -square_matrix ./test/adeno_fiber/adeno_fiber pid.csv
  • -pid    generate pairwise identity (the number of matching residues divided by the shorter sequence length) instead of distance
  • -square_matrix   generate a square distance matrix instead of a default triangle

     

8、すでにアライメントされた2つのグループを結合する(リファインなし)

famsa -refine_mode off ./test/adeno_fiber/upgma.no_refine.part1.fasta ./test/adeno_fiber/upgma.no_refine.part2.fasta pp.fasta
  • -refine_mode <on | off | auto>  refinement mode (default: auto - the refinement is enabled for sets <= 1000 seq.)

FAMSAは通常、アライメント後に全体のギャップの位置を微調整するrefine処理を行うが、リファイン処理は時間がかかるため、既にアライメント済みのデータ同士を高速に結合させたい場合に、無効化している。

 

その他

  • FAMSA2は、前バージョンと同様に2段階のプログレッシブアライメント手法を採用している。第1段階では、新たに開発したツリーアルゴリズム、または標準的な単連結クラスタリング(UPGMAやNJなどの他のツリーアルゴリズムもオプションで利用可能)を用いてMedoidガイドツリーを構築する。第2段階では、ガイドツリーで示された組み込み順序に従って、配列をプロファイル(中間アライメント)にアライメントする。
  • FAMSA2は数千配列だとMAFFT(高速モード)やClustal Omegaよりも数倍〜十数倍高速。数万配列だとMAFFTなどは数時間〜数日かかるようなデータセットを、FAMSAは数分〜数十分で終わらせることができる。

引用

FAMSA2 enables accurate multiple sequence alignment at protein-universe scale

Adam Gudyś,  Andrzej Zielezinski,  Cedric Notredame,  Sebastian Deorowicz

bioRxiv, Posted July 18, 2025.

 

追記

Fast and accurate multiple-protein-sequence alignment at scale with FAMSA2

Adam Gudyś, Andrzej Zielezinski, Cedric Notredame & Sebastian Deorowicz 

Nature Biotechnology (2026). Published: 14 April 2026

 

関連