|
马上注册,结交更多好友,下载更多分子模拟资源。
您需要 登录 才可以下载或查看,没有帐号?我想注册
x
背景:
所筛选的小分子库不是商业库,筛完药以后,我们会得到打分比较靠前的化合物,这时候我们需要想办法购买。
chemical book上面有供应商的信息,是根据cas号查询的。
利用chemical book网站,化合物的cas号以及perl,告诉你那些化合物是买的到的。
脚本puravailable.pl
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
#use Encode;
use utf8;
binmode(STDIN,':encoding(utf8)');
binmode(STDOUT,':encoding(utf8)');
binmode(STDERR,':encoding(utf8)');
#funciont: according the cas id to report the chemical is available in china
#usage:perl puravailable.pl -input cas.txt -output buy.txt
#author :Zhaoqiang Chen 744891290@qq.com
my $name;
my $baseurl='http://www.chemicalbook.com/Search.aspx?keyword=';
my $url;
if(@ARGV!=4)
{
$name="11006-56-7";
print '#usage:perl puravailable.pl -input cas.txt -output buy.txt';
$url="$baseurl"."$name";
#print $url;
my $content=get($url);
if($content=~/国内供应商(\(\d+\))/)
{
print "example:11006-56-7 have";
print $1;
print " vendors in china,the details in chemical book\n";
}
print "\n";
}
else
{
open FH,$ARGV[1];
open FF,">>$ARGV[3]";
while(<FH>)
{
chomp($_);
$name=$_;
$url="$baseurl"."$name";
my $content=get($url);
if($content=~/国内供应商\((\d+)\)/)
{
print "$_ have ";
print $1;
print " vendors in china,the details in chemical book\n";
print FF "$_ ";
print FF $1;
print FF "\n";
}
}
}
|
|