Bio::EnsEMBL::ExternalData::CDSTrack::DBSQL AccessionAdaptor
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::DBSQL::BaseAdaptor
Bio::EnsEMBL::ExternalData::CDSTrack::Accession
Bio::EnsEMBL::ExternalData::CDSTrack::DBSQL::DBAdaptor
Bio::EnsEMBL::Storable
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( deprecate throw warning stack_trace_dump )
Inherit
Bio::EnsEMBL::DBSQL::BaseAdaptor
Synopsis
No synopsis!
Description
No description!
Methods
_columns
No description
Code
_left_join
No description
Code
_objs_from_sth
No description
Code
_tables
No description
Code
fetch_all_alive
No description
Code
fetch_all_by_GroupVersion
No description
Code
fetch_all_by_group_version_id
No description
Code
fetch_all_by_organization_id
No description
Code
fetch_all_by_transcript_stable_id
No description
Code
fetch_all_by_translation_stable_id
No description
Code
fetch_by_dbID
No description
Code
Methods description
None available.
Methods code
_columnsdescriptionprevnextTop
sub _columns {
  my $self = shift;
  return ( 'a.accession_uid', 'a.nuc_acc', 'a.nuc_version', 'a.nuc_gi', 'a.prot_acc', 
  'a.prot_version', 'a.prot_gi', 'a.organization_uid', 'a.alive',
  'o.name', 'o.approval_authority');
}
_left_joindescriptionprevnextTop
sub _left_join {
  return ( [ 'Organizations', "a.organization_uid = o.organization_uid" ]);
}
_objs_from_sthdescriptionprevnextTop
sub _objs_from_sth {
  my ($self, $sth) = @_;
  my @out;
  my ($accession_uid, $transcript_stable_id, $transcript_version); 
  my ($transcript_ncbi_id, $translation_stable_id, $translation_version, $translation_ncbi_id);
  my ($organization_id, $alive, $organization, $approval_authority);
  
  $sth->bind_columns(\$ accession_uid,\$ transcript_stable_id,\$ transcript_version ,\$
  transcript_ncbi_id,\$ translation_stable_id,\$ translation_version,\$ translation_ncbi_id,\$
  organization_id,\$ alive,\$ organization,\$ approval_authority); 


  while($sth->fetch()) {
    
    push @out, Bio::EnsEMBL::ExternalData::CDSTrack::Accession->new(
              -dbID                   => $accession_uid,
              -transcript_stable_id   => $transcript_stable_id,
              -transcript_version     => $transcript_version,
              -transcript_ncbi_id      => $transcript_ncbi_id,
              -translation_stable_id  => $translation_stable_id,
              -translation_version    => $translation_version,
              -translation_ncbi_id    => $translation_ncbi_id,
              -organization_id        => $organization_id,
              -alive                  => $alive,
              -organization           => $organization,
              -approval_authority     => $approval_authority,
              -adaptor                => $self 
    );
  
    
  }
  return\@ out;
}


1;
}
_tablesdescriptionprevnextTop
sub _tables {
  my $self = shift;
  return (['Accessions' , 'a'],['Organizations', 'o']);
}
fetch_all_alivedescriptionprevnextTop
sub fetch_all_alive {
  my $self = shift;
  my $constraint = "a.alive = '1'";
  my @acc_objs = @{ $self->generic_fetch($constraint) };
  return\@ acc_objs;
}
fetch_all_by_GroupVersiondescriptionprevnextTop
sub fetch_all_by_GroupVersion {
  my $self = shift;
  my $gv = shift;
  
  if (!ref $gv || !$gv->isa('Bio::EnsEMBL::ExternalData::CDSTrack::GroupVersion') ) {
    throw("Must provide a Bio::EnsEMBL::ExternalData::CDSTrack::GroupVersion object");
  }
  
  my $gv_id = $gv->dbID;
  my @acc_objs;
  @acc_objs = @{$self->fetch_all_by_group_version_id($gv_id)};
  return\@ acc_objs;
}
fetch_all_by_group_version_iddescriptionprevnextTop
sub fetch_all_by_group_version_id {
  my $self = shift;
  my $gv_id = shift;
  my @acc_objs;
  
  
  throw("Require group_version_id for fetch_all_by_group_version_id")
         unless ($gv_id);
  
  my $sql = "SELECT agv.accession_uid ".
            "FROM Accessions_GroupVersions agv ".
            "WHERE agv.group_version_uid = '$gv_id'";
            
  
  my $sth = $self->prepare($sql);
  
  $sth->execute();
  while ( my $id = $sth->fetchrow()) {
    push @acc_objs, $self->fetch_by_dbID($id);
  }
  return\@ acc_objs;
}
fetch_all_by_organization_iddescriptionprevnextTop
sub fetch_all_by_organization_id {
  my $self = shift;
  my $org_id = shift;
  
  throw("Require organization_id for fetch_all_by_organization_id")
         unless ($org_id);
  
  my $constraint = "a.organization_uid = '$org_id'";
  my @acc_objs = @{ $self->generic_fetch($constraint) };
  return\@ acc_objs;
}
fetch_all_by_transcript_stable_iddescriptionprevnextTop
sub fetch_all_by_transcript_stable_id {
  my $self = shift;
  my $trans_acc = shift;
  my $version = shift;
  
  throw("Require transcript stable_id for fetch_all_by_transcript_stable_id")
         unless ($trans_acc);

  
  my $constraint = "a.nuc_acc = '$trans_acc'";
  if ($version){
    $constraint .= " && a.nuc_version = '$version'";
  }
  my @acc_objs = @{ $self->generic_fetch($constraint) };
  return\@ acc_objs;
}
fetch_all_by_translation_stable_iddescriptionprevnextTop
sub fetch_all_by_translation_stable_id {
  my $self = shift;
  my $trans_acc = shift;
  my $version = shift;
  
  throw("Require translation stable_id for fetch_all_by_translation_stable_id")
         unless ($trans_acc);
  
  my $constraint = "a.prot_acc = '$trans_acc'";
  if ($version){
    $constraint .= " && a.prot_version = '$version'";
  }
  my  @acc_objs = @{ $self->generic_fetch($constraint) };
  return\@ acc_objs;
}
fetch_by_dbIDdescriptionprevnextTop
sub fetch_by_dbID {
  my $self = shift;
  my $acc_id = shift;
  
  throw("Require dbID for fetch_by_dbID")
         unless ($acc_id);
  
  my $constraint = "a.accession_uid = '$acc_id'";
  my ($acc_obj) = @{ $self->generic_fetch($constraint) };
  
  return $acc_obj;
}

#sub fetch_all_status_id {
# my $self = shift;
# my $acc_id = shift;
# my $acc_version = shift;
#
# throw("Require transcript_stable_id for fetch_all_status")
# unless ($acc_id);
#
# my @status;
#
# my $sql = "SELECT agv.ccds_status_val_uid ".
# "FROM Accessions_GroupVersions agv, Accessions a ".
# "WHERE a.accession_uid = agv.accession_uid ".
# "AND a.nuc_acc = '$acc_id'";
#
# if ($acc_version){
# $sql = join "", $sql, " AND a.nuc_version = '$acc_version'";
# }
#
# my $sth = $self->prepare($sql);
# $sth->execute();
#
# while ( my $status_id = $sth->fetchrow()) {
# push @status, $status_id;
# }
#
# return \@status;
#
#
}
General documentation
No general documentation available.