None available.
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'); } |
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; } |
sub _tables
{ my $self = shift;
return (['Accessions' , 'a'],['Organizations', 'o']); } |
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; } |
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; } |
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; } |
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; } |
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; } |
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;
}
} |