OrthoMCL Pipeline 安装

热爱美食的朋友们,安利我朋友目前正在运营的一个美食餐厅公众号douke_home
也非常欢迎大伙儿前来我朋友餐厅探索美味,这是豆壳餐厅地址:(1) 苏州市姑苏区学士街418号(距苏州地铁1号线养育巷站3号口390m); (2)苏州市姑苏区南新路与西中市交叉口

序列的一致性(identity)、相似性(similarity) 、同源性(homology)

  • 一致性:Sequence identity is the amount of nucleotides or amino acids in the same position in aligned sequences. Hereby, gaps are not counted and the measurement is relational to the shorter of the two sequences.

  • 相似性:指一种很直接的数量关系。比如说,A序列和B序列的相似性是80%。属于量化关系。

  • 同源性:指从一些数据中推断出的两个基因或蛋白质序列具有共同祖先的结论,属于质的判断。

相似性和同源性关系:一般来说,序列间的相似性越高的话,它们是同源序列的可能性就更高。

序列相似性比较:将待研究序列与DNA或蛋白质序列库进行比较,用于确定该序列的生物属性,也就是找出与此序列相似的已知
序列是什么。完成这一工作只需要使用两两序列比较算法。常用的程序包有BLAST等;

序列同源性分析:将待研究序列加入到一组与之同源,但来自不同物种的序列中进行多序列同时比较,以确定该序列与其它序列间是否存在同源关系。完成这一工作必须使用多序列比较算法。常用的程序包有clustalX/W等;

参考链接:

同源序列可分为两种:直系同源(orthology)和旁系同源(paralogy)

  • 直系同源: 由同一祖先进化而来的相对应的基因(功能一致)
  • 旁系同源:基因组内因基因复制而形成的多个基因(功能差异较大)


直系同源的序列因物种形成(speciation)而被区分开(separated):若一个基因原先存在于某个物种,而该物种分化为了两个物种,那么新物种中的基因是直系同源的;旁系同源的序列因基因复制(gene duplication)而被区分开(separated):若生物体中的某个基因被复制了,那么两个副本序列就是旁系同源的。

直系同源的一对序列称为直系同源体(orthologs),旁系同源的一对序列称为旁系同源体(paralogs)。

若两个旁系同源基因(paralogs)的基因拷贝(gene duplication)是已发生在物种形成前,则这两个旁系同源(paralogs)可互称为“前重复同源基因”(outparalogs),可简称为“前重复”(outparalogs);若于物种形成后某个直系同源基因(an ortholog)才发生基因复制(gene duplication),则互称为“后重复”(inparalogs)。
在这里插入图片描述

OrthoMCL

OrthoMCL( https://orthomcl.org/orthomcl/about.do#methods )是一款基于序列相似性,识别一组基因序列或蛋白序列中潜在的inparalog, ortholog和co-ortholog pairs的软件。
在这里插入图片描述
为了找到orthologous genes,OrthoMCL算法经过几个不同的阶段。总结如下:

  • Sequence filtering
  • All-versus-all BLAST
  • Computing percent match length for each blast hit
  • Finding potential inparalog, ortholog and co-ortholog pairs
  • Using the MCL program to cluster the pairs into groups
    在这里插入图片描述

安装OrthoMCL Pipeline

# 下载安装包
wget -c https://github.com/apetkau/orthomcl-pipeline/archive/master.zip

1. 安装perl模块

# 如果安装不成功,需要单独安装,或者需要加上 --force 参数尝试重新安装,或则Google搜索别人的解决方案
cpanm BioPerl DBD::mysql DBI Parallel::ForkManager \
YAML::Tiny Set::Scalar Text::Table Exception::Class \
Test::Most Test::Warn Test::Exception Test::Deep \
Moose SVG Algorithm::Combinatorics

2. 安装其依赖软件

# 下载运行该流程所依赖的其他软件安装包
## 1. blast-2.2.26(注意:不是blast+)
wget -c ftp://ftp.ncbi.nlm.nih.gov/blast/executables/legacy.NOTSUPPORTED/2.2.26/blast-2.2.26-x64-linux.tar.gz

## 2. OrthoMCL
### 不要安装 OrthoMCL,否则在后续运行测试数据时会遇到这个问题:https://github.com/apetkau/orthomcl-pipeline/issues/25
### wget -c https://orthomcl.org/common/downloads/software/v2.0/orthomclSoftware-v2.0.9.tar.gz
### 安装OrthoMCL Custom
wget -c https://github.com/apetkau/orthomclsoftware-custom/archive/master.zip
unzip master.zip
mv orthomclsoftware-custom-master/ orthomcl-custom-v2.0.9

## 3. mcl-14-137
wget -c https://micans.org/mcl/src/mcl-latest.tar.gz

## 4. 解压安装后将以下语句添加环境变量至文件~/.bash_profile中
export PATH="/path/software/orthomcl-custom-v2.0.9/bin:$PATH"
export PATH="/path/software/mcl-14-137/bin:$PATH"
export PATH="/path/software/blast-2.2.26/bin:$PATH"

## 4. 检验依赖环境是否解决
perl scripts/orthomcl-pipeline-setup.pl
# Checking for Software dependencies...
# Checking for OthoMCL ... OK
# Checking for formatdb ... OK
# Checking for blastall ... OK
# Checking for mcl ... OK
# Wrote new configuration to orthomcl-pipeline/scripts/../etc/orthomcl-pipeline.conf
# Wrote executable file to orthomcl-pipeline/scripts/../bin/orthomcl-pipeline
# Please add directory orthomcl-pipeline/scripts/../bin to PATH

3. 数据库设置

# 如果之前已经创建了orthomcl数据库,则使用参数:--no-create-database
$ perl scripts/orthomcl-setup-database.pl --user orthomcl \
--password orthomcl --host localhost --database orthomcl \
--outfile orthomcl.conf --no-create-database

Connecting to database orthmcl on host orthodb with user orthomcl ...
OK
Config file **orthomcl.conf** created.

# 如果未创建orthomcl数据库,则需要:
## 1. 先创建用户:orthomcl
$ mysql -u root -p 
Enter password: 

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE VIEW, INDEX, DROP on *.* to "orthomcl"@"localhost" identified by "orthomcl"; #创建用户,设置用户密码并授权
# Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges; # 确保权限正确更新
# Query OK, 0 rows affected (0.00 sec)

mysql> show databases; # 确保此数据库列表中orthomcl数据库存在
# +--------------------+
# | Database           |
# +--------------------+
# | information_schema |
# | mysql              |
# | orthomcl           |
# | wordpress          |
# +--------------------+
# 4 rows in set (0.00 sec)

mysql> exit

## 2. 再创建数据库并生成配置脚本
$ perl scripts/orthomcl-setup-database.pl --user orthomcl \
--password orthomcl --host localhost --database orthomcl \
--outfile orthomcl.conf

Connecting to mysql and creating database **orthmcldb** on host orthodb with user orthomcl ...
OK
database orthmcl created ...OK
Config file **orthomcl.conf** created.

## 3. 将以下语句添加环境变量至文件~/.bash_profile中
export PATH="/path/software/orthomcl-pipeline/bin:$PATH"
export PATH="/path/software/orthomcl-pipeline/scripts:$PATH"

3.1 忘记mysql 密码的解决方案

#注意:以下操作是需要root权限
#0. 检查MySQL版本,因为版本不一样,使用的MySQL的语句有差异
mysql --version
# mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

#1. 首先,关闭实例
ps aux |grep mysql
# root      9784  0.0  0.0 113036  1420 ?        S    Sep11   0:00 /bin/sh /usr/bin/mysqld_safe --skip-grant-tables --skip-networking
# mysql     9879  0.0  0.0 378564 29888 ?        Sl   Sep11   0:26 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --skip-grant-tables --skip-networking --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock

kill 9879

#2. 停止MySQL服务
/etc/init.d/mysqld stop

#3. 以安全模式启动MySQL
mysqld_safe --skip-grant-tables --skip-networking &

#4. 登录MySQL
mysql -u root -p

mysql> use mysql;
mysql> update user set password=password("123456") where user="root";
mysql> flush privileges;
mysql> quit

#5. 开启MySQL服务
/etc/init.d/mysqld start

测试

1. 获取输入数据

cd /path/software/orthomcl-pipeline
#
wget --no-check-certificate -c https://share.corefacility.ca/index.php/s/2fb62f38f4828897ca24efe8fc181a0c/download
tar -xjvf download
cd microbial-informatics-2014/

cp Course/MI_workshop_2014/day6/annotations-cholera-small.tar.gz ./
tar xzvf annotations-cholera-small.tar.gz

2. 数据库设置

参考上述 安装OrthoMCL Pipeline中的数据库设置

3. 重命名输入文件

ls annotations-small/*.faa | xargs -t -i rename ".faa" ".fasta" {}

4. 运行orthomcl-pipeline

cd microbial-informatics-2014/
orthomcl-pipeline -i annotations-small/ -o output-small -m ../orthomcl.conf --nocompliant

#  Starting OrthoMCL pipeline on: Tue Apr 22 18:16:11 2014
#  Git commit: 2467fdfe0976354f0ca42841fff777c74971f66e
#  
#  
#  =Stage 1: Validate Files =
#  ...

如果屏幕上输出:

Warning: some tables exist already in database dbi:mysql:orthomcl:localhost:mysql_local_infile,
user=orthomcl, database_name=orthomcl. Do you want to remove (y/n)?

则输入y。这将删除存储在orthomcl数据库中的任何先前结果,以便OrthoMCL可以正常运行。当整个流程运行结束时,可以看到类似如下的输出信息:

Orthomcl Pipeline ended on Tue Apr 22 18:16:18 2014
Took 0.12 minutes to complete
Parameters used can be viewed in orthomcl.conf and orthomcl-output-small/log/run.properties
Groups file can be found in orthomcl-output-small/groups/groups.txt

5. 查看输出结果

cp Course/MI_workshop_2014/day6/orthomcl-output-small.tar.gz ./
tar -xvvzf orthomcl-output-small.tar.gz

ls orthomcl-output-small/
# blast_dir  blast_load  blast_results  compliant_fasta  groups  log  pairs

# OrthoMCL的主要输出文件是orthomcl-output-small/groups/groups.txt,
# 其中包含整个输入基因组集中的潜在orthologs and paralogs的列表,
# 每行一组orthologs,ortholog group中基因由空格分隔。
head orthomcl-output-small/groups/groups.txt 
# group_1: 2010EL-1749|2010EL-1749_00001 3554-08|3554-08_01855 VC-1|VC-1_02403 VC-10|VC-10_02048 ......
# group_2: 2010EL-1749|2010EL-1749_00002 3554-08|3554-08_01856 VC-1|VC-1_02404 VC-10|VC-10_02049 ......
# group_3: 2010EL-1749|2010EL-1749_00003 3554-08|3554-08_01857 VC-1|VC-1_02405 VC-10|VC-10_02050 ......

# aim: get an overall picture of the results and make comparisons of genes among different groups of genomes. 
# nml_parse_orthomcl.pl: construct a venn diagram of the genes in common among a group of genomes.
cat genome-groups.txt
# nepal: VC-25,VC-26,VC-14
# haiti: 2010EL-1749,2010EL-1786,2010EL-1796,2010EL-1798,2011EL-2317,2012V-1001,3554-08,VC-10,VC-15,VC-18,VC-19,VC-1,VC-6
# c6706: C6706

nml_parse_orthomcl.pl -i orthomcl-output-small/groups/groups.txt -g genome-groups.txt \
-s --draw -o orthomcl-stats.txt --genes

nml_parse_orthomcl.pl 将会生成两个主要文件:韦恩图(genome-groups.txt.svg)和一些统计信息(orthomcl-stats.txt)

统计信息文件orthomcl-stats.txt显示有关OrthoMCL结果的摘要统计信息。示例文件内容如下:

Genomes not included in group file:


Number of genes seen in the following genomes:

VC-14: 17
2011EL-2317: 19
VC-26: 17
2010EL-1796: 19
3554-08: 19
VC-15: 19
2010EL-1749: 19
VC-19: 19
2010EL-1798: 19
2012V-1001: 19
VC-1: 19
C6706: 19
VC-10: 19
VC-25: 17
VC-6: 19
2010EL-1786: 19
VC-18: 19

Total genes seen: 317

'Core' gene sets that is contained: 17 genomes has 17 genes
Found 2 for the following set: haiti
2010EL-1749_02114,2010EL-1796_03119,2010EL-1798_02875,2011EL-2317_03311, ...
2010EL-1749_02115,2010EL-1796_03118,2010EL-1798_02876,2011EL-2317_03310, ...
Found 1 for the following set: c6706
C6706_01322,C6706_01324

需要注意的一个特殊部分是Genomes not included in group file。 如果此部分有基因组列出,表明这些基因组被排除在分析之外,则需要调整genomes-groups.txt文件,将这些基因组纳入,再重新运行nml_parse_orthomcl.pl。

另外需要注意的一个部分是**‘Core’ gene sets that is contained:**,包含所定义的每个基因组所特有的基因ID列表,以及未考虑的任何其他基因组。例如,haiti有两个基因集,可以使用grep查看gene ID 2010EL-1749_02114的更多信息。

grep '2010EL-1749_02114' annotations-small/*.fasta
# annotations-small/2010EL-1749.fasta:>2010EL-1749_02114 DNA polymerase V subunit UmuC

参考链接:

  • https://github.com/apetkau/orthomcl-pipeline/blob/master/INSTALL.md
  • https://github.com/apetkau/microbial-informatics-2014/tree/master/labs/orthomcl
  • https://github.com/apetkau/microbial-informatics-2014/blob/master/labs/orthomcl/READMELargeDataset.md
  • https://www.cnblogs.com/ivictor/p/9243259.html
  • https://blog.csdn.net/mycwq/article/details/17262655
  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值