Commit 349f1c4b authored by Ian Longden's avatar Ian Longden
Browse files

added order as an optional argument to list_dbIDs, mosy useful for genes and...

added order as an optional argument to list_dbIDs, mosy useful for genes and transcripts so caching is maximised
parent e1acca24
......@@ -216,13 +216,16 @@ sub dbc{
# returns listref of IDs
sub _list_dbIDs {
my ($self, $table, $pk) = @_;
my ($self, $table, $pk, $ordered) = @_;
if (!defined($pk)) {
$pk = $table . "_id";
}
my @out;
my $sql = "SELECT " . $pk . " FROM " . $table;
if(defined($ordered) and $ordered){
$sql .= " order by seq_region_id, seq_region_start"
}
my $sth = $self->prepare($sql);
$sth->execute;
......@@ -235,6 +238,7 @@ sub _list_dbIDs {
return \@out;
}
# _straight_join
# Arg [1] : (optional) boolean $new_val
......
......@@ -467,6 +467,7 @@ sub _objs_from_sth {
Example : @feature_ids = @{$density_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all density features in the
current db
Arg[1] : <optional> int. not set to 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -475,9 +476,9 @@ sub _objs_from_sth {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("density_feature");
return $self->_list_dbIDs("density_feature",undef, $ordered);
}
......
......@@ -365,6 +365,7 @@ sub _objs_from_sth {
Example : @feature_ids = @{$dna_align_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all dna align features in
the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -373,9 +374,9 @@ sub _objs_from_sth {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("dna_align_feature");
return $self->_list_dbIDs("dna_align_feature",undef, $ordered);
}
1;
......
......@@ -441,6 +441,7 @@ sub remove {
Arg [1] : none
Example : @exon_ids = @{$exon_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all exons in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -449,9 +450,9 @@ sub remove {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("exon");
return $self->_list_dbIDs("exon",undef, $ordered);
}
......
......@@ -113,6 +113,7 @@ sub _left_join {
Example : @gene_ids = @{$gene_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all genes in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : Listref of Ints
Exceptions : none
Caller : general
......@@ -121,9 +122,9 @@ sub _left_join {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self,$ordered) = @_;
return $self->_list_dbIDs("gene");
return $self->_list_dbIDs("gene",undef, $ordered);
}
......@@ -151,7 +152,6 @@ sub list_seq_region_ids {
return $self->_list_seq_region_ids('gene');
}
=head2 fetch_by_display_label
Arg [1] : String $label - display label of gene to fetch
......
......@@ -214,6 +214,7 @@ sub fetch_by_chr_band {
Example : @kary_ids = @{$karyotype_band_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all karyotype bands in the
current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : reference to a list of ints
Exceptions : none
Caller : ?
......@@ -222,9 +223,9 @@ sub fetch_by_chr_band {
=cut
sub list_dbIDs {
my $self = shift;
my ($self, $ordered) = shift;
return $self->_list_dbIDs("karyotype");
return $self->_list_dbIDs("karyotype",undef, $ordered);
}
......
......@@ -508,6 +508,7 @@ sub _objs_from_sth {
Example : @feature_ids = @{$misc_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all misc_features in the
current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -516,9 +517,9 @@ sub _objs_from_sth {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self,$ordered) = @_;
return $self->_list_dbIDs("misc_feature");
return $self->_list_dbIDs("misc_feature",undef,$ordered);
}
......
......@@ -495,6 +495,7 @@ sub store{
Example : my @feature_ids = @{$ofa->list_dbIDs()};
Description: Gets an array of internal IDs for all OligoFeature objects in
the current database.
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : List of ints
Exceptions : None
Caller : ?
......@@ -503,9 +504,9 @@ sub store{
=cut
sub list_dbIDs {
my $self = shift;
my ($self,$ordered) = shift;
return $self->_list_dbIDs('oligo_feature');
return $self->_list_dbIDs('oligo_feature',undef,$ordered);
}
1;
......
......@@ -261,6 +261,7 @@ sub remove {
Arg [1] : none
Example : @exon_ids = @{$exon_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all exons in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -269,9 +270,9 @@ sub remove {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self,$ordered) = @_;
return $self->_list_dbIDs("prediction_exon");
return $self->_list_dbIDs("prediction_exon",undef, $ordered);
}
......
......@@ -541,6 +541,7 @@ sub remove {
Example : @feature_ids = @{$prediction_transcript_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all prediction transcript
features in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -549,9 +550,9 @@ sub remove {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("prediction_transcript");
return $self->_list_dbIDs("prediction_transcript", undef, $ordered);
}
1;
......@@ -346,6 +346,7 @@ sub _columns {
Example : @feature_ids = @{$protein_align_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all protein align
features in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : listref of ints
Exceptions : none
Caller : ?
......@@ -354,9 +355,9 @@ sub _columns {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self,$ordered) = @_;
return $self->_list_dbIDs("protein_align_feature");
return $self->_list_dbIDs("protein_align_feature", undef, $ordered);
}
......
......@@ -460,6 +460,7 @@ sub store {
Arg [1] : none
Example : @feature_ids = @{$repeat_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all repeat features in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -469,9 +470,9 @@ sub store {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("regulatory_feature");
return $self->_list_dbIDs("regulatory_feature", undef, $ordered);
}
=head2 fetch_all_by_ensembl_object_type
......
......@@ -352,6 +352,7 @@ sub store {
Arg [1] : none
Example : @feature_ids = @{$repeat_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all repeat features in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -361,9 +362,9 @@ sub store {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("regulatory_search_region");
return $self->_list_dbIDs("regulatory_search_region", undef, $ordered);
}
......
......@@ -462,6 +462,7 @@ sub store {
Arg [1] : none
Example : @feature_ids = @{$repeat_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all repeat features in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -470,9 +471,9 @@ sub store {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("repeat_feature");
return $self->_list_dbIDs("repeat_feature", undef, $ordered);
}
1;
......
......@@ -311,6 +311,7 @@ sub _objs_from_sth {
Arg [1] : none
Example : @feature_ids = @{$simple_feature_adaptor->list_dbIDs()};
Description: Gets an array of internal ids for all simple features in the current db
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : list of ints
Exceptions : none
Caller : ?
......@@ -319,9 +320,9 @@ sub _objs_from_sth {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("simple_feature");
return $self->_list_dbIDs("simple_feature", undef, $ordered);
}
1;
......@@ -1067,6 +1067,7 @@ sub update {
Example : @transcript_ids = @{ $t_adaptor->list_dbIDs };
Description: Gets a list of internal ids for all transcripts in the db.
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : Listref of Ints
Exceptions : none
Caller : general
......@@ -1075,9 +1076,9 @@ sub update {
=cut
sub list_dbIDs {
my ($self) = @_;
my ($self, $ordered) = @_;
return $self->_list_dbIDs("transcript");
return $self->_list_dbIDs("transcript",undef, $ordered);
}
......
......@@ -366,9 +366,9 @@ sub update_ditag {
=cut
sub list_dbIDs {
my $self = shift;
my ($self, $ordered) = shift;
return $self->_list_dbIDs('ditag');
return $self->_list_dbIDs('ditag');
}
1;
......@@ -655,6 +655,7 @@ sub update_ditagFeature {
Example : my @feature_ids = @{$dfa->list_dbIDs()};
Description: Gets an array of internal IDs for all DitagFeature objects in
the current database.
Arg[1] : <optional> int. not 0 for the ids to be sorted by the seq_region.
Returntype : List of ints
Exceptions : None
Status : Stable
......@@ -662,9 +663,9 @@ sub update_ditagFeature {
=cut
sub list_dbIDs {
my $self = shift;
my ($self, $ordered) = shift;
return $self->_list_dbIDs('ditag_feature');
return $self->_list_dbIDs('ditag_feature', undef, $ordered);
}
1;
Markdown is supported
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