Bio::EnsEMBL::ExternalData::Mole::DBSQL
DBXrefAdaptor
Toolbar
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
No synopsis!
Description
No description!
Methods
_columns | No description | Code |
_objs_from_sth | No description | Code |
_tables | No description | Code |
fetch_all_by_Entry | No description | Code |
fetch_all_by_dbID_list | No description | Code |
fetch_all_by_entry_id | No description | Code |
fetch_by_database_id | No description | Code |
fetch_by_dbID | No description | Code |
fetch_by_entry_id | No description | Code |
fetch_by_primary_id | No description | Code |
fetch_by_quaternary_id | No description | Code |
fetch_by_secondary_id | No description | Code |
fetch_by_tertiary_id | No description | Code |
Methods description
None available.
Methods code
sub _columns
{ my $self = shift;
return ( 'dbxrf.dbxref_id', 'dbxrf.entry_id',
'dbxrf.database_id', 'dbxrf.primary_id',
'dbxrf.secondary_id', 'dbxrf.tertiary_id',
'dbxrf.quaternary_id'); } |
sub _objs_from_sth
{ my ($self, $sth) = @_;
my @out;
my ( $dbxref_id, $entry_id, $database_id,
$primary_id, $secondary_id,
$tertiary_id, $quaternary_id );
$sth->bind_columns(\$ dbxref_id,\$ entry_id,\$ database_id,\$
primary_id,\$ secondary_id,\$
tertiary_id,\$ quaternary_id );
while($sth->fetch()) {
push @out, Bio::EnsEMBL::ExternalData::Mole::DBXref->new(
-adaptor => $self,
-dbID => $dbxref_id,
-entry_id => $entry_id,
-database_id => $database_id,
-primary_id => $primary_id,
-secondary_id => $secondary_id || undef,
-tertiary_id => $tertiary_id || undef,
-quaternary_id => $quaternary_id || undef
);
}
return\@ out;
}
1; } |
sub _tables
{ my $self = shift;
return (['dbxref' , 'dbxrf']); } |
sub fetch_all_by_Entry
{ my $self = shift;
my $entry = shift;
my $sth = $self->prepare(
"SELECT dbxrf.dbxref_id ".
"FROM dbxref dbxrf ".
"WHERE dbxrf.entry_id = ?");
$sth->bind_param(1, $entry->dbID, SQL_INTEGER);
$sth->execute();
my @dbxrefids;
while (my $id = $sth->fetchrow) {
push @dbxrefids, $id;
}
$sth->finish();
my @obj_ids = @dbxrefids;
my @dbxrefs;
foreach my $id (@obj_ids) {
my $dbxref_object = $self->fetch_by_dbID($id);
push @dbxrefs, $dbxref_object;
}
return\@ dbxrefs; } |
sub fetch_all_by_dbID_list
{ my ($self,$id_list_ref) = @_;
if(!defined($id_list_ref) || ref($id_list_ref) ne 'ARRAY') {
croak("kill object id list reference argument is required");
}
return [] if(!@$id_list_ref);
my @out;
my @tabs = $self->_tables;
my ($name, $syn) = @{$tabs[0]};
my $max_size = 200;
my @id_list = @$id_list_ref;
while(@id_list) {
my @ids;
if(@id_list > $max_size) {
@ids = splice(@id_list, 0, $max_size);
} else {
@ids = splice(@id_list, 0);
}
my $id_str;
if(@ids > 1) {
$id_str = " IN (" . join(',', @ids). ")";
} else {
$id_str = " = " . $ids[0];
}
my $constraint = "${syn}.${name}_id $id_str";
push @out, @{$self->generic_fetch($constraint)};
}
return\@ out; } |
sub fetch_all_by_entry_id
{ my ($self, $id) = @_;
my $sth = $self->prepare(
"SELECT dbxrf.dbxref_id ".
"FROM dbxref dbxrf ".
"WHERE dbxrf.entry_id = ?");
$sth->bind_param(1, $id, SQL_INTEGER);
$sth->execute();
my @array = @{$sth->fetchall_arrayref()};
my @ids = map {$_->[0]} @array;
my $dbxref_objs = $self->fetch_all_by_dbID_list(\@ids);
return $dbxref_objs; } |
sub fetch_by_database_id
{ my $self = shift;
my $database_id = shift;
my $constraint = "dbxrf.database_id = '$database_id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
sub fetch_by_dbID
{ my ($self, $id) = @_;
my $constraint = "dbxrf.dbxref_id = '$id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
sub fetch_by_entry_id
{ my $self = shift;
my $entry_id = shift;
my $constraint = "dbxrf.entry_id = '$entry_id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
sub fetch_by_primary_id
{ my $self = shift;
my $primary_id = shift;
my $constraint = "dbxrf.primary_id = '$primary_id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
sub fetch_by_quaternary_id
{ my $self = shift;
my $quaternary_id = shift;
my $constraint = "dbxrf.quaternary_id = '$quaternary_id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
sub fetch_by_secondary_id
{ my $self = shift;
my $secondary_id = shift;
my $constraint = "dbxrf.secondary_id = '$secondary_id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
fetch_by_tertiary_id | description | prev | next | Top |
sub fetch_by_tertiary_id
{ my $self = shift;
my $tertiary_id = shift;
my $constraint = "dbxrf.tertiary_id = '$tertiary_id'";
my ($dbxref_obj) = @{ $self->generic_fetch($constraint) };
return $dbxref_obj; } |
General documentation
No general documentation available.