[Biopython] Entrez.efetch problem when querying pccompound database

Chris Fields cjfields at illinois.edu
Mon Nov 1 14:50:59 UTC 2010


Try using esummary instead of efetch to get that information programmatically.  Some database information can't be retrieved via efetch (I think pcassay/pccomopund are two of those), but the summary of the information for any database is retrievable.  

Using the BioPerl eutil interface, one does this to just dump the returned information.  One can also get at the various bits of that data programmatically as well using generic constructs, but you have to know the tag names for the data you are looking for.  There should be an analogous Biopython way to do this.

===================================

use Bio::DB::EUtilities;

my $term = '"BSYNRYMUTXBXSQ-UHFFFAOYSA-N"[InChIKey]';

my $eutil = Bio::DB::EUtilities->new(-eutil => 'esearch',
                                     -term  => $term,
                                     -email => 'cjfields at bioperl.org',
                                     -db    => 'pccompound',
                                     -usehistory => 'y');

my $hist = $eutil->next_History || die "Can't retrieve history data";

$eutil->set_parameters(-eutil     => 'esummary',
                         -history   => $hist);

$eutil->print_all;

===================================

chris

On Nov 1, 2010, at 6:24 AM, saikari keitele wrote:

> Many thanks for your reply.
> Does that mean that pccompound and pcassay databases can not be queried
> programmatically, they just have to be queried manually?
> Thanks again
> 
> On Fri, Oct 29, 2010 at 1:13 PM, Peter <biopython at maubp.freeserve.co.uk>wrote:
> 
>> On Fri, Oct 29, 2010 at 12:26 PM, saikari keitele <saikari78 at gmail.com>
>> wrote:
>>> Hi,
>>> 
>>> I'm using BioPython to query the NCBI pccompound database.
>>> I'm trying to retrieve the molecular weight of a compound given its
>>> InChIKey.
>>> Gettting the ID of the compound with esearch works fine. For instance:
>>> 
>>> Entrez.esearch(db="pccompound",
>>> term='"BSYNRYMUTXBXSQ-UHFFFAOYSA-N"[InChIKey]')
>>> 
>>> However, when I try to retrieve the record's content with efetch from the
>> ID
>>> returned by esearch, like this:
>>> 
>>> Entrez.efetch(db="pcassay", id="2244")
>>> 
>>> I get the following response:
>>> ...
>>> Error occurred: Report 'ASN1' not found in 'pccompound' presentation
>>> ...
>>> 
>>> I've tried to use other return types and return modes, like for instance
>>> 
>>> Entrez.efetch(db="pcassay", id="2244", rettype="abstract",
>> retmode="text")
>>> 
>>> but I have not succeeded in retrieveing this compound's record's content.
>>> Many thanks for any help on how to retrieve information on a compound
>> from
>>> pccompound.
>>> 
>>> Best wishes
>>> 
>>> Saikari
>> 
>> If you go to the webpage for this,
>> http://www.ncbi.nlm.nih.gov/pcassay?term=2244
>> then you don't actually get any download links - rather it connects to the
>> BioAssay server to retrieve data. My guess is the NCBI don't support
>> efetch for the pcassay database - you'll have to email them and ask.
>> 
>> Peter
>> 
> _______________________________________________
> Biopython mailing list  -  Biopython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython





More information about the Biopython mailing list