[Bioperl-l] Bio::DB::Registry get_all_primary_ids

Marc Logghe Marc.Logghe at DEVGEN.com
Wed Jan 4 08:01:36 EST 2006


Hi Daniel,
As far as I can see, you are using actually only 1 database (no need to
use Bio::DB::Failover), of type Bio::DB::Flat::BinarySearch.
Using a Bio::DB::Failover object you can attach multiple databases (e.g.
Bio::DB::SeqI compliant objects). In case it fails to fetch a seq from
the first database in the list, it will try the second and so on.
Bio::DB::Failover ISA Bio::DB::RandomAccessI while
Bio::DB::Flat::BinarySearch ISA Bio::DB::SeqI. In the first case an
implementation of get_all_primary_ids is not necessary, in contrast to
the latter case.
So, you might think of using Bio::DB::Flat::BinarySearch directly if you
depend on that method and you need only 1 database.
Hope it all makes sense cos I don't have much experience with these
modules.
Cheers,
Marc

> -----Original Message-----
> From: bioperl-l-bounces at portal.open-bio.org 
> [mailto:bioperl-l-bounces at portal.open-bio.org] On Behalf Of 
> Daniel Lang
> Sent: Wednesday, January 04, 2006 11:01 AM
> To: Bioperl list
> Subject: [Bioperl-l] Bio::DB::Registry get_all_primary_ids
> 
> Hi,
> 
> I stumbled over a problem in the Registry modules:
> I wanted to use the method get_all_primary_ids as laid out in 
> Bio::DB::SeqI.
> The Bio::DB::Failover object as returned by the get_database 
> method doesn't support this method while the (in my case) 
> attached Bio::DB::Flat::BinarySearch object does!
> How can I comfortably call this method on the object?
> 
> For now I'm using something "ugly" like:
> $db->{_database}->[0]->get_all_primary_ids
> 
> Here is my object dump (Its describing a local sprot.dat):
> Bio::DB::Failover=HASH(0x87ca9a0)
>    '_database' => ARRAY(0x8b721a4)
>       0  Bio::DB::Flat::BinarySearch=HASH(0x8bbacdc)
>          '_dbfile' => HASH(0x8d02f54)
>             '/home/lang/projects/core_ortho/uniprot_sprot.dat' => 0
>          '_file' => HASH(0x8bbaf70)
>             0 => '/home/lang/projects/core_ortho/uniprot_sprot.dat'
>          '_fileid' => HASH(0x8d13ab4)
>             0 => GLOB(0x8d42adc)
>                -> *Bio::DB::Flat::BinarySearch::$fh
>                      
> FileHandle({*Bio::DB::Flat::BinarySearch::$fh}) =>
> fileno(9)
>          '_index_directory' => '/home/lang/projects/core_ortho/'
>          '_index_type' => 'flat'
>          '_index_version' => 1
>          '_primary_index_handle' => GLOB(0x8d13db4)
>             -> *Bio::DB::Flat::BinarySearch::$__ANONIO__
> 
> FileHandle({*Bio::DB::Flat::BinarySearch::$__ANONIO__}) => fileno(8)
>          '_primary_namespace' => undef
>          '_record_size' => 29
>          '_root_verbose' => 0
>          '_size' => HASH(0x8d42e48)
>             0 => 796304807
>          '_start_pos' => 4
>          'flat_dbname' => 'test'
>          'format' => 'swiss'
>          'primary_pattern' => undef
>          'secondary_namespaces' => ARRAY(0x8b8f774)
>             0  'ACC'
>          'start_pattern' => undef
> 
> As far as I understand it, the corresponding method needs to 
> be implemented in Failover?
> 
> In addition I'm somewhat confused by the term "Failover" - 
> but since the  retrieval is working like its supposed to...
> 
> Thanks in advance,
> Daniel
> 
> -- 
> 
> Daniel Lang
> University of Freiburg, Plant Biotechnology Schaenzlestr. 1, 
> D-79104 Freiburg
> fax: +49 761 203 6945
> phone: +49 761 203 6974
> homepage:  http://www.plant-biotech.net/
> e-mail: daniel.lang at biologie.uni-freiburg.de
> 
> #################################################
> My software never has bugs.
> It just develops random features.
> #################################################
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 



More information about the Bioperl-l mailing list