zoukankan      html  css  js  c++  java
  • OrhtoMCL 使用方法

    OrthoMCL的使用分13步进行,如下:

    1. 安装和配置数据库

    Orthomcl可以使用Oracle和Mysql数据库,而在这里只介绍使用Mysql数据库。
    修改配置文件/etc/my.cnf,对Mysql进行如下配置:

    1. 设置InnoDB_sort_buffer_size的值为可用内存的一半;
    2. 设置InnoDB_max_sort_file_size为orthomclBlastParser程序生成文件similarSequences.txt的5倍大小;
    3. 软件的说明文档中设置read_buffer_size的值为???,但是设置为3个问号或1个问号,则mysql启动不了。我将其设置为2000M。

    2. 安装mcl软件

    mcl,即Markov Clustering algorithm,其最新的软件下载地址:http://www.micans.org/mcl/src/mcl-latest.tar.gz。下载后使用’./configure && make && make install’安装即可。

    3. 安装并配置OrthoMCL软件

    下载OrthoMCL软件(http://orthomcl.org/common/downloads/software/)后,解压缩后,其中包含文件夹:bin、config、doc、lib四个文件夹。
    在一个工作目录中运行OrthoMCL,该目录包含数据文件和结果文件。将doc/OrthoMCLEngine/Main/orthomcl.config.template复制到工作目录中。该文件为OrthoMCL的配置文件,以使用mysql数据库为例,其中的内容如下:

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

    4. 安装orthomcl数据库的表

    首先,进入mysql数据库,新建一个名为orthomcl的数据库;然后,使用orthomclInstallSchema命令在数据库中创建一些表,这些表的名字则是orthomcl.config.template配置文件中指定的5个名称。

    $ mysql -u test -p
    mysql> create database orthomcl;
    $ cp /opt/biosoft/orthomclSoftware-v2.0.9/doc/OrthoMCLEngine/Main/orthomcl.config.template .
    $ orthomclInstallSchema orthomcl.config.template [log species]

    orthomclInstallSchema命令后面不接参数则给出帮助文档。以上命令使用orthomcl.config.template配置文件中的设置生成了数据库中相应的表,如果加入方括号中的内容,则会生成日志文件log,生成的表后缀都是species。

    5. 创建orthomcl的输入文件

    orthomcl的输入文件为fasta格式文件,但是fasta文件的序列名称要满足这样的要求:

    >taxoncode|unique_protein_id
    MHDR...
    >hsa|sequence_1
    MHDR...
    >led|scaffold_1.1
    MHDR...

    序列名第一列是物种的代码,一般是3到4个字母;中间使用’|'符号隔开;第二列是蛋白质序列独一无二的id。
    一般输入文件是fasta格式,其序列名由空格或’|'隔开,使用orthomclAdjustFasta程序,将fasta文件转换出兼容orthomcl的fasta文件

    $ redun_remove protein.fasta > non_dun_protein.fasta
    $ mkdir compliantFasta; cd compliantFasta
    $ orthomclAdjustFasta led ../non_dun_protein.fasta 1

    上述命令去除可变剪切的蛋白质序列;创建了文件夹compliantFasta;然后使用orthomclAdjustFasta命令选取了protein.fasta序列名的第一列作为输出的fasta文件的序列id;输出的文件为led.fasta.

    6. 过滤序列

    对compliantFasta文件夹中的序列进行过滤,允许的最短的protein长度是10,stop codons最大比例为20%;生成了两个文件goodProteins.fasta和poorProteins.fasta两个文件。

    $ orthomclFilterFasta compliantFasta/ 10 20

    compliantFasta只能过滤低质量的序列。而实际上最好还需要过滤掉可变剪切,只留取可变剪切中最长的蛋白质序列,这个需要自行解决。

    7. 对goodProteins.fasta中的序列进行BLAST

    下载最新版本的Blast+,和最新版本的OrthoMCL DB的protein序列,将OrthoMCL DB的protein序列加上gooProtein.fasta中的序列合到一起做成一个blast+的数据库。然后对基因组的蛋白质序列进行比对。

    $ /opt/biosoft/ncbi-blast-2.2.28+/bin/makeblastdb -in orthomcl.fasta -dbtype prot -title orthomcl -parse_seqids -out orthomcl -logfile orthomcl.log
    $ /opt/biosoft/ncbi-blast-2.2.28+/bin/blastp -db orthomcl -query goodProteins.fasta -seg yes -out orthomcl.blastout -evalue 1e-5 -outfmt 7 -num_threads 24

    生成orthomcl的blast DB需要97秒左右;使用-outfmt 7生成带注释的表格结果,这一步需要很长时间了,取决于电脑的运算性能。我使用24个线程,每分钟运行约27.75条序列,大约7.2个小时,运行1.2万条protein序列的比对。
    blast中使用了-seg yes表示使用seg程序来进行过滤,将那些影响比对结果的低复杂度区域过滤掉。blast生成的文件结果,从第1列到第12列分别是:query id, subject id, % identity, alignment length, mismatches, gap opens, q. start, q. end, s. start, q. end, evalue, bit score。

    8. 处理Blast的结果

    对上一步blast的结果进行处理,从而得到序列的相似性结果,以用于导入到orthomcl数据库中。compliantFasta文件夹中包含下载下来的OrthoMCL DB的所有蛋白质数据的文件orthomcl.fasta.

    $ grep -P "^[^#]" orthomcl.blastout > blastresult
    $ orthomclBlastParser blastresult compliantFasta > similarSequences.txt
    $ perl -p -i -e 's/	(w+)(|.*)orthomcl/	$1$2$1/' similarSequences.txt
    $ perl -p -i -e 's/0	0/1	-181/' similarSequences.txt

    第一条命令将orthomcl.blastout中的注释行去掉,生成新的文件blastresult,不然再下一个命令中会报错的。

    第二条命令生成文件similarSequences.txt,从第1列到第8列分别是:query_id, subject_id, query_taxon, subject_taxon, evalue_mant, evalue_exp, percent_ident, percent_match。值得注意的是subject_taxon是orthomclBlastParser读取的在compliantFasta文件夹中fasta文件的前缀,在此结果中,这一列则全是orthomcl。

    第三条命令将subject_taxon修改为正确的分类名。

    第四条命令修改evalue_mant, evalue_exp,将evalue为0修改为1e-181,这在后续步骤寻找pairwise relationships时候有要求。

    9. 将similarSequences.txt载入到数据库中

    生成的similarSequences.txt文件大小为83M,则修改/etc/my.cnf文件,在InnoDB_sort_buffer_size这一行上加一行‘InnoDB_max_sort_file_size = 424960’。数值是83M的5倍。然后运行:

    $ orthomclLoadBlast orthomcl.config.template similarSequences.txt

    10. 寻找成对的蛋白质

    $ orthomclPairs orthomcl.config.template orthomcl_pairs.log cleanup=no

    输入为数据库中的表SimilarSequences,和数据库的空表InParalog, Ortholog, CoOrtholog tables;输出为对这些空表的操作。故配置文件中的用户要有 update/insert/truncate权限。

    11. 将数据从数据库中导出

    $ orthomclDumpPairsFiles orthomcl.config.template

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

    12. 使用mcl进行对pairs进行聚类

    $ mcl mclInput --abc -I 1.5 -o mclOutput

    13. 对mcl的聚类结果进行编号

    $ orthomclMclToGroups led 1 < mclOutput > groups.txt

    对聚类结果进行编号,依次为led1,led2, led3…

    注意事项

    第7步Blast,是整个过程中最关键的一步。有以下2点需要注意:

    1. 数据库中的蛋白质序列数量:在OrthoMCL DB中选取和要分析的物种亲缘关系较近的几个物种的基因组,或下载其它公布的基因组,加上要分析的物种的基因组;使用这些基因组总体的蛋白质序列来构建Blast数据库。如果只是使用要分析的物种的蛋白质序列建数据库,则inparalogs文件中成对的序列实际上是paralogs,数目比真正的inparalogs要多很多。使用所有的OrthoMCL DB中的序列,第5版版含150个基因组,信息量太大,不使用几百个核的超算或计算机集群去运行,是很不现实的。

    2. 对数据库中所有的蛋白质序列来使用blast比对到该数据库中得到结果。如果只是对要分析的物种进行Blast,则只能得到inparalogs的信息,而没有orthologs和coorthologs。

    原文来自:http://www.hzaumycology.com/chenlianfu_blog/?p=1818

  • 相关阅读:
    UNIX环境高级编程——信号说明列表
    [Fiddler]如何让Fiddler可以抓取https的请求
    [Cookie] Read Cookie and Pass in headers
    [Training Video
    [Training Video
    [Training Video
    [Training Video
    [Training Video
    [Training Video
    [Training Video
  • 原文地址:https://www.cnblogs.com/xiaojikuaipao/p/7513294.html
Copyright © 2011-2022 走看看