CentOSの仮想環境にRepeatMaskerをインストール

Repeatmaskerをローカルで実施するため、WindowsVMware上の仮想環境CentOSにインストール作業を行った。この手順を以下に示す。

 

参考

http://sc.hgc.jp/japanese/utili_info/manual/RepeatMasker.html
http://ib.ibio.jp/?RepeatMasker%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB
http://blog.livedoor.jp/ham_kojiro/archives/3346302.html

 

必要なもの

・VMwarePlayer上で動いているCentOS6.5(64bit)
・repbaseのアカウント(事前に必要。無料だが申請後の受理に何日もかかる。返事がないことも・・・)
perl 5.8.0以上(CentOSに導入ずみ)
・rmblast(本プロトコルで導入する)
・blast+(本プロトコルで導入する)
trf(本プロトコルで導入する)

 

CentOSの環境情報は以下の通り。

f:id:kiliwave:20141204124222p:plain


 

手順

1.perlの情報確認

$ perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Perl5.8.0以上であることを確認し、必要に応じてアップデートを行う。

 $ which perl

/usr/bin/perl

 Perlのパスを確認する。このパス情報は後で使用するため控えておく。


2.本体のダウンロード
http://www.repeatmasker.org/RMDownload.html のリンクからダウンロード。

f:id:kiliwave:20141204125520p:plain

ここでは http://www.repeatmasker.org/RepeatMasker-open-4-0-3.tar.gz (80MB)をダウンロードした。

 

3.解凍

インストールしたいディレクトリ(ここでは/home/******/以下)でアーカイブを解凍する。

$ tar -xvzf RepeatMasker-open-4-0-3.tar.gz

同じディレクトリ以下に中にデータを含む「RepeatMasker」フォルダが生成される。

 

4.反復配列データベース(repbase)のデータ入手

Giri(http://www.girinst.org/server/RepBase/index.php)からRepeatmaskerのライブラリ入手。

f:id:kiliwave:20141204125747p:plain


ここでは repeatmaskerlibraries-20140131.tar.gz (52.85 MB) をダウンロードした。ダウンロード時に申請されたIDとパスワードが必要となる。

 

5.反復配列データベースの設置

「RepeatMasker」フォルダ内にrepbaseデータをコピーし解凍。

$ tar -xvzf repeatmaskerlibraries-20140131.tar.gz

Libraries/
Libraries/RepeatMaskerLib.embl
Libraries/RepeatAnnotationData.pm
Libraries/README.html
Libraries/taxonomy.dat
Libraries/README

「RepeatMasker」フォルダ内のLibrariesに情報が展開される。ちなみに検索対象とする生物種・分類はtaxonomy.datに記述されている。


6.rmblastの導入

rmblastnアーカイブをダウンロード。
ftp://ftp.ncbi.nlm.nih.gov/blast/executables/rmblast/LATEST/ に行き、最新版をダウンロードする。

f:id:kiliwave:20141204182008p:plain

ここでは ncbi-rmblastn-2.2.28-x64-linux.tar.gz を取得した。

$ tar -zxvf ncbi-rmblastn-2.2.28-x64-linux.tar.gz

ncbi-rmblastn-2.2.28/
ncbi-rmblastn-2.2.28/ChangeLog
ncbi-rmblastn-2.2.28/LICENSE
ncbi-rmblastn-2.2.28/ncbi_package_info
ncbi-rmblastn-2.2.28/README
ncbi-rmblastn-2.2.28/bin/
ncbi-rmblastn-2.2.28/bin/rmblastn

rmblastnファイルをユーザバイナリに無理矢理入れる。

# cp ncbi-rmblastn-2.2.28/bin/rmblastn /usr/bin

以下のようにバージョン情報が出ればOK。

# rmblastn -version

rmblastn: 2.2.27+
Package: rmblastn 2.2.28, build Feb 26 2013 22:29:52

 

7.trf(tandem repeats finder)インストール

http://tandem.bu.edu/trf/trf407b.linux64.download.html からファイルをダウンロード。

f:id:kiliwave:20141204182616p:plain

ファイル名をtrf407b.linux64から、trfに変更する。

# mv trf407b.linux64 trf

/usr/binにファイルを移動させ権限を変更する。

# cp trf /usr/bin
# chmod 655 /usr/bin/trf

以下のように実行し、ヘルプが表示されればOK。

# trf

Tandem Repeats Finder, Version 4.07b
Copyright (C) Dr. Gary Benson 1999-2012. All rights reserved.


Please use: trf File Match Mismatch Delta PM PI Minscore MaxPeriod [options]

Where: (all weights, penalties, and scores are positive)
File = sequences input file
Match = matching weight
Mismatch = mismatching penalty
Delta = indel penalty
PM = match probability (whole number)
PI = indel probability (whole number)
Minscore = minimum alignment score to report
MaxPeriod = maximum period size to report
[options] = one or more of the following :
-m masked sequence file
-f flanking sequence
-d data file
-h suppress html output
-r no redundancy elimination
-ngs more compact .dat output on multisequence files, returns 0 on success. You may pipe input in with this option using - for file name. Short 50 flanks are appended to .dat output. See more information on TRF Unix Help web page.

Note the sequence file should be in FASTA format:

>Name of sequence
aggaaacctg ccatggcctc ctggtgagct gtcctcatcc actgctcgct gcctctccag
atactctgac ccatggatcc cctgggtgca gccaagccac aatggccatg gcgccgctgt
actcccaccc gccccaccct cctgatcctg ctatggacat ggcctttcca catccctgtg

 

8.blast+の導入

ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ に行き、最新版をダウンロードする。

f:id:kiliwave:20141204183146p:plain

ここでは ncbi-blast-2.2.30+-x64-linux.tar.gz を取得した。

$ tar -zxvf ncbi-blast-2.2.30+-x64-linux.tar.gz

解凍したフォルダ内のbinデータを/usr/binに移す。

# cp ncbi-blast-2.2.30+/bin/* /usr/bin

バージョン確認

# blastn -version

blastn: 2.2.30+
Package: blast 2.2.30, build Oct 27 2014 16:58:06


9.Repeat Maskerのconfigure
RepeatMaskerの解凍したディレクトリへ移動し以下のコマンドを実行する。

$ perl ./configure

perlやrepeatmasker、trf、RMBlastのパスを聞かれるので予め準備しておく。

RepeatMasker Configuration Program

This program assists with the configuration of the
RepeatMasker program. The next set of screens will ask
you to enter information pertaining to your system
configuration. At the end of the program your RepeatMasker
installation will be ready to use.

<PRESS ENTER TO CONTINUE>

 ENTERを押す。

**PERL PROGRAM**

This is the full path to the Perl interpreter.
e.g. /usr/local/bin/perl or enter "env" if you prefer to use
the "/usr/bin/env perl" mechanism to locate perl.

Enter path [ /usr/bin/perl ]:

 perlの導入パスを確認し変更あれば入力する。(上記では/usr/bin/perlのままでOK

**REPEATMASKER INSTALLATION DIRECTORY**

This is the path to the directory where
the RepeatMasker program has been installed.

Enter path [ /home/******/RepeatMasker ]:

 RepeatMaskerの導入パスを確認し変更あれば入力する。

**TRF PROGRAM**

This is the full path to the TRF program.
This is now used by RepeatMasker to mask simple repeats.

Enter path [ /usr/bin/trf ]:

 TRFの導入パスを確認し変更あれば入力する。(ここでは上記/usr/bin/trfでOK)

Add a Search Engine:
1. CrossMatch: [ Un-configured ]
2. RMBlast - NCBI Blast with RepeatMasker extensions: [ Un-configured ]
3. WUBlast/ABBlast (required by DupMasker): [ Un-configured ]
4. HMMER3.1 & DFAM: [ Un-configured ]

5. Done

Enter Selection:

 使用する検索エンジンを指定する。ここではRMBlastを使うため2を選択する。

**RMBlast (rmblastn) INSTALLATION PATH**

This is the path to the location where
the rmblastn and makeblastdb programs can be found.

Enter path [ ]:

 RMBlastの導入パスを指定(ここでは/usr/binを入力)

ちなみに対象が存在しないパスを入力すると以下のようにエラーとなり再入力を指示される。もしこのプロセスから出たい場合はスクリプト停止(Ctrl+Cなど)で。

/usr/bin/makeblastdb does not exist
/usr/bin/blastx does not exist
<PRESS ENTER TO CONTINUE>

RMBlastをRepeatMaskerのデフォルト検索エンジンにするか

Do you want RMBlast to be your default
search engine for Repeatmasker? (Y/N) [ Y ]:

そのままYとする。

Add a Search Engine:
1. CrossMatch: [ Un-configured ]
2. RMBlast - NCBI Blast with RepeatMasker extensions: [ Configured, Default ]
3. WUBlast/ABBlast (required by DupMasker): [ Un-configured ]
4. HMMER3.1 & DFAM: [ Un-configured ]

5. Done

Enter Selection:

 RMBlastが、Configured,Defaultとなったことを確認し、5を選択。

-- Setting perl interpreter...

Congratulations! RepeatMasker is now ready to use.
The program is installed with a full version of the repeat library:
DFAM Library Version = Dfam_1.2
RMLibrary Version = 20140131
Repbase Version = 20140131
Further documentation on the program may be found here:
/home/*******/RepeatMasker/repeatmasker.help

 

10.下記コマンドを実行し、バージョンとヘルプが表示されることを確認する。

$ /home/******/RepeatMasker/RepeatMasker -help

 

11.適当なフォルダを作って、その中で以下を実行する。

http://www.ncbi.nlm.nih.gov/nuccore/71360870?report=fasta のデータをテストケースとして利用する。 

適当なフォルダを作成し、その中にテストファイルを作成する。

$ touch test.fasta

ストファイルに以下を記入する。

>gi|71360870|emb|AJ780927.1| Bos taurus rearranged repeat element, clone CNA4

AGTTTCTTGCCTGGAGAATCCCATGGACAGAGGAGTCTGGCGGGCCACAGTCTGTGGGGTTGCAAAGAGT
CAGACACGACKGAGTGACTAAGCACACAAATGTTTACAAGAGTGCTATAAAAGAATAATAATATTGCATA
CAGAGCTTCAGGCTAAGTTTGACATAGAAAGACGTTCTGTTCTGATGGAGCTGGCCATCATGGGAGGATG
ACCAGAGCACTTCCTGTCCAAACATCAGCACCAAAATGTCTCAGGTCYCAGCTTCAGCTCGGGGGTCACA
CCTCCTCCTCGTCGGTCAGCT

以下のコマンドを実行する。

$ /home/******/RepeatMasker/RepeatMasker -species cow test.fasta

RepeatMasker version open-4.0.3
Search Engine: NCBI/RMBLAST [ 2.2.27+ ]
Master RepeatMasker Database: /home/******/RepeatMasker/Libraries/RepeatMaskerLib.embl ( Complete Database: 20140131 )

Building general libraries in: /home/******/RepeatMasker/Libraries/20140131/general
Building species libraries in: /home/******/RepeatMasker/Libraries/20140131/bos_taurus
- 996 ancestral and ubiquitous sequence(s) for bos taurus
- 99 lineage specific sequence(s) for bos taurus

analyzing file test.fasta

Checking for E. coli insertion elements
identifying Simple Repeats in batch 1 of 1
identifying young abundant SINEs in batch 1 of 1
identifying full-length interspersed repeats in batch 1 of 1
identifying most interspersed repeats in batch 1 of 1
identifying long interspersed repeats in batch 1 of 1
identifying ancient repeats in batch 1 of 1
identifying retrovirus-like sequences in batch 1 of 1
identifying tough LINE1s in batch 1 of 1
identifying Simple Repeats in batch 1 of 1
processing output:
cycle 1
cycle 2
cycle 3
cycle 4
cycle 5
cycle 6
cycle 7
cycle 8
cycle 9
cycle 10
Generating output...
masking
done

以下のファイルが出力される。

  • test.fasta.cat: アラインメント
  • test.fasta.masked: Nマスクされたfastaファイル
  • test.fasta.out: ヒットした反復配列の詳細リスト
  • test.fasta.tbl:  ヒットした反復配列のカテゴリごとのリスト

例えばtest.fasta.tblを見ると、何がヒットしたか確認できる。

==================================================
file name: test.fasta
sequences: 1
total length: 301 bp (301 bp excl N/X-runs)
GC level: 49.16 %
bases masked: 95 bp ( 31.56 %)
==================================================
number of length percentage
elements* occupied of sequence
--------------------------------------------------
SINEs: 1 95 bp 31.56 %
Alu/B1 0 0 bp 0.00 %
MIRs 0 0 bp 0.00 %

LINEs: 0 0 bp 0.00 %
LINE1 0 0 bp 0.00 %
LINE2 0 0 bp 0.00 %
L3/CR1 0 0 bp 0.00 %
RTE 0 0 bp 0.00 %

LTR elements: 0 0 bp 0.00 %
ERVL 0 0 bp 0.00 %
ERVL-MaLRs 0 0 bp 0.00 %
ERV_classI 0 0 bp 0.00 %
ERV_classII 0 0 bp 0.00 %

DNA elements: 0 0 bp 0.00 %
hAT-Charlie 0 0 bp 0.00 %
TcMar-Tigger 0 0 bp 0.00 %

Unclassified: 0 0 bp 0.00 %

Total interspersed repeats: 95 bp 31.56 %


Small RNA: 0 0 bp 0.00 %

Satellites: 0 0 bp 0.00 %
Simple repeats: 0 0 bp 0.00 %
Low complexity: 0 0 bp 0.00 %
==================================================

* most repeats fragmented by insertions or deletions
have been counted as one element

The query species was assumed to be bos taurus
RepeatMasker version open-4.0.3 , default mode

run with rmblastn version 2.2.27+
RepBase Update 20140131, RM database version 20140131

SINEsが1件ヒットしていることを確認できる。お疲れ様でした。

 

※repleftの意味については http://blog.livedoor.jp/ham_kojiro/archives/cat_1065.html?p=3 参考。