LoginSignup
1
1

More than 1 year has passed since last update.

EnTAP の セットアップ

Last updated at Posted at 2022-10-11

EnTAP (https://github.com/harta55/EnTAP) はこれまでのアノテーション作業で推定された遺伝子配列に対して、種々のデータベースに登録されている遺伝子配列と比較して機能アノテーションを付与してくれるツール。逆に言えば、どのデータベースを参照してもまともなアノテーションが付かない遺伝子ならば除いてしまえ、という判断にも使える。2倍体植物にアノテーション作業をすると4~5万の遺伝子が予想されるのに、大抵のリリースされている参照ゲノムには3万遺伝子くらいしかアノテーションされていなかったりするのは、こういう作業で余計なアノテーションを除去しているからだ。
 で、正直のところこの作業はかずさ DNA 研がリリースしている Hayai-Annotation-Plants (https://github.com/aghelfi/Hayai-Annotation-Plants) でほぼ事足りてしまうのだが、敢えて EnTAP を使った方法を紹介しておく。理由は、Hayai-Annotation-Plants が文字通り植物用のツールであること、また Mac ユーザーには簡単に使えても、WSL 環境のユーザーにはかなりハードルが高いこと、の2点である。
 しかし EnTAP のインストールは少々ややこしく、anaconda で一発とはいかないんでまずはセットアップのやり方を書いておく。

0. 環境のチェック

GCC 4.8.1以上 と CMake 3.00以上が必要なので

gcc --version
cmake --version

で確認。gcc が古いのしか入っていなかったら↓で更新。

sudo apt install build-essential

cmake は↓でインストール。

sudo apt install cmake

1. 依存ツールのインストール

RSEM, TransDecoder, Diamond, InterProScan, GeneMarkS-T が必要。

まずは anaconda の ENTAP 環境を作って、RSEM, TransDecoder, Diamond, InterProScan をインストールする(実際には RSEM と TransDecoder は使わないんだけど、Trinity や Spade で RNA-seq の de novo assembly をしたデータにアノテーションを付けたいときには使うことになる)。

mamba create -n ENTAP rsem diamond interproscan
conda activate ENTAP

なお、conda または mamba で InterProScan をインストールすると、最初に以下のようなメッセージが出る。

######################################
# First time usage please README !!! #
######################################

The databases are huge and consequently not shiped within this installation.
Please download and install the Databases manually by following the commands below:
!!! /!\ Edit the 2 first lines to match the wished version of the DB /!\ !!!

Commands:
=========
# See here for latest db available: https://github.com/ebi-pf-team/interproscan or http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/
# Set version
version_major=5.54
version_minor=87.0

# get the md5 of the databases
wget http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/-/interproscan---64-bit.tar.gz.md5
# get the databases (with core because much faster to download)
wget http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/-/interproscan---64-bit.tar.gz
# checksum
md5sum -c interproscan---64-bit.tar.gz.md5
# untar gz
tar xvzf interproscan---64-bit.tar.gz
# remove old DB
rm -rf /home/knaito/anaconda3/envs/ENTAP/share/InterProScan/data/
# copy past the new db
cp -r interproscan--/data /home/knaito/anaconda3/envs/ENTAP/share/InterProScan/

INFO:
====
Phobius (licensed software), SignalP, SMART (licensed components) and TMHMM use
licensed code and data provided by third parties. If you wish to run these
analyses it will be necessary for you to obtain a licence from the vendor and
configure your local InterProScan installation to use them.
(see more information in /home/knaito/anaconda3/envs/ENTAP/share/InterProScan/data/<db>)

要するに、InterProScan のデータは重いから、別途ダウンロードして所定の場所に置いてねということなのだが、InterProScan そのものに馴染みがないと「ちょっと何言ってんのか分からない」かも知れない。とりあえず InterPro というタンパク質配列とその機能を推定したデータベースがあって、InterProScan は相同性検索から解析対象のタンパク質配列から何らかの機能を持っていそうなドメインを推定して返してくれるツールだ、ということを知っておけばよし。

で、データベースとなるべきデータが何で、どこからダウンロードしてくればいいのかというのが、初めてだと分かりづらいところだ。それについては、まずこのメッセージの14・15行目に注目。

version_major=5.54
version_minor=87.0

これは interproscan-5-54-87.0 をダウンロードして使いなさいよという意味だ。このバージョンに合わせて、メッセージに示されているwget 等のコマンドの - を適宜修正するのだ(誰だよこんな難解なメッセージを作ったのは)。


例えば、↓のコマンドは
wget http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/-/interproscan---64-bit.tar.gz 

↓のようにすればOK。

wget http://ftp.ebi.ac.uk/pub/software/unix/iprscan/5/5.54-87.0/interproscan-5.54-87.0-64-bit.tar.gz

DLが終わったら、展開。

tar xzf interproscan-5.54-87.0-64-bit.tar.gz

展開したら interproscan-5.54-87.0 というディレクトリが出来ていて、その中に入っている data というディレクトリを anaconda の ENTAP 環境に移す。移すべき場所は ~/miniconda3/envs/ENTAP/share/ である。しかしそこにはテストデータが格納された data ディレクトリが既にあるので、先にそれを削除してから移す必要がある。

rm -rf ~/miniconda3/envs/ENTAP/share/InterProScan/data/ 
mv interproscan-5.54-87.0/data ~/miniconda3/envs/ENTAP/share/`

これで InterProScan は利用可能になる。

GeneMarkS-T は GeneMark-ES/ET/EPのインストール の時と同じ。まずは http://topaz.gatech.edu/GeneMark/license_download.cgi から いちばん下にある GeneMarkS-T をダウンロードする。ユーザー情報を適宜入力して、"I agree to the terms of this license agreement" ボタンをクリックすると、ダウンロードに進む。ダウンロードしたファイルは ~/local の中に gmst_linux_64 というディレクトリを作ってそこに移しておくのがよいと思う(無論外部ツールをどこに置くかは自由だが)。

cd ~/local
mkdir gmst_linux_64
cd gmst_linux_64
mv /mnt/c/Users/Windowsのアカウント名/Downloads/gmst_linux_64.tar.gz ./
tar xzf gmst_linux_64.tar.gz

なお、例によってライセンスは200日限りなので、200日経ったらまた上記のサイトに行って、登録情報を入力し直し、ライセンスに同意し、Please download key 32_bit or 64_bit のリンクからライセンスキー (gm_key_64.gz) をダウンロード・解凍したら、

cp gm_key_64 ~/.gm_key

としてホームディレクトリにライセンスファイルを置く。

2. EnTAP のインストールとデータのダウンロード

EnTAP 自体は anaconda に登録されていないので、自前でダウンロード・インストールするしかない。過去記事と同様、~/local を外部ツールのインストール場所とする。

cd ~/local
git clone https://github.com/harta55/EnTAP.git

ダウンロードが終わったら、EnTAP の中に入っている entap_config.ini に書かれている種々のコマンドパスを編集する。編集すべきなのは、以下の14行(行頭の数字はファイル中の行番号)。

 22 entap-db-bin=/bin/entap_database.bin
 25 entap-db-sql=/databases/entap_database.db
 28 entap-graph=/src/entap_graphing.py
 46 rsem-calculate-expression=/libs/RSEM-1.3.3//rsem-calculate-expression
 50 rsem-sam-validator=/libs/RSEM-1.3.3//rsem-sam-validator
 54 rsem-prepare-reference=/libs/RSEM-1.3.3//rsem-prepare-reference
 58 convert-sam-for-rsem=/libs/RSEM-1.3.3//convert-sam-for-rsem
 77 genemarkst-exe=gmst.pl
 83 transdecoder-long-exe=TransDecoder.LongOrfs
 86 transdecoder-predict-exe=TransDecoder.Predict
128 eggnog-sql=/databases/eggnog.db
131 eggnog-dmnd=/bin/eggnog_proteins.dmnd
137 interproscan-exe=interproscan.sh
164 diamond-exe=/libs/diamond-0.9.9/bin/diamond

このファイル中の書かれているプログラム PATH は基本的に全く合っていないので、正しい PATH に修正しなければならない。ここで紹介している通りにダウンロード・インストールした場合は、

 22 entap-db-bin=~/local/EnTAP/bin/entap_database.bin
 25 entap-db-sql=~/local/EnTAP/databases/entap_database.db
 28 entap-graph=~/local/EnTAP/src/entap_graphing.py
 46 rsem-calculate-expression=rsem-calculate-expression
 50 rsem-sam-validator=rsem-sam-validator
 54 rsem-prepare-reference=rsem-prepare-reference
 58 convert-sam-for-rsem=convert-sam-for-rsem
 77 genemarkst-exe=~/gmst_linux_64/gmst.pl
 83 transdecoder-long-exe=TransDecoder.LongOrfs
 86 transdecoder-predict-exe=TransDecoder.Predict
128 eggnog-sql=~/local/EnTAP/databases/eggnog.db
131 eggnog-dmnd=~/local/EnTAP/bin/eggnog_proteins.dmnd
137 interproscan-exe=interproscan.sh
164 diamond-exe=diamond

でいけると思う(PATH の概念に慣れてくれば自分で調べて修正できるようになるはず)。これが終わったら、

cd ~/local/EnTAP
cmake CMakeLists.txt
make
sudo make install

でインストールできるはず。Root 権限のないサーバー等でインストールするときには、cmake のときに -DCMAKE_INSTALL_PREFIX オプションでインストール先を指定する。cmake CMakeLists.txt -DCMAKE_INSTALL_PREFIX="~/local/EnTAP" のように。ここで指定したディレクトリの中に bin ディレクトリができて、その中にEnTAPというコマンドファイルが作成される。以下、EnTAP コマンドを使うときにはここのパスを指定する。面倒な人はコマンドパスを通しておこう。

※Root 権限のない環境で DCMAKE_INSTALL_PREFIX の指定を忘れて make install をすると、 "/usr/local/bin/EnTAP": Permission denied. というエラーメッセージが出る。そのときは慌てずに、cmake_install.cmake ファイルを nano や vim で開けて、5行目に書かれている set(CMAKE_INSTALL_PREFIX "/usr/local") の "usr/local" の部分を適宜編集してから make install をし直せばよい。

3. EnTAP のセットアップ

以下のデータベースから、相同性検索に使うデータベースをダウンロードする。

とりあえず SwissProt と TrEMBL はマスト(TrEMBL は巨大なので DL だけで数時間掛かる)。

cd ~/local/EnTAP/database
wget https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz
wget https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_trembl.fasta.gz

あと、は NCBI から対象生物のカテゴリに属する生物種群の NR (Non-Redundant) データをダウンロードする。私の場合は植物なので

wget ftp://ftp.ncbi.nlm.nih.gov/refseq/release/plant/*.faa.gz
pigz -d -p 16 *.faa.gz
cat *.faa > plants.faa

ここまでできたら、Configuration を走らせて、セットアップ完了(base じゃなくて ENTAP 環境で実行するんだぞ)。

~/local/EnTAP/bin/EnTAP --config \
  -d ~/local/EnTAP/database/uniprot_sprot.fasta \
  -d ~/local/EnTAP/database/uniprot_trembl.fasta \
  -d ~/local/EnTAP/database/plants.faa \
  -t 16 \
  --ini ~/local/EnTAP/entap_config.ini

で、内部で diamond makedb が動いて fasta を diamond 用の検索データベース (.dmnd) に変換していく。dmnd ファイルの出力先はデフォルトだと ~/local/EnTAP/bin になる。

関連

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1