[Bioperl-l] How (from where) to retrieve FieldInfo objects?

Smithies, Russell Russell.Smithies at agresearch.co.nz
Wed Jun 29 22:30:04 UTC 2011


How about just returning ASN.1 then parsing that?
There's far more data in that format than any of the others.

my $factory = Bio::DB::EUtilities->new(-eutil      => 'esearch',
                                       -term       => 'h2afx[sym] AND human[organism]',
                                       -db         => 'gene',
						   -usehistory => 'y');


my $hist  = $factory->next_History || die "No history data returned";
 
$factory->set_parameters(-eutil   => 'efetch',-history => $hist);

print Dumper $factory->get_Response;


--Russell


> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Carnë Draug
> Sent: Thursday, 30 June 2011 10:13 a.m.
> To: Brian Osborne
> Cc: bioperl mailing list
> Subject: Re: [Bioperl-l] How (from where) to retrieve FieldInfo
> objects?
> 
> > On Jun 29, 2011, at 4:53 PM, Carnë Draug wrote:
> >
> > Hi
> >
> > By using the einfo script that comes with bioperl I get a list of
> > fields of info that I want to access
> >
> > $ einfo --database=gene
> >
> > If I understood correctly the man page of the script, this returns
> the
> > list of info I should be able to obtain when searching the 'gene'
> > database. As such, I tried to use EUtilities esearch to access this
> > info.
> >
> > Using the deobfuscator, I understood that I should create a
> > Bio::Tools::EUtilities::Query EUtitlities object with
> > Bio::DB::EUtilities esearch. With this object I could use the
> > get_FieldInfo method to obtain an array of FieldInfo objects or the
> > next_FieldInfo method to obtain one of them. However, I'm failing
> > miserably at this. My search returns no FieldInfo objects whatsoever.
> >
> > my $factory = Bio::DB::EUtilities->new(
> >                                       -eutil  => 'esearch',
> >                                       -db     => 'gene',
> >                                       -term   => 'h2afx[sym] AND
> > human[organism]',
> >                                       -retmax => 5,
> >                                       );
> >
> > ## this returns nothing
> > my @fields = $factory->get_FieldInfos;
> >
> > ## it also never gets into this loop
> > while (my $field = $factory->next_FieldInfo) {
> >  say "hello";
> > }
> >
> > My question is how to I access the info fields mentioned when I use
> > the einfo script. I can't find any info on this.
> 
> 2011/6/29 Brian Osborne <bosborne11 at verizon.net>:
> > Carne, something like:
> >
> > #!/usr/bin/perl
> > use Bio::DB::EUtilities;
> > # Get all the fields for a db:
> > #
> > my $factory = Bio::DB::EUtilities->new(-eutil => 'einfo',
> >                                         -db => 'genomeprj', );
> > $factory->print_all;
> 
> Hi Brian
> 
> thank for you answer. Maybe I'm just misunderstanding the point of the
> FieldInfo objects. The script you sent gives me a list of the Field
> Infos, which if I understood correctly is the list of infos I can
> obtain for a specific database (genomeprj in your case). But when I
> search that specific database, how do I get that info?
> 
> For example, running the code you mentioned, one of the Field Info has
> the name 'Sequencing Center' and the code CEN. So when I search the
> genomeprj database with a query, how do I get that value from the
> results?
> 
> Thanks
> Carnë
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================




More information about the Bioperl-l mailing list