• 回答数

    6

  • 浏览数

    2019

  • 收藏数

    0

作者:望誰回眸 发表于 2018-12-5 16:15:34
跳转到指定楼层
由于附件中不能上传pl文件,你把后缀的doc去掉。
脚本中已经包含了使用方法,vina筛选不明白的地方可以联系我。


[code=Perl width=600px]#!/usr/bin/perl -w
use strict;
print "author: chenzhaoqiang;qq 744891290\n\n";
# 0 1 2 3

if(@ARGV<4)
{
print "usage: perl anly_log.pl -dir e:/log/ -output e:/result.txt
in the dir of log to save xxx.log
function: to anlyse the vina result : extract the best vina docking score
the result format is:
ligandname score
to deal with the log may have three case :
1 empty (in ./test/cmc_3d_9927.pdbqt.log);
2 no docking score(cmc_3d_2277.pdbqt.log);
3 success docking(cmc_3d_1394.pdbqt.log)\n";

#print $ARGV[0]," -dir", $ARGV[1],"e:/log/";
}
opendir(DR,$ARGV[1])|| die "can find the dir of log";
my @files=readdir(DR);

if(@files<=2)
{
print "errir :this log dir is empty\n";
}

=pod
#to debug
print $#files,"\n";
print $files[0],$files[1],$files[2],"\n";
=cut
=pod
shift @files;
shift @files;

print $#files,"\n";
print $files[0];
=cut


###########################################
#put energy to hash table

my %hash;
shift @files;
shift @files;
foreach my $file(@files)
{
my $filepath=$ARGV[1].$file;
open FH,$filepath or die "in the log dir can't find the file $file";
my @text=<FH>;
close(FH);

if(@text>=28)
{
#print $text[14]," ",$text[27],"\n";
if($text[14]=~/will\s+be\s+(\S+)/)
{
my $ligandname=$1;
if($text[27]=~/^\s+\d+\s+(\S+)/)
{
$hash{$ligandname}=$1;
}


}
else
{
print "error: the log file is not standard!!!\n";
}

}
}


###################################################
#sort by the energy
if(@ARGV==4)
{


open FF,">$ARGV[3]";


foreach my $key(sort {$hash{$a}<=>$hash{$b}} keys %hash)
{
print FF "$key $hash{$key}\n";
}
print "congratulation!!! successs^^\n";
}
else
{
print "error ,in the command you should follow the format
usage: perl anly_log.pl -dir e:/log/ -output e:/result.txt\n";
} [/code]
分享:
回复

使用道具

该用户从未签到

新手上路

Rank: 1

积分
11
极客币
30
主题
4
帖子
12
注册时间
2018-11-5
在线时间
1 小时
性别
保密
发表于 2018-12-5 16:21:27 | 显示全部楼层

大神,我用上面的脚本试了,一直出现 ”error: the log file is not standard!!! ”。不知道是哪里出问题了,请求帮忙分析下。

我用的是autodock_vina_1_1_2_win32.msi,所生成的log文件 中总共是34行,一般有9个pose。log文件示例如下:


“”“”
#################################################################
# If you used AutoDock Vina in your work, please cite:          #
#                                                               #
# O. Trott, A. J. Olson,                                        #
# AutoDock Vina: improving the speed and accuracy of docking    #
# with a new scoring function, efficient optimization and       #
# multithreading, Journal of Computational Chemistry 31 (2010)  #
# 455-461                                                       #
#                                                               #
# DOI 10.1002/jcc.21334                                         #
#                                                               #
# Please see http://vina.scripps.edu for more information.      #
#################################################################

Reading input ... done.
Setting up the scoring function ... done.
Analyzing the binding site ... done.
Using random seed: 493456392
Performing search ... done.
Refining results ... done.

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
   1         -7.2      0.000      0.000
   2         -7.1      1.044      1.769
   3         -7.0      2.642      5.304
   4         -6.7      1.898      4.831
   5         -6.6      1.568      2.499
   6         -6.5      3.472      7.128
   7         -6.5      3.442      5.705
   8         -6.3      3.435      5.350
   9         -6.3      3.827      5.811
Writing output ... done.
“”“”“”
回复

使用道具 举报

该用户从未签到

新手上路

Rank: 1

积分
14
极客币
37
主题
6
帖子
17
注册时间
2018-11-5
在线时间
1 小时
性别
保密
 楼主| 发表于 2018-12-5 16:21:33 | 显示全部楼层
找个阳性化合物做个对照。一般-10;结合模式
回复

使用道具 举报

该用户从未签到

新手上路

Rank: 1

积分
11
极客币
30
主题
4
帖子
12
注册时间
2018-11-5
在线时间
1 小时
性别
保密
发表于 2018-12-5 16:21:52 | 显示全部楼层
谢谢回答。能具体说一下您编写的脚本怎么使用吗?linux新手,啥也不懂
回复

使用道具 举报

该用户从未签到

新手上路

Rank: 1

积分
14
极客币
37
主题
6
帖子
17
注册时间
2018-11-5
在线时间
1 小时
性别
保密
 楼主| 发表于 2018-12-5 16:22:03 | 显示全部楼层
从log文件中提取打分的
回复

使用道具 举报

该用户从未签到

新手上路

Rank: 1

积分
12
极客币
33
主题
5
帖子
14
注册时间
2018-11-5
在线时间
3 小时
性别
保密
发表于 2018-12-5 16:22:20 | 显示全部楼层
谢谢分享。请问如何判断对接结果好还是不好的标准是什么?也就是说结合能一般大于多少算好?除了看结合能外,还要看哪些指标?阈值说多少
回复

使用道具 举报

该用户从未签到

新手上路

Rank: 1

积分
14
极客币
37
主题
6
帖子
17
注册时间
2018-11-5
在线时间
1 小时
性别
保密
 楼主| 发表于 2018-12-5 16:22:45 | 显示全部楼层
linux 下面,用grep命令一下就出来了.
回复

使用道具 举报

高级模式 评论
您需要登录后才可以回帖 登录 | 立即注册 微信登录
关于作者
望誰回眸

用户组:新手上路

  • 主题

    6

  • 帖子

    17

  • 关注者

    1