paml正选择报错

2024-02-27  本文已影响0人  多啦A梦的时光机_648d

运行/home/lx_sky6/yt/script/positive_select/branch_site_steve1.py报错:
我们查看codeml生成的mlc.out里面的内容:

Traceback (most recent call last):
  File "/home/lx_sky6/yt/script/positive_select/branch_site_steve1.py", line 27, in <module>
    lnL1 = float(lines[4])
IndexError: list index out of range
错误 正常

会发现ntime:和np:两个后面少了空格。由于提取的脚本第24-29行是

 24                         for line in IN:
 25                                 if line.startswith('lnL(ntime:'):
 26                                         lines = line.split()
 27                                         lnL1 = float(lines[4])
 28                                         np1 = lines[3]
 29                                         np1 = int(np1.rstrip('):'))

可以看到默认分割,所以这里没有空格就娶不到第5位。因此在:后面加上空格即可。

sed -i 's/ntime:/ntime: /g' run_paml/*/*/mlc.out
sed -i 's/np:/np: /g' run_paml/*/*/mlc.out
再次运行/home/lx_sky6/yt/script/positive_select/branch_site_steve1.py
python /home/lx_sky6/yt/script/positive_select/branch_site_steve1.py ./run_paml prank

得到结果:

matK.best.fas.trimal.phy        -4053.374987    179     -4057.501107    178     8.252239999999802       1       0.004070174 16;225;243;313;399
ndhB.best.fas.trimal.phy        -2444.644374    179     -2441.330465    178     6.627817999999934       1       0.010039818 285
上一篇下一篇

猜你喜欢

热点阅读