[Bioperl-l] [bioperl newbie] Retrieving link to protein from PubChem

Chris Fields cjfields at illinois.edu
Mon Nov 9 11:27:10 EST 2009


On Nov 9, 2009, at 10:05 AM, saikari keitele wrote:

> Hi,
>
> I'm using Bioperl to retrieve records from PubChem.
> I'm trying to find a way-but have been unsuccessful- to retrieve  
> from a
> compound record, the reference to the protein(s) that can synthesize  
> the
> compound.
> Thanks very much.
>
> saikari

The below bioperl script returns the GI for proteins that correspond  
to the substance passed on the command line; invoke using 'perl  
pc_substance.pl substance_requested'.  It probably needs more fiddling  
to catch everything but it should get you started.

For other bits and pieces (such as how to retrieve the raw sequence  
files), please see the EUtilities HOWTO:

http://www.bioperl.org/wiki/HOWTO:EUtilities_Cookbook

chris

----------------------------------------

#!/usr/bin/perl -w

use 5.010;
use strict;
use warnings;
use Bio::DB::EUtilities;

my $substance = shift;

my $eutil = Bio::DB::EUtilities->new(-eutil => 'esearch',
                                      -db => 'pcsubstance',
                                      -term => $substance,
                                      -usehistory => 'y');

my $hist = $eutil->next_History || die;

$eutil->reset_parameters(-eutil => 'elink',
                        -history => $hist,
                        -db      => 'protein',
                        -dbfrom  => 'pcsubstance',
                        -retmax  => 1000);

say join(',',$eutil->get_ids);


More information about the Bioperl-l mailing list