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

Carnë Draug carandraug+dev at gmail.com
Wed Jun 29 22:12:37 UTC 2011


> 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ë




More information about the Bioperl-l mailing list