Summary | Package variables | Synopsis | Description | General documentation | Methods |
WebCvs | Raw content |
my $dbID = $storable_object->dbID();
my $adaptor = $storable_object->adaptor();
if ( $storable_object->is_stored($db_adaptor) ) { ... }
adaptor | Description | Code |
dbID | Description | Code |
get_all_DAS_Features | No description | Code |
is_stored | Description | Code |
new | Description | Code |
adaptor | code | next | Top |
Arg [1] : Bio::EnsEMBL::DBSQL::BaseAdaptor $adaptor |
dbID | code | prev | next | Top |
Arg [1] : int $dbID |
is_stored | code | prev | next | Top |
Arg [1] : Bio::EnsEMBL::DBSQL::DBConnection |
new | code | prev | next | Top |
Arg [-ADAPTOR] : Bio::EnsEMBL::DBSQL::BaseAdaptor |
adaptor | description | prev | next | Top |
my $self = shift; if(@_) { my $ad = shift; if($ad && (!ref($ad) || !$ad->isa('Bio::EnsEMBL::DBSQL::BaseAdaptor'))) { throw('Adaptor argument must be a Bio::EnsEMBL::DBSQL::BaseAdaptor'); } $self->{'adaptor'} = $ad; } return $self->{'adaptor'}}
dbID | description | prev | next | Top |
my $self = shift; $self->{'dbID'} = shift if(@_); return $self->{'dbID'};}
get_all_DAS_Features | description | prev | next | Top |
my ($self, $slice) = @_; $self->{_das_features} ||= {}; # Cache}
$self->{_das_styles} ||= {}; # Cache
$self->{_das_segments} ||= {}; # Cache
my %das_features; my %das_styles; my %das_segments; foreach my $dasfact( @{$self->get_all_DASFactories} ){ my $dsn = $dasfact->adaptor->dsn; my $name = $dasfact->adaptor->name; my $url = $dasfact->adaptor->url; # Construct a cache key : SOURCE_URL/TYPE
# Need the type to handle sources that serve multiple types of features
my ($type) = ref($dasfact->adaptor->mapping) eq 'ARRAY' ? @{$dasfact->adaptor->mapping} : $dasfact->adaptor->mapping; $type ||=$dasfact->adaptor->type; my $key = join('/', $name, $type); if( $self->{_das_features}->{$key} ){ # Use cached
$das_features{$name} = $self->{_das_features}->{$key}; $das_styles{$name} = $self->{_das_styles}->{$key}; $das_segments{$name} = $self->{_das_segments}->{$key}; } else { # Get fresh data
my ($featref, $styleref, $segref) = ($type =~ /^ensembl_location/) ? ($dasfact->fetch_all_Features( $slice, $type )) : $dasfact->fetch_all_by_ID( $self ); $self->{_das_features}->{$key} = $featref; $self->{_das_styles}->{$key} = $styleref; $self->{_das_segments}->{$key} = $segref; $das_features{$name} = $featref; $das_styles{$name} = $styleref; $das_segments{$name} = $segref; } } return (\%das_features,\% das_styles,\% das_segments); } 1;
is_stored | description | prev | next | Top |
my $self = shift; my $db = shift; if($db and $db->isa('Bio::EnsEMBL::DBSQL::DBAdaptor')) { $db = $db->dbc(); } if(!$db || !ref($db) || !$db->isa('Bio::EnsEMBL::DBSQL::DBConnection')) { throw('db argument must be a Bio::EnsEMBL::DBSQL::DBConnection'); } my $adaptor = $self->{'adaptor'}; my $dbID = $self->{'dbID'}; if($dbID && !$adaptor) { if($message_only_once){ warning("Storable object has a dbID but not an adaptor.\n" . 'Storable objects must have neither OR both.'); $message_only_once = 0; } return 0; } if($adaptor && !$dbID) { warning("Storable object has an adaptor but not a dbID.\n". "Storable objects must have neither OR both."); return 0; } return 0 if (!$adaptor && !$dbID); my $cur_db = $adaptor->dbc(); #}
# Databases are the same if they share the same port, host and username
#
if($db->port == $cur_db->port && $db->host eq $cur_db->host && $db->dbname eq $cur_db->dbname) { return 1; } return 0;
new | description | prev | next | Top |
my $caller = shift; my $class = ref($caller) || $caller; my ($adaptor, $dbID) = rearrange(['ADAPTOR', 'dbID'],@_); if($adaptor) { if(!ref($adaptor) || !$adaptor->isa('Bio::EnsEMBL::DBSQL::BaseAdaptor')) { throw('-ADAPTOR argument must be a Bio::EnsEMBL::DBSQL::BaseAdaptor'); } } return bless({'dbID' => $dbID, 'adaptor' => $adaptor}, $class);}
LICENSE | Top |
Copyright (c) 1999-2009 The European Bioinformatics Institute and
Genome Research Limited. All rights reserved.
This software is distributed under a modified Apache license. For license details, please see /info/about/code_licence.html
CONTACT | Top |
Please email comments or questions to the public Ensembl
developers list at <ensembl-dev@ebi.ac.uk>.
Questions may also be sent to the Ensembl help desk at <helpdesk@ensembl.org>.