m1 Mac でRAxML-NG & MrBayes
macOS のSilicon CPU もすなる多遺伝子解析といふものを、Enter the Fungi もしてみんとて、環境構築するなり
Homebrew のインストール
https://brew.sh に従ってhomebrew をインストールする
Terminal を開き以下をコピペ
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
RAxML-NG のインストール
Terminal を開き以下をコピペ
brew install raxml-ng
メモ 自分がやったときは以下のエラーが出たので対応した
Error: The following directories are not writable by your user: /usr/local/share/man/man8
You should change the ownership of these directories to your user. sudo chown -R [user name] /usr/local/share/man/man8 And make sure that your user has write permission. chmod u+w /usr/local/share/man/man8
sudo chown -R [user name] /usr/local/share/man/man8
chmod u+w /usr/[user name]/share/man/man8
brew install raxml-ng
modeltest-ng をインストール
https://github.com/ddarriba/modeltest/releases
macOS とlinux はバイナリファイルを入手可能
windows はwsl2 で実行すると良い?
ターミナルでmodeltest-ng を実行
./modeltest-ng-osx -d nt -i SSU+ITS+LSU+RPB2+mtSSU.phy -o SSU+ITS+LSU+RPB2+mtSSU -q whole_AICc4_partitioned_codonpartitioned.partition -T raxml
-d nt: 核酸配列を指定
-i SSU+ITS+LSU+RPB2+mtSSU.phy: fasta やphylip ファイルを指定
-o models: アウトプットファイル名
-q:whole_AICc4_partitioned_codonpartitioned.partition パーティーションファイル、Kakusan4 で作ったモノを流用している
-T raxml: raxml-ng で使うテンプレートで出力
解析が終わると「SSU+ITS+LSU+RPB2+mtSSU.part.aicc」が出力されるのでこれを使う。
RAxML-ng にバトンタッチ
macOS のターミナルで「raxml-ng --msa SSU+ITS+LSU+RPB2+mtSSU.phy --model SSU+ITS+LSU+RPB2+mtSSU.part.aicc --all --bs-trees 1000」
--msa SSU+ITS+LSU+RPB2+mtSSU.phy: fasta やphylip ファイルを指定
--model SSU+ITS+LSU+RPB2+mtSSU: modeltest-ng で出力されたファイルを使用
--all: Combined search (樹形探索) & bootstrapping (ブートストラップ) を同時にするらしい、詳しくはわからない
--bs-trees 1000: rapidbootstrap を1000回施行、best ML tree にbootstrap value を書き込むので便利
エラーが起きてもチェックポイントがあるので諦めらめず再開
[00:17:51] [worker #2] Bootstrap tree #851, logLikelihood: -15106.037388
raxml-ng(25428,0x3099d5000) malloc: *** error for object 0x600001f37fe0: pointer being freed was not allocated
raxml-ng(25428,0x3099d5000) malloc: *** set a breakpoint in malloc_error_break to debug
ターミナルで「raxml-ng --msa SSU+ITS+LSU+RPB2+mtSSU.phy --model ut.part.aicc --all --bs-trees 1000」を打ち直すと852 から再開する。
ファイルがたくさん生成される
SSU+ITS+LSU+RPB2+mtSSU.phy.raxml.log: ログ、besttree の尤度はここ
SSU+ITS+LSU+RPB2+mtSSU.phy.raxml.bestTree: bestrree
SSU+ITS+LSU+RPB2+mtSSU.phy.raxml.support: besttree にbt 値が埋め込まれている、論文にはこれを整形して使う
MEGA11 のインストール
理由は分からないけどHomebrew 経由でコンパイルした方が動作が機敏
Terminal を開き以下を順にコピペ
brew install cask
brew install --cask mega
アプリケーション一覧にMEGA11 が追加される
MrBayes のインストール
MrBayes 3.2.7 ソースコードをダウンロード
2. ZIP を解凍後にhome フォルダに移動し、terminal でフォルダを開く
フォルダ名がMrBayes-3.2.7 の場合
cd /Users/[user name]/MrBayes-3.2.7
3. 以下を順に入力
./configure --with-mpi
make
make install
4. MrBayes-3.2.7 内のSource フォルダにmb ファイルが作られるのでmacOS のアプリケーションフォルダにコピー
5. コンパイルに使ったMrBayes-3.2.7 は不要のため削除する
6. Terminal では「mb」と入力すると起動する。アプリケーションフォルダからも起動できる。