Re: Allowing a list of ids for -id of Bio::DB::EUtilities->new()?
"Fields, Christopher J" <[email protected]> Wed, 17 Jun 2015 12:49:22 +0000
| Newsgroups | gmane.comp.lang.perl.bio.general |
|---|---|
| Message-ID | <[email protected]> |
It does allow multiples, note Russell’s example (note it has to be passed as a reference).
my @ids = qw(200039684 200039685);
my $factory = Bio::DB::EUtilities->new(-eutil => 'elink',
-email => '[email protected]',
-db => 'pubmed',
-dbfrom => 'gds',
-id => \@ids);
The ‘single ID’ form is a convenience; the fact it works when you concatenate the IDs and pass them in as one string is happenstance, only b/c it’s doing that for you behind the scenes when you pass the IDs as a ref.
chris
> On Jun 16, 2015, at 8:36 PM, Peng Yu <[email protected]> wrote:
>
> Hi,
>
> To allow multiple ids, I have to manually concatenate ids in the form
> of a string '19008417,19008416'. Would it be better to allow it take
> the form of a list ('19008417', '19008416').
>
>
> #!/usr/bin/env perl
>
> use strict;
> use warnings;
> use Bio::DB::EUtilities;
> use XML::Simple;
> use Data::Dumper;
>
> my $factory = Bio::DB::EUtilities->new(
> -eutil => 'efetch',
> -db => 'pubmed',
> -email => '[email protected]',
> -id => '19008417,19008416',
> -retmode => 'xml',
> );
>
> #print $factory->get_Response->content;
>
> my $string=$factory->get_Response->content;
> print $string, "\n";
> my $xml=new XML::Simple;
> my $data = $xml->XMLin($string);
> print Dumper($data);
>
>
> --
> Regards,
> Peng
> _______________________________________________
> Bioperl-l mailing list
> [email protected]
> http://mailman.open-bio.org/mailman/listinfo/bioperl-l
_______________________________________________
Bioperl-l mailing list
[email protected]
http://mailman.open-bio.org/mailman/listinfo/bioperl-l