Bio::EnsEMBL::Compara::DBSQL SequenceAdaptor
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::DBSQL::BaseAdaptor
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Inherit
Bio::EnsEMBL::DBSQL::BaseAdaptor
Synopsis
No synopsis!
Description
No description!
Methods
fetch_by_dbID
No description
Code
store
No description
Code
Methods description
None available.
Methods code
fetch_by_dbIDdescriptionprevnextTop
sub fetch_by_dbID {
  my ($self, $sequence_id) = @_;

  my $sql = "SELECT sequence.sequence FROM sequence WHERE sequence_id = ?";
  my $sth = $self->prepare($sql);
  $sth->execute($sequence_id);

  my ($sequence) = $sth->fetchrow_array();
  $sth->finish();
  return $sequence;
}

#
# STORE METHODS
#
################
}
storedescriptionprevnextTop
sub store {
  my ($self, $sequence) = @_;
  my $seqID;

  return 0 unless($sequence);

  my $dcs = $self->dbc->disconnect_when_inactive();
  $self->dbc->disconnect_when_inactive(0);

  #27/4/2009 kb3 Commented out the following lines so that we no longer check if 
#a sequence already exists since this can take a very long time for the 2X
#genomes. May end up with duplicate sequences but we expect this to be rare.
# $self->dbc->do("LOCK TABLE sequence WRITE");
#my $sth = $self->prepare("SELECT sequence_id FROM sequence WHERE sequence = ?");
#$sth->execute($sequence);
#($seqID) = $sth->fetchrow_array();
#$sth->finish;
#unless($seqID) {
my $length = length($sequence); my $sth2 = $self->prepare("INSERT INTO sequence (sequence, length) VALUES (?,?)"); $sth2->execute($sequence, $length); $seqID = $sth2->{'mysql_insertid'}; $sth2->finish; #}
#$self->dbc->do("UNLOCK TABLES");
$self->dbc->disconnect_when_inactive($dcs); return $seqID; } 1;
}
General documentation
No general documentation available.