Skip to content
Snippets Groups Projects
Commit 5e6a89c1 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Added more systematically-named list_dbIDs and list_stable_dbIDs to replace...

Added more systematically-named list_dbIDs and list_stable_dbIDs to replace list_geneIds and list_stable_geneIds; the old functions are still there for backwards compatibilty but now print a warning and call the appropriate list_ function. Common functionality for list_ functions is in BaseAdaptor.pm.
parent 5f56ff51
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ sub new { ...@@ -75,7 +75,7 @@ sub new {
Arg [1] : none Arg [1] : none
Example : @gene_ids = $gene_adaptor->list_geneIds(); Example : @gene_ids = $gene_adaptor->list_geneIds();
Description: Gets an array of internal ids for all genes in the current db Description: DEPRECATED; use list_dbIDs instead
Returntype : list of ints Returntype : list of ints
Exceptions : none Exceptions : none
Caller : ? Caller : ?
...@@ -85,26 +85,33 @@ sub new { ...@@ -85,26 +85,33 @@ sub new {
sub list_geneIds { sub list_geneIds {
my ($self) = @_; my ($self) = @_;
my @out; $self->warn("list_geneIds is deprecated; use list_dbIDs instead");
my $sth = $self->prepare("SELECT gene_id FROM gene"); return $self->list_dbIDs();
$sth->execute; }
while (my ($id) = $sth->fetchrow) { =head2 list_dbIDs
push(@out, $id);
} Arg [1] : none
Example : @gene_ids = $gene_adaptor->list_dbIDs();
Description: Gets an array of internal ids for all genes in the current db
Returntype : list of ints
Exceptions : none
Caller : ?
=cut
$sth->finish; sub list_dbIDs {
my ($self) = @_;
return \@out; return $self->_list_dbIDs("gene");
} }
=head2 list_stable_geneIds =head2 list_stable_geneIds
Arg [1] : list_stable_gene_ids Arg [1] : list_stable_gene_ids
Example : @stable_ids = $gene_adaptor->list_stable_gene_ids(); Example : @stable_ids = $gene_adaptor->list_stable_gene_ids();
Description: Returns a list stable ids for all genes in the current db Description: DEPRECATED; use list_stable_dbIDs() instead.
Returntype : list of strings Returntype : list of strings
Exceptions : none Exceptions : none
Caller : ? Caller : ?
...@@ -114,17 +121,27 @@ sub list_geneIds { ...@@ -114,17 +121,27 @@ sub list_geneIds {
sub list_stable_geneIds { sub list_stable_geneIds {
my ($self) = @_; my ($self) = @_;
my @out; $self->warn("list_stable_geneIds is deprecated; use list_stable_dbIDs instead");
my $sth = $self->prepare("SELECT stable_id FROM gene_stable_id"); return $self->list_stable_dbIDs();
$sth->execute;
while (my ($id) = $sth->fetchrow) {
push(@out, $id);
}
return \@out;
} }
=head2 list_stable_dbIDs
Arg [1] : none
Example : @stable_gene_ids = $gene_adaptor->list_stable_dbIDs();
Description: Gets an array of stable ids for all genes in the current db
Returntype : list of ints
Exceptions : none
Caller : ?
=cut
sub list_stable_dbIDs {
my ($self) = @_;
return $self->_list_dbIDs("gene_stable_id", "stable_id");
}
=head2 fetch_by_dbID =head2 fetch_by_dbID
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment