Commit 1048fd7a authored by Ian Longden's avatar Ian Longden
Browse files

checking of the meta_key for 'xxxx'build.level and check if slice is toplevel...

checking of the meta_key for 'xxxx'build.level and check if slice is toplevel to limit search in seq_regions
parent 086d5d94
......@@ -301,7 +301,17 @@ sub _slice_fetch {
#find out what coordinate systems the features are in
my $mcc = $self->db->get_MetaCoordContainer();
my @feat_css = @{$mcc->fetch_all_CoordSystems_by_feature_type($tab_name)};
my @feat_css=();
my $mca = $self->db->get_MetaContainer();
my $value_list = $mca->list_value_by_key( $tab_name."build.level" );
if( @$value_list and $slice->is_toplevel()) {
push @feat_css, $slice_cs;
}
else{
@feat_css = @{$mcc->fetch_all_CoordSystems_by_feature_type($tab_name)};
}
my $asma = $self->db->get_AssemblyMapperAdaptor();
my @features;
......
......@@ -706,7 +706,31 @@ sub fetch_all {
return \@out;
}
=head2 is_toplevel
Arg : int seq_region_id
Example : my $top = $slice_adptor->is_toplevel($seq_region_id)
Description: Returns 1 if slice is a toplevel slice else 0
Returntype : int
Caller : Slice method is_toplevel
Status : At Risk
=cut
sub is_toplevel{
my $self = shift;
my $id = shift;
my $sth = $self->prepare("SELECT at.code from seq_region_attrib sra, attrib_type at WHERE sra.seq_region_id = $id AND at.attrib_type_id = sra.attrib_type_id AND at.code = 'toplevel'");
$sth->execute();
my $code = undef;
$sth->bind_columns(\$code);
while($sth->fetch){
return 1;
}
return 0;
}
=head2 fetch_by_band
......
......@@ -441,7 +441,26 @@ sub length {
return $self->{'end'} - $self->{'start'} + 1;
}
=head2 is_toplevel
Arg : none
Example : my $top = $slice->is_toplevel
Description: Returns 1 if slice is a toplevel slice else 0
Returntype : int
Caller : general
Status : At Risk
=cut
sub is_toplevel {
my ($self) = @_;
if(!defined($self->{'toplevel'})){
$self->{'toplevel'} = $self->adaptor->is_toplevel($self->get_seq_region_id);
}
return $self->{'toplevel'};
}
=head2 invert
......
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