美文网首页
mysql数据库安装及OrthoMCL使用

mysql数据库安装及OrthoMCL使用

作者: 胡小兵plus | 来源:发表于2020-05-08 22:03 被阅读0次

        直系同源基因是伴随物种分化事件而产生,而旁系同源基因是由复制事件所产生。目前,随着基因组测序的快速发展,直系同源基因的检测变得越来越重要,尤其是在进化生物学及比较基因组学方面。当前,查找直系同源基因主流的软件主要有两个:OrthoFinder和OrthoMCL。前者近些年发展较快,软件版本经常更新,功能强大,运算速度快,操作简便,安装比较友好,通过conda可直接安装使用,这两年引用也较高;而后者是用的最多的一款查找同源基因的软件,引用超高,最新版本为2013年7月公布的v2.0版本,目前为止,已经很久没更新了,官方给出的使用手册,需要13步才能完成整个运行流程,包括Mysql数据库安装及配置、OrthoMCL配置文件准备、格式转换、聚类等一系列步骤,非常繁琐,软件安装非常不友好,需要root权限。github上有人开发了OrthoMCL Pipeline,可自动化运行OrthoMCL,虽然安装超级复杂,但使用超级便利。链接如下:https://github.com/apetkau/orthomcl-pipeline/blob/master/INSTALL.md

        本文主要讲一下,OrthoMCL原始的安装方法及使用,OrthoMCL是一种用于对同源蛋白序列进行分组的基因组级别的算法。它不仅提供了由两个或多个物种/基因组共享的群体,而且还提供了代表物种特有的基因扩展家族的群体。因此,它是真核生物基因组自动注释的重要工具。基于序列的相似性,OrthoMCL可以将一组蛋白序列(比如全基因组的proteins)归类到ortholog groups、in-paralogs groups和co-orthologs。下面进入正题:

一、Mysql数据库安装及配置

1、 检测系统是否自带安装MySQL

$ rpm -qa | grep mysql

卸载自带mysql

$ rpm -e mysql    #普通模式删除

$ rpm -e --nodeps mysql  #强力删除

2、 Mysql的安装

下载MySQL5.7:wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar

$ tar -xf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar   #解压文件

$ rpm -ivh common, libs, devel, client, server   #rpm安装

$ service mysqld start   #启动mysql

$ vim /etc/my.cnf   #修改 /etc/my.cnf 在文档尾 加入 skip-grant-tables root用户免密登入

$ service mysqld restart  #重启 mysql

$ mysql -u root -p  #使用指令 mysql -u root -p 登陆 密码输入直接回车

修改root 用户信息 ,完成后删除 my.cnf 文档尾 skip-grant-tables

>use mysql;

>update user set password_expired='N' where user='root';

>update user set authentication_string=password('123456') where user='root';

>flush privileges;

3、 mysql-server的安装

下载Yum资源包

https://dev.mysql.com/downloads/repo/yum/

$ wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm  $ rpm -ivh mysql-community-release-el7-5.noarch.rpm

$ yum update

$ yum install mysql-server

4、报错解决:

(1)libs包冲突

$ rpm -e mariadb-libs-1:5.5.64-1.el7.x86_64  --nodeps #强力删除安装包

(2)

(3)mysql报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

6、Mysql数据库配置

(1)利用OrthoMCL提供的config文件进行编译

$ mysql -u root -p #登录root;密码:Waitingforyou602

$ create user 'orthomcl' identified by 'orthomcl'; #创建orthomcl用户及密码

$ GRANT ALL PRIVILEGES on *.* to 'orthomcl' WITH GRANT OPTION;

$ FLUSH PRIVILEGES;quit

(2)安装perl依赖模块

# mysql路径为/usr/bin

###配置orthomcl.config.template文件

$ cp /home/Tools/orthomclSoftware-v2.0.9/doc/OrthoMCLEngline/Main/orthomcl.config.template orthomcl.config

$ vim orthomcl.config

$ show global variables like 'port'; #查看mysql端口

$ orthomclInstallSchema orthomcl.config install_tables.log

### done

二、OrthoMCL的使用

1、 创建orthomcl输入文件

$ redun_remove protein.fasta > non_dun_protein.fasta

$ mkdir compliantFasta; cd compliantFasta

$ orthomclAdjustFasta Ath ../data/AraThaliana.fa 1

#去除可变剪切序列

2、过滤序列

$ orthomclFilterFasta pre-data/ 10 20

# 过滤序列,允许最短的protein长度为10,stop codons最大比例为20%,生成两个文件goodProteins.fasta和poolProteins.fasta

3、对goodProteins.fasta中的序列进行BLAST比对

# blastp比对

$ makeblastdb -in goodProteins.fasta -dbtype prot -out orthomcl

$ nohup blastp -db orthomcl -query goodProteins.fasta -seg yes -out orthomcl.blastout -evalue 1e-5 -outfmt 7 -num_threads 24 2> blastp.log &

4、处理blast结果

$ grep -P "^[^#]" orthomcl.blastout > blastresult

$ orthomclBlastParser blastresult compliantFasta > similarSequences.txt

$ perl -p -i -e 's/\t(\w+)(\|.*)orthomcl/\t$1$2$1/' similarSequences.txt

$ perl -p -i -e 's/0\t0/1\t-181/' similarSequences.txt

5、将similarSequences.txt载入到数据库中

$ orthomclLoadBlast ../orthomcl-install-file/orthomcl.config similarSequences.txt

6、寻找成对蛋白质

$ orthomclPairs ../orthomcl-install-file/orthomcl.config orthomcl_pairs.log cleanup=no

7、从数据库中导出数据

$ orthomclDumpPairsFiles orthomcl.config.template

此步生成mclInput文件和pairs文件夹;文件夹中包含3个文件coorthologs.txt,inparalogs.txt,orthologs.txt。

coorthologs.txt inparalogs.txt orthologs.txt

8、 mcl进行聚类

mcl mclInput --abc -I 1.5 -o mclOutput

mclInput

9、整理mcl聚类结果

orthomclMclToGroups Ath 1 < mclOutput > groups.txt

        后续分析需依赖脚本,github上有针对后续结果分析的脚本,根据需求不同可自行搜索。


参考:

Li, L., Stoeckert, C.J., Jr., and Roos, D.S. (2003). OrthoMCL: identification of ortholog groups for eukaryotic genomes. Genome Res. 13:2178–2189.

Van Dongen S. Graph clustering by flow simulation (2000). PhD Thesis, University of Utrecht, The Netherlands.

https://github.com/apetkau/orthomcl-pipeline/blob/master/INSTALL.md

http://www.chenlianfu.com/?tag=orthomcl

https://orthomcl.org/orthomcl/

https://www.cnblogs.com/gumuzi/p/5711495.html

https://www.mysql.com/downloads/

相关文章

网友评论

      本文标题:mysql数据库安装及OrthoMCL使用

      本文链接:https://www.haomeiwen.com/subject/eymqnhtx.html