RepeatMasker安装和使用

时间:2022-04-26
本文章向大家介绍RepeatMasker安装和使用,主要内容包括软件安装与配置、2. TRF(Tandem Repeat Finder)搜寻串联重复序列、3. RepeatMasker程序、4. Repbase数据库、5. 配置RepeatMasker依赖关系、软件使用实例、2. 结果文件说明、软件安装使用常见问题、2. trf运行报错、3. Rpeatmasker运行时找不到依赖程序、4. 没有结果目录及结果、基本概念、基础应用、原理机制和需要注意的事项等,并结合实例形式分析了其使用技巧,希望通过本文能帮助到大家理解应用这部分内容。

RepeatMasker是一款专门用于基因组重复序列识别注释,并分类统计的软件,几乎用于所有物种。是研究基因组、非编码RNA、转座子和着丝粒领等相关领域的必备软件。很多small RNA, lncRNA与Repeat区有密切关系。

之前我在2013在PLOB发布过《RepeatMasker安装方法与使用 》,阅读近7000次。相关百度云中Repbase也被下载几千次。但目前软件和数据库均更新很多次,旧版在主流系统安装也会出一些问题,重复序列发现种类也已经翻倍,故重发新版软件安装和使用方法。

软件安装与配置

本次安装环境为 Ubuntu 16.04.2 x64,所有相关软件和数据库全为文章发布时最新版。本文是以Root权限安装提供服务所有用户使用,没有权限的小伙伴只需将软件下载安装在自己的文件夹内,配置repeatmasker时设置所有相关软件的位置即可,不会设置环境变量的一律使用程序完整路径名运行RepeatMasker即可。

1. RMBlast序列搜索引擎

http://www.repeatmasker.org/RMBlast.html 2.6.0 ver 2 2017-3-29

# 下载RMBlast源码包并编辑
cd ~/bin/
wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.6.0/ncbi-blast-2.6.0+-src.tar.gz
wget http://www.repeatmasker.org/isb-2.6.0+-changes-vers2.patch.gz
tar zxvf ncbi-blast-2.6.0+-src.tar.gz
gunzip isb-2.6.0+-changes-vers2.patch.gz
cd ncbi-blast-2.6.0+-src
patch -p1 < ../isb-2.6.0+-changes-vers2.patch
cd c++
./configure --with-mt --prefix=/usr/local/rmblast --without-debug
make
# 安装程序及库至系统目录,有报误,但我们需要的rmblastn已经可以正常使用了
sudo make install # Makefile:40: recipe for target 'install-toolkit' failed
# 测试程序是否安装成功
/usr/local/rmblast/bin/rmblastn -h

2. TRF(Tandem Repeat Finder)搜寻串联重复序列

http://tandem.bu.edu/trf/trf.download.html 4.09 2016-2-22 最新版4.09,本操作系统需要安装其中的legacy的64位版才能运行

cd ~/bin/
wget http://tandem.bu.edu/trf/downloads/trf409.legacylinux64
chmod +x trf409.legacylinux64
sudo cp trf409.legacylinux64 /usr/local/bin/trf
# 测试有帮助信息即可用
trf

3. RepeatMasker程序

http://www.repeatmasker.org/RMDownload.html 4.0.7 2017-2-1

# 下载267MB安装包,也比较慢,放在后台慢慢下
nohup wget -c http://www.repeatmasker.org/RepeatMasker-open-4-0-7.tar.gz &bg
tar xvzf RepeatMasker-open-4-0-7.tar.gz

4. Repbase数据库

http://www.girinst.org/server/RepBase/index.php 需要注册才能下载,人工审批,可能要等两天。 RepBaseRepeatMaskerEdition-20170127.tar.gz (48.84 MB) 也可以在我的百度网盘下载,并上传服务器至RepeatMasker下载的相同目录。http://pan.baidu.com/s/1c2zSMKo

mv RepBaseRepeatMaskerEdition-20170127.tar.gz RepeatMasker/
cd RepeatMasker/
tar xvzf RepBaseRepeatMaskerEdition-20170127.tar.gz

5. 配置RepeatMasker依赖关系

# 默认perl, repatmasker, trf安装位置正确的就一路回车,搜索引挚选择2 RMBlast,输入RMBlast安装目录/usr/local/rmblast/bin,再选5 done完成;例如我刚才编绎最新版安装目录:/usr/local/rmblast/bin;如果新版安装失败的,下载的旧版预编辑 安装目录为:/usr/local/rmblast-2.2.28/bin
./configure 
#添加至全局环境变量
sudo ln -s `pwd`/RepeatMasker /usr/local/bin/RepeatMasker

软件使用实例

1. 以拟南芥, 短柄草基因组为例

# 显示程序基本用法、参数和说明
RepeatMasker 
# 显示程序详细帮助手册
RepeatMasker -help 

# 拟南芥分析实例
# 进入我存放拟南芥基因组的目录
cd ~/ref/phytozome/Athaliana/TAIR10/assembly
# 建立结果输出目录
mkdir repeat
# 运行程序:parallel是选择线程数; species是物种名,常见物种看帮助,没有的写小写拉丁属名或引号全名;  html和gff是输出html和gff格式结果,方便查看和下游分析; dir输出结果目录;基因组fa文件必须放在所有参数最后;用时8min
time RepeatMasker -parallel 30 -species arabidopsis -html -gff -dir repeat Athaliana_167_TAIR9.fa 

# 短柄草分析实例, 274MB基因组30线程用时13min
cd ~/ref/phytozome/Bdistachyon/v3.1/assembly
mkdir repeat
time RepeatMasker -parallel 30 -species brachypodium -html -gff -dir repeat Bdistachyon_314_v3.0.fa

运行开始会显示数据库的发布时间版本和物种特异数据信息,需 注释核对 ( Complete Database: dc20170127-rb20170127 ) Building species libraries in: /mnt/bai/public/bin/RepeatMasker/Libraries/dc20170127-rb20170127/brachypodium

  • 201 ancestral and ubiquitous sequence(s) for brachypodium
  • 282 lineage specific sequence(s) for brachypodium

2. 结果文件说明

*代表你基因组的名字

  1. *.out.gff:重复序列基因组注释文件,与基因注释类似,最重要结果 # 结果预览 Chr1 RepeatMasker similarity 1 107 13.2 - . Target "Motif:ATREP18" 561 649 Chr1 RepeatMasker similarity 1066 1097 10.0 + . Target "Motif:(C)n" 1 32 Chr1 RepeatMasker similarity 1155 1187 17.1 + . Target "Motif:(TTTCTT)n" 1 33
  2. *.tbl:重复序列注释结果报告信息汇总表格 overview
  3. *.out.html: 网页版结果详细,同RepeatMasker在线注释结果报告
  4. *.masked: 将注释为重复序列区的大项替换为N的基因组
  5. *.out:RepeatMasker默认输入结果格式,信息基本与gff相关
  6. *.cat.gz: 序列与重复序列比对的文件

软件安装使用常见问题

1. RMBlast安装问题

  • NCBI自从2013年2.2.28后再没有更新过rmblast ftp://ftp.ncbi.nlm.nih.gov/blast/executables/rmblast/LATEST ,我尝试安装源码包在Ubuntu16.04是无法安装的;
  • 在RepeatMasker的页面上有最近ncbi-blast-2.6.0+-src源代码和补定,按要求安装,即本文中的操作,make编辑成功,但make install有错误,不过关键程序rmblastn已经成功,可正常使用;
  • 如果新版安装失败,可尝试安装2.2.28的预译版 cd /usr/local wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.2.28/ncbi-blast-2.2.28+-x64-linux.tar.gz wget ftp://ftp.ncbi.nlm.nih.gov/blast/executables/rmblast/2.2.28/ncbi-rmblastn-2.2.28-x64-linux.tar.gz tar zxvf ncbi-blast-2.2.28+-x64-linux.tar.gz tar zxvf ncbi-rmblastn-2.2.28-x64-linux.tar.gz cp -R ncbi-rmblastn-2.2.28/* ncbi-blast-2.2.28+/ rm -rf ncbi-rmblastn-2.2.28 mv ncbi-blast-2.2.28+ rmblast-2.2.28 /usr/local/rmblast-2.2.28/bin/rmblastn -h 如果安装成功了2.2.28,则配置repeatmasker中rmblast位置则改为/usr/local/rmblast-2.2.28/bin/rmblastn

2. trf运行报错

是由于Linux legacy GLIBC的版本兼容性问题,故作者提供了两个版本,原文中的如果不可用,试试下面另一个版本

wget http://tandem.bu.edu/trf/downloads/trf409.linux64
chmod +x trf409.linux64
./trf409.linux64

3. Rpeatmasker运行时找不到依赖程序

是RepeatMasker文件中./configure步骤设置错了,再新再一次,仔细核对每个依赖程序的位置,即可正常运行。 前提是你先运行下相关依赖的程序是否可以运行!

4. 没有结果目录及结果

添加了-dir 指定输出目录,但没有结果

time RepeatMasker -parallel 30 -species arabidopsis -html -gff -dir repeat Bdistachyon_314_v3.0.fa

你一定是忘记建立结果文件夹了,程序不会自己建目录,mkdir repeat是必须的。你有两个选择,要么提前建文件夹,要么直接不用-dir result参数,把结果全都输出至当前目录。