2019/11/3 condaインストール追記
2019/11/24 help追記
2022/1/5 helpのバージョン更新
2023/03/01 docker 追記
2025/04/19 追記
配列間の相同性関係を同定することは生物学的研究にとって基本である。 ここで本著者らはオルソロググループ推論アルゴリズムにおける以前には検出されていない遺伝子長バイアスを解決するOrthoFinderと呼ばれる新規なアルゴリズムを提供する。この結果、精度が著しく改善される。 実際のベンチマークデータセットを使用して、OrthoFinderが他の推論法よりも8%から33%正確であることを示す。 さらに、本発明者らは、植物中の転写因子遺伝子ファミリーの完全な分類を提供することによってOrthoFinderの有用性を実証し、これまでに観察されていない690万の関係を明らかにする。
公式のGithubにとても丁寧な説明があるので、そちらをご覧ください。
OrthoFinder/OrthoFinder-manual.pdf at master · davidemms/OrthoFinder · GitHub
簡単に言えば、blastを全部のfaaファイルに対して実行して(BLAST all-versus-all)、それでオーソロガスなタンパク質を検出している。そのため、比較するfaaファイルの数に応じて計算時間が累乗で増えていく。そして全てのオルソロググループに対してルート付きの系統樹を推定し、それらのツリーにおけるすべての遺伝子重複を特定することができる。比較ゲノム解析のための統計も出力される。
OrthoFinder公式サイト
http://www.stevekellylab.com/software/orthofinder
2025/10/25追記
OrthoFinder has been cited more than 10,000 times 🤯. Don’t think @David__Emms or I ever dreamed it would be so useful to so many people. Looking forward to sharing the latest updates soon! pic.twitter.com/ipTH6KZKAP
— Steve Kelly (@Steve__Kelly) October 22, 2025
インストール
#bioconda (link) python2.7 (python3 supported)
mamba create -n orthofinder -y
conda activate orthofinder
mamba install orthofinder -c bioconda -y
#homebrew
brew install OrthoFinder
> orthofinder
OrthoFinder version 2.5.4 Copyright (C) 2014 David Emms
SIMPLE USAGE:
Run full OrthoFinder analysis on FASTA format proteomes in <dir>
orthofinder [options] -f <dir>
Add new species in <dir1> to previous run in <dir2> and run new analysis
orthofinder [options] -f <dir1> -b <dir2>
OPTIONS:
-t <int> Number of parallel sequence search threads [Default = 128]
-a <int> Number of parallel analysis threads
-d Input is DNA sequences
-M <txt> Method for gene tree inference. Options 'dendroblast' & 'msa'
[Default = dendroblast]
-S <txt> Sequence search program [Default = diamond]
Options: blast, diamond, diamond_ultra_sens, blast_gz, mmseqs, blast_nucl
-A <txt> MSA program, requires '-M msa' [Default = mafft]
Options: mafft, muscle
-T <txt> Tree inference method, requires '-M msa' [Default = fasttree]
Options: fasttree, raxml, raxml-ng, iqtree
-s <file> User-specified rooted species tree
-I <int> MCL inflation parameter [Default = 1.5]
-x <file> Info for outputting results in OrthoXML format
-p <dir> Write the temporary pickle files to <dir>
-1 Only perform one-way sequence search
-X Don't add species names to sequence IDs
-y Split paralogous clades below root of a HOG into separate HOGs
-z Don't trim MSAs (columns>=90% gap, min. alignment length 500)
-n <txt> Name to append to the results directory
-o <txt> Non-default results directory
-h Print this help text
WORKFLOW STOPPING OPTIONS:
-op Stop after preparing input files for BLAST
-og Stop after inferring orthogroups
-os Stop after writing sequence files for orthogroups
(requires '-M msa')
-oa Stop after inferring alignments for orthogroups
(requires '-M msa')
-ot Stop after inferring gene trees for orthogroups
WORKFLOW RESTART COMMANDS:
-b <dir> Start OrthoFinder from pre-computed BLAST results in <dir>
-fg <dir> Start OrthoFinder from pre-computed orthogroups in <dir>
-ft <dir> Start OrthoFinder from pre-computed gene trees in <dir>
LICENSE:
Distributed under the GNU General Public License (GPLv3). See License.md
CITATION:
When publishing work that uses OrthoFinder please cite:
Emms D.M. & Kelly S. (2019), Genome Biology 20:238
If you use the species tree in your work then please also cite:
Emms D.M. & Kelly S. (2017), MBE 34(12): 3267-3278
Emms D.M. & Kelly S. (2018), bioRxiv https://doi.org/10.1101/267914
テストラン
ソースコードの中のテストデータを実行。42生物のタンパク質データ (.faa) がある。
git clone https://github.com/davidemms/OrthoFinder.git
orthofinder -f OrthoFinder/ExampleData/ -t 12
Statistics_Overall.csvに結果がまとめられている。
kazumaxneo$ column -t -s',' Results_Aug01/Statistics_Overall.csv |head -20
Number of genes 2733
Number of genes in orthogroups 1938
Number of unassigned genes 795
Percentage of genes in orthogroups 70.9
Percentage of unassigned genes 29.1
Number of orthogroups 536
Number of species-specific orthogroups 7
Number of genes in species-specific orthogroups 102
Percentage of genes in species-specific orthogroups 3.7
Mean orthogroup size 3.6
Median orthogroup size 4.0
G50 (assigned genes) 4
G50 (all genes) 4
O50 (assigned genes) 199
O50 (all genes) 298
Number of orthogroups with all species present 278
Number of single-copy orthogroups 254
Date 2017-08-01
Orthogroups file Orthogroups.csv
Unassigned genes file Orthogroups_UnassignedGenes.csv
2733遺伝子のうち1938でオルソログが見つかったと出ている。
公式のdockerイメージが用意されている。
https://hub.docker.com/r/davidemms/orthofinder
docker pull davidemms/orthofinder:latest
#help(v2.5.4)
docker run -it --rm davidemms/orthofinder:2.5.4 -h
#proteomeのfastaファイルが配置された1つ上のディレクトリに移動する
cd proteome_seqs/../
#dockerのrun。下のコマンドだとdiamondのall versus all blastが実行される。
docker run --ulimit nofile=1000000:1000000 -it --rm -v /<full_path>/<to>/<curret_path>:/input davidemms/orthofinder:2.5.4 orthofinder -f /input/proteome_seqs/
-M msaもつけると、MAFFTによる多重整列、FastTree による樹木推定まで実行される。タンパク質FASTAファイルの拡張子は".fa、.faa、.fasta、.fas、.pep"が自動で認識される。比較するfaaファイルの数に応じて計算時間が累乗で増えていくことと、メモリ使用量も増えることに注意。植物の250ゲノムのproteomeでは、256GBメモリでは足りなかった。
出力例

Orthogroups/にあるOrthogroups.GeneCount.tsvが各オルソロググループに属する遺伝子の数をまとめた行列ファイルになる。Gene_Trees/にはオルソログそれぞれの系統推定結果が配置されている。Orthogroup_sequences/にはオルソログの配列が配置されている。
3. Exploring OrthoFinder's results | OrthoFinder Tutorials
デフォルトでは利用可能な全てのCPUが使用される。”-t”で指定可能。”-S”で配列サーチプログラムを変更可能。感度と速度のバランスが良いmmseqsに変更。
orthofinder -f protein_dir/ -t 20 -o outdir -S mmseqs
-
-t <int> Number of parallel sequence search threads [Default = 128]
-
-a <int> Number of parallel analysis threads
- -S Sequence search program [Default = diamond] Options: blast, diamond, diamond_ultra_sens, blast_gz, mmseqs, blast_nucl
species tree推定に使われる連結MSAも保存するには-M msaをつける。
orthofinder -f protein_dir/ -t 20 -o outdir -S mmseqs -M msa -T fasttree
-
-M Method for gene tree inference. Options 'dendroblast' & 'msa' [Default = dendroblast]
-
-T Tree inference method, requires '-M msa' [Default = fasttree] Options: fasttree, raxml, raxml-ng, iqtree
追記
新しいプロテオームを既存のOrthoFinder解析結果に追加して、オルソログ/オルソグループに割り当てる--assignオプションがv.3で追加されている。
orthofinder --assign new_proteome.fa -f Previous_Run/
=> 元の解析結果は保持され、新しいディレクトリができる。
各オルソグループにおける各種の遺伝子数を集計するスクリプトが用意されている。
python <path>/<to>/orthogroup_gene_count.py Orthogroups/Orthogroups.GeneCount.tsv
Orthogroups/Orthogroups.GeneCount.GeneCount.csvが書き出される。
出力例

その他
- OrthoFinderはtmpに大量の作業ファイルを書き出す。多くのタンパク質を指定した場合、tmpがいっぱいになってエラーを起こす可能性がある。大規模なオルソログ推定では、前もってtmpを大容量のディスクに変更しておく。例: export TMPDIR=/path/to/tmp/
- 出力で最初にチェックしたいのは、オルソグループに割り当てられた遺伝子の数である。一般的に遺伝子の少なくとも80%がオルソグループに割り当てられているのは良いことで、これより少ないということは、おそらく残っている遺伝子のいくつかについて実際に存在するオルソロジー関係を見逃していることを意味する(チュートリアルより)。種ごとのオルソグループに割り当てられた遺伝子のパーセンテージはComparative_Genomics_Statistics/Statistics_PerSpecies.tsvにある。
Statistics_PerSpecies.tsvの例

- もし種のツリーが正しくない場合、オルソグループの推定には影響しないが、遺伝子重複イベントがある遺伝子ツリーの一部ではオルソログの推定に影響する可能性がある。この場合、OrthoFinder解析の最後の部分を、修正された種ツリー(-ftと-sオプション)で再度実行することをが推奨されている。計算コストのかかる部分はすでに終わっているので、素早く実行できる。OrthoFinderのベストプラクティス参照。
- チュートリアルでは、ヒトに至る系統で2回重複が起こっている核切断/ポリアデニル化反応の切断およびポリアデニル化ステップに関与する遺伝子のオルソログを例に説明している。Orthologuesディレクトリの中に、それぞれの生物種のサブディレクトリがある。Orthologues/Orthologues_Drosophila_melanogaster/Drosophila_melanogaster__v__Homo_sapiens.tsv)を表計算ソフトで開くと「Orthogroup」、「Drosophila_melanogaster」、「Homo_sapiens 」の3つの列がある。表から 「FBgn0005648 」を見つけると、この遺伝子がオルソグループOG0001189にあり、ヒトに3つのオルソログ:ENSG00000205022, ENSG00000100836, ENSG00000258643、があることがわかる。この遺伝子ツリーをツリービューアで開くと、2つの遺伝子重複が人に至る系統で起こったことがわかる。1つは脊椎動物に共通で、もう1つはヒトとマウスに共通である。この結果、1対3のオーソロジーの関係、すなわちヒトの3つの遺伝子はすべてショウジョウバエの1つの遺伝子と等しく密接な関係にある。オルソロジーの関係が1対1でないことはよくあることで、これを知っておくことは重要である。「オルソログ」についての実験に何ヶ月も費やして、後になって実は3つあったということにならないようにしたいものである!。FlyBaseのこの遺伝子のページを見ると、これらの3つのオルソログをすべて同定した唯一の方法は、ツリーベースの方法であるCompara、eggNOG、OrthoFinder、TreeFamであることがわかる。OrthoFinderは自分のデータで実行できる唯一のものである(全てチュートリアルより)。
- OrthoFinderは遺伝子重複イベントを同定し、そのすべてが発生した生物種ツリーと遺伝子ツリーのノードにクロスリファレンスされている。これらのイベントは、Duplications_per_Orthogroup.tsvとDuplications_per_Species_Tree_Node.tsvというファイルに、オルソグループごとと種ツリーノードごとにまとめられている。
- オルソログとは、2つの種の最後の共通祖先(LCA)において1つの遺伝子から派生した遺伝子のペアである。これらは2つの種の間で「同等の遺伝子」と考えることができる。オルソグループとは、この概念を種のグループに拡張したものである。オルソグループは、ある種のグループのLCAにおける単一遺伝子から派生した遺伝子のグループである。オルソグループ内の遺伝子は互いにオルソログである場合もあれば、以下に説明するようにパラログである場合もある(解説参照)。
引用
OrthoFinder: solving fundamental biases in whole genome comparisons dramatically improves orthogroup inference accuracy
David M. Emms and Steven Kelly
Genome Biol. 2015; 16(1): 157. Published online 2015 Aug 6.
OrthoFinderを用いたOrthologous解析 - Qiita
関連
クエリが1配列の時に便利
"-t 8"での計算時間は、バクテリアのfaaファイル5つで30分くらいかかった(mac pro 2009使用)。
2022 1/6 追記
最近のバージョンを使うとずっと早く計算は終わるようです。
古い説明
condaやbrewを使わない場合、1つずつ導入する。
- fastme #ここからbinaryダウンロード。
chmod u+x fastme-2.1.5/binaries/fastme-2.1.5-osx #実行権
mv fastme-2.1.5-osx fastme #rename
#パスを通すかパスが通っている場所に移動。
- pythonの依存 #ない人だけ
pip install numpy
pip install Shapely
pip install Matplotlib
- DLCpar ダウンロードリンク
#dlcpar-1.0.tarを解凍して中に入る。
sudo python setup.py install
- MCL
brew install MCL