通过PAML中的CODEML模块计算dnds的过程以及踩坑
最近帮女朋友做毕业设计的时候用到了 PAML这个软件的codeml功能,发现网上相关的资料很少,于是把自己踩的一些坑分享一下,希望能帮到其他有相同困难的人
一、下载与安装
PAML软件下载地址
http://abacus.gene.ucl.ac.uk/software/paml4.9j.tgz
DAMBE软件下载地址
http://dambe.bio.uottawa.ca/DAMBE/dambe_install_win.aspx
二、使用方法
首先准备好你的fas文件
我们需要将fas文件转换一下格式,方法很多,我这边说两种方法,这两种方法最后得到的文件内容完全相同,只是后缀名不同
方法一:
使用python脚本转换
将你的*.fas文件与脚本放在同一目录下,执行脚本,会生成一个.phy文件
import re
with open('seven.fas', 'r') as fin:
sequences = [(m.group(), ''.join(m.group().split()))
for m in re.finditer(r'(?m)^>([^ \n]+)[^\n]*([^>]*)', fin.read())]
with open('seven.phy', 'w') as fout:
fout.write('%d %d\n' % (len(sequences), len(sequences[][])))
for item in sequences:
fout.write('%-20s %s\n' % item)
方法二:
使用DAMBE软件转换格式
1.打开DAMBE,选择 File -> Open standard sequence file -> 文件类型选择为包含 fas 类型 -> 选择你的fas文件

2.点击 go

3.点击 File -> save or convert sequence format -> 选择 paml 格式

4.手动修改 *.pml 的后缀名为 *.nuc
通过以上两个方法会得到一份 *.phy 或者 *.nuc 文件
接下来需要去除序列中的终止密码子
你可以全选文件内容查找替换 将 TAG/TAA/TGA 替换为 ---
也可以使用下面这个python脚本
import re with open(r'seven.phy', 'r') as f:
content = f.read()
content = content.replace("TAG","---")
content = content.replace("TAA", "---")
content = content.replace("TGA", "---")
# print(content) with open('sevenend.phy', 'w') as f:
f.write(content)
会生成一个去除过终止密码子的文件
现在将这个处理过后的序列文件*.phy与树文件、配置文件codeml.ctl三个放在 \paml4.9j\bin 目录下
配置文件codeml.ctl内容如下可参考 一般修改前面三行即可 按顺序为序列文件名 树文件名 输出文件名
seqfile = seven.nuc * sequence data filename
treefile = Newick * tree structure file name
outfile = test.txt * main result file name noisy = * ,,,,: how much rubbish on the screen
verbose = * : concise; : detailed, : too much
runmode = - * : user tree; : semi-automatic; : automatic
* : StepwiseAddition; (,):PerturbationNNI; -: pairwise seqtype = * :codons; :AAs; :codons-->AAs
CodonFreq = * :/ each, :F1X4, :F3X4, :codon table * ndata =
clock = * :no clock, :clock; :local clock; :CombinedAnalysis
aaDist = * :equal, +:geometric; -:linear, -:G1974,Miyata,c,p,v,a
aaRatefile = dat/jones.dat * only used for aa seqs with model=empirical(_F)
* dayhoff.dat, jones.dat, wag.dat, mtmam.dat, or your own model =
* models for codons:
* :one, :b, : or more dN/dS ratios for branches
* models for AAs or codon-translated AAs:
* :poisson, :proportional, :Empirical, :Empirical+F
* :FromCodon, :AAClasses, :REVaa_0, :REVaa(nr=) NSsites = * :one w;:neutral;:selection; :discrete;:freqs;
* :gamma;:2gamma;:beta;:beta&w;:betaγ
* :beta&gamma+; :beta&normal>; :&2normal>;
* :3normal> icode = * :universal code; :mammalian mt; -:see below
Mgene =
* codon: :rates, :separate; :diff pi, :diff kapa, :all diff
* AA: :rates, :separate fix_kappa = * : kappa fixed, : kappa to be estimated
kappa = * initial or fixed kappa
fix_omega = * : omega or omega_1 fixed, : estimate
omega = . * initial or fixed omega, for codons or codon-based AAs fix_alpha = * : estimate gamma shape parameter; : fix it at alpha
alpha = . * initial or fixed alpha, :infinity (constant rate)
Malpha = * different alphas for genes
ncatG = * # of categories in dG of NSsites models getSE = * : don't want them, 1: want S.E.s of estimates
RateAncestor = * (,,): rates (alpha>) or ancestral states ( or ) Small_Diff = .5e-
cleandata = * remove sites with ambiguity data (:yes, :no)?
* fix_blength = * : ignore, -: random, : initial, : fixed, : proportional
method = * Optimization method : simultaneous; : one branch a time * Genetic codes: :universal, :mammalian mt., :yeast mt., :mold mt.,
* : invertebrate mt., : ciliate nuclear, : echinoderm mt.,
* : euplotid mt., : alternative yeast nu. : ascidian mt.,
* : blepharisma nu.
* These codes correspond to transl_table to of GENEBANK.
在此目录下打开命令行
输入一下命令即可
codeml

当前目录下就会出现结果文件 test.txt 以及其他文件了
在过程中我遇到过许多报错提供给大家参考一下
67 columns are converted into ??? because of stop codons
这个报错是因为没有去除文件中的终止密码子,可以参考上面的步骤去除
Error: Error in sequence data file: . in 1st seq.?.
Error: check #seqs and tree: perhaps too many '('?.
Make sure to separate the sequence from its name by 2 or more spaces.
以上报错均为你的序列文件内容/格式有问题,麻烦按照上面的步骤重新生成序列文件或者参考其他人的文件格式
通过PAML中的CODEML模块计算dnds的过程以及踩坑的更多相关文章
- 在mac版virtual box中安装ubuntu虚拟机的NAT/Host-Only网络配置踩坑记录
之前用惯了vmware和parallels desktop,网络配置十分智能,基本不用自己配置.由于版权原因,工作电脑上换了免费的virtual box用,四五年都完全在虚拟机里干活的本菜鸡居然在虚拟 ...
- 13.在项目中部署redis企业级数据备份方案以及各种踩坑的数据恢复容灾演练
到这里为止,其实还是停留在简单学习知识的程度,学会了redis的持久化的原理和操作,但是在企业中,持久化到底是怎么去用得呢? 企业级的数据备份和各种灾难下的数据恢复,是怎么做得呢? 1.企业级的持久化 ...
- 游戏中VIP会员模块的简单实现
哈哈 今天周末有时间,再整理一篇博文上来,虽然已经不做游戏老长时间了,但还是要把以前做过的东西总结一下,借此可以回顾以前的东西,也可以分享给大家. 今天说一下游戏中VIP会员模块的实现思路.每款游戏 ...
- Python中函数和模块的体验与使用
函数基础 目标 函数的快速体验 函数的基本使用 函数的参数 函数的返回值 函数的嵌套调用 在模块中定义函数 01. 函数的快速体验 1.1 快速体验 所谓函数,就是把 具有独立功能的代码块 组织为一个 ...
- python中的常用模块
python中常用的模块 time: 1)time.localtime([secs]):将一个时间戳转换为当前时区的struct_time.secs参数未提供,则以当前时间为准. 2)time.gmt ...
- 创建多进程之multiprocess包中的process模块
创建多进程之multiprocess包中的process模块 1.process模块是一个创建进程的模块 Process([group [, target [, name [, args [, kwa ...
- python使用datetime模块计算各种时间间隔的方法
python使用datetime模块计算各种时间间隔的方法 本文实例讲述了python使用datetime模块计算各种时间间隔的方法.分享给大家供大家参考.具体分析如下: python中通过datet ...
- 【转帖】一文看懂docker容器技术架构及其中的各个模块
一文看懂docker容器技术架构及其中的各个模块 原创 波波说运维 2019-09-29 00:01:00 https://www.toutiao.com/a6740234030798602763/ ...
- PIL 中的 Image 模块
转载:http://www.cnblogs.com/way_testlife/archive/2011/04/20/2022997.html PIL 中的 Image 模块 本文是节选自 PIL ...
随机推荐
- PHP-fpm 远程代码执行漏洞(CVE-2019-11043)复现
简介 9 月 26 日,PHP 官方发布漏洞通告,其中指出:使用 Nginx + php-fpm 的服务器,在部分配置下,存在远程代码执行漏洞.并且该配置已被广泛使用,危害较大. 漏洞概述 Nginx ...
- windows下常用快捷指令记忆
快速打开环境变量窗口 sysdm.cpl --系统设置 快速打开远程桌面程序 mstsc ---Microsoft terminal services client 快速打开事件查看器 eventvw ...
- phpspider框架的使用
手册:https://doc.phpspider.org/configs-members.html 参考:https://www.jianshu.com/p/01052508ea7c 不多说,代码贴上 ...
- JQ获取select上的option的data-start和data-id
来源:https://zhidao.baidu.com/question/692142321436883524.html 静态的写法: 用jq的attr()函数,如: HTML: <select ...
- Windows 自动登录
https://serverfault.com/questions/840557/auto-login-a-user-at-boot-on-windows-server-2016 Use Sysint ...
- apollo 项目配置中心开源框架部署
apollo 于我带来的好处 1. 项目之前的配置信息全部都在 resources 目录下,当然这里我使用的是 Spring Boot 搭建的项目.使用 apollo 后,配置信息全部转移到 apol ...
- mybatis 批量保存,并且唯一约束
1.主键返回在insert配置中添加两个属性 useGeneratedKeys="true" keyProperty="id" 2.唯一约束冲突可以使用 ON ...
- 关于用C-free进行C语言编程在电脑中生成的.exe和.o文件
在使用C-free进行C语言编程时,程序运行后会自动在电脑文件中生成以.exe和.o为后缀名的文件: 1,生成的.exe文件为系统自动打包完成的应用程序,该程序可直接在其他无C-free环境的电脑上运 ...
- nginx日志、nginx日志切割、静态文件不记录日志和过期时间
2019独角兽企业重金招聘Python工程师标准>>> 12.10 Nginx访问日志 日志格式 vim /usr/local/nginx/conf/nginx.conf //搜索l ...
- Java本地的项目,怎么可以让别人通过外网访问-内网穿透
2019独角兽企业重金招聘Python工程师标准>>> 一.点击链接 https://natapp.cn/ 注册个免费的账户 NATAPP官网 二.登陆进去以后查看authtoken ...