autodataming的个人博客分享 http://blog.sciencenet.cn/u/autodataming

博文

化合物在国内可否买到的

已有 3362 次阅读 2013-10-30 19:58 |个人分类:DrugDesign|系统分类:科研笔记| 购买, 化合物, 供应商, 筛药

背景:

所筛选的小分子库不是商业库,筛完药以后,我们会得到打分比较靠前的化合物,这时候我们需要想办法购买。

chemical book上面有供应商的信息,是根据cas号查询的。

利用chemical book网站,化合物的cas号以及perl,告诉你那些化合物是买的到的。

脚本puravailable.pl

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";
    }
 }

 

}


   





https://blog.sciencenet.cn/blog-950202-737517.html

上一篇:vina怎么高通量筛选(参数,速度,精度)
下一篇:perl的LWP 和linux 的crontab每天自动到小木虫上取金币
收藏 IP: 202.127.19.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-3-28 15:54

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部