Footsteps on my way !
perl/linux/测序分析

OrthoMCL 安装配置与使用

1. mysql安装配置(点我)

2. 创建数据库和数据库用户

2.1 以root身份登陆mysql server

./bin/mysql --defaults-file=mysql.cnf -u root -p

2.2 创建数据库和用户

CREATE DATABASE orthomcl; #建数据库
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE VIEW,CREATE, INDEX, DROP on orthomcl.* TO orthomcl@localhost;  #授权
set password for orthomcl@localhost = password('123456');

3. 为mysql安装perl依赖包

3.1 检查依赖包是否安装(不报错说明已经安装,反之报错)

$ perl -MDBI -e 1 (我的不报错说明已安装)
$ perl -MDBD::mysql -e 1 (报错,需要安装,见步骤3.2)

3.2 以root身份安装,没有root见3.2s

perl -MCPAN -e shell
cpan> o conf makepl_arg "mysql_config=/share/soft/mysql/bin/mysql_config"
cpan> install Data::Dumper
cpan> install DBI
cpan> force install DBD::mysql

若遇到:“ install_driver(mysql) failed: Can’t load ‘/usr/local/lib64/perl5/auto/DBD/mysql/mysql.so’ for module DBD::mysql: libmysqlclient.so.18: ” 类似的错误,把libmysqlclient.so.18所在目录的路径名加到“/etc/ld.so.conf”文件中,接着运行ldconfig即可( 详情点我

4 安装MCL软件

mcl,即Markov Clustering algorithm,其最新的软件下载地址:http://www.micans.org/mcl/src/mcl-latest.tar.gz。下载后使用’./configure , make ,make test, make install’ 安装MCL到 /usr/local/bin/mcl。(这一步比较简单一般没有问题出现)

5 安装配置orthomcl软件

a. 下载OrthoMCL软件(http://orthomcl.org/common/downloads/software/)后,解压缩后,其中包含文件夹:bin、config、doc、lib四个文件夹。
b . 将bin目录加入\$PATH: vi /etc/profile 在最后一行加入:export PATH=/share/soft/OrthoMCL/orthomclSoftware-v2.0.9/bin:$PATH
至此运行环境已配好,下面几步是每次分析都需要进行的操作,这里测试下所有的步骤:

6. orthomclInstallSchema 安装orthomcl数据库的表

在解压好的目录中(其实这个目录可在随意位置)建立my_orthomcl_dir目录,并将orthomcl.config.template复制到该目录,下面是如何设置该文件:

dbVendor=mysql   #使用的数据库为mysql
dbConnectString=dbi:mysql:orthomcl   #使用mysql数据库中名为orthomcl的数据库
dbLogin=orthomcl    #数据库的用户名
dbPassword=orthomcl123  #相应的密码
similarSequencesTable=SimilarSequences #
orthologTable=Ortholog
inParalogTable=InParalog
coOrthologTable=CoOrtholog
interTaxonMatchView=InterTaxonMatch
percentMatchCutoff=50
evalueExponentCutoff=-5
oracleIndexTblSpc=NONE

Usage:
orthomclInstallSchema config_file sql_log_file [table_suffix]
#比如 [myname@localhost my_orthomcl_dir]$ orthomclInstallSchema orthomcl.config.template install_schema.log  
#使用orthomcl.config.template配置文件中的设置生成了数据库中相应的表(初始化orthomcl数据库用以进行接下来的运算)

7 orthomclAdjustFasta 创建orthomcl的输入文件

注意:
First, for any organism that has multiple protein fasta files, combine them all into one single proteome fasta file
第一,每个物种的蛋白序列可能由多个fasta文件组成,将它们合并成单个文件。
Then, create an empty my_orthomcl_dir/compliantFasta/ directory, and change to that directory. Run orthomclAdjustFasta once for each input proteome fasta file. It will produce a compliant file in the new directory. Check each file to ensure that the proteins all have proper IDs.
第二,建立目录 my_orthomcl_dir/compliantFasta/,并切换到该目录;对每个蛋白序列的fasta文件,运行一次orthomclAdjustFasta。检测各输出文件,确保每个序列名称均合适。

Usage:
orthomclAdjustFasta taxon_code fasta_file id_field
#比如:orthomclAdjustFasta hum human.fasta  4

taxon_code:3到4个字符组成,物种名称的缩写;
fasta_file:输入的蛋白序列
id_field:整数;确定物种名称中,那个区域段的字符作为输出的protein的id(unique_protein_id);区域段由“空格”或“|”分开。例如: ID (AP_000668.1)在第4区域段,>gi|89106888|ref|AP_000668.1|
输出文件名为 taxon_code.fasta 比如 hum,fasta;序列名称为 >taxoncode|unique_protein_id 比如 >hum|AP_000668.1

8 orthomclFilterFasta 过滤文件

(需要进入到compliantFasta的上层目录: 运行:cd ../   #进入my_orthomcl_dir) ,这一步将会对你刚才改写的蛋白文件进行过滤,去除长度小于XX(自己设定min_length),stop coden(自己设定max_percent_stops)所占百分比的序列
运行要求:1)compliantFasta目录里,每个物种的所有的蛋白序列包含在一个fasta文件中;
                   2)每个fasta文件的名称格式必须为xxxx.fasta,其中xxxx是unique的物种名称,3-4个letter
                   3)每个序列的名称格式统一成>xxxx|yyyyyyyy;其中xxxx为3-4个letter的unique物种名,yyyyyyy为unique的ID。

Usage:
orthomclFilterFasta   input_dir   min_length    max_percent_stops   [good_proteins_file  poor_proteins_file]  

#比如 orthomclFilterFasta compliantFasta/ 10 20

输出:my_orthomcl_dir/goodProteins.fasta、my_orthomcl_dir/poorProteins.fasta、以及report of suspicious proteomes

9  blast 对上一步得到的goodProteins.fasta序列进行BLAST

(这里用的是blast-2.2.26)

Usage:

formatdb -i goodProteins.fasta
blastall -p blastp -i goodProteins.fasta -d goodProteins.fasta -m 8 -F F -b 1000 -v 1000 -a 2 -o all_VS_all.out.tab  #这一步事实上为MCL提供相似矩阵

10  orthomclBlastParser  将上一步得到的blast比对结果进行解析,以用于导入到orthomcl数据库中.

Usage:

orthomclBlastParser my_blast_results compliantFasta/ > similarSequences.txt
#比如 orthomclBlastParser all_VS_all.out.tab compliantFasta/ > similarSequences.txt

11 orthomclLoadBlast  将similarSequences.txt载入到数据库中

Usage:
orthomclLoadBlast orthomcl.config.template similarSequences.txt
#比如 orthomclLoadBlast orthomcl.config.template similarSequences.txt

12 orthomclPairs 将在database中SimilarSequences表中的数据,进行pairs的运算

产生三个表格存在于 mysql
– PotentialOrthologs table
– PotentialInParalogs table
– PotentialCoOrthologs table

Usage:
orthomclPairs orthomcl.config orthomcl_pairs.log cleanup=no
 #比如 orthomclPairs orthomcl.config.template orthomcl_pairs.log cleanup=no

13 orthomclDumpPairsFiles 将数据从数据库中导出

生成mclInput文件和另外一个文件夹pairs,在这个pairs中,包含着这些蛋白之间的关系

Usage:
orthomclDumpPairsFiles orthomcl.config.template

#比如 orthomclDumpPairsFiles orthomcl.config.template

14 mcl 这一步开始对上一步给出的输出文件,进行mcl操作,开始聚类, 输出文件为mclOutput文件

Usage: 

mcl my_orthomcl_dir/mclInput --abc -I 1.5 -o my_orthomcl_dir/mclOutput

#比如 mcl mclInput --abc -I 1.5 -o mclOutput 

15 orthomclMclToGroups  对mcl的聚类结果进行编号

在这个文件中,每一行表示一个家族.
注:my_prefix 指定在groups.txt中每个家族的前缀,如:GF_ 则在groups.txt中,每个家族以GF_开始
1 表示家族从1开始编码
Usage:
orthomclMclToGroups my_prefix 1 < mclOutput > groups.txt
#比如 orthomclMclToGroups G_ 1 < mclOutput > groups.txt

尊重他人劳动成果,转载请注明出处:Bluesky's blog » OrthoMCL 安装配置与使用

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址