Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge commit 'a9ec659cf3e808bc2e576262aae5be75cc276a1c'
  • Loading branch information
lstein committed Jun 9, 2011
2 parents fecf2ee + a9ec659 commit f871d69
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -1,3 +1,7 @@
2.38
* Fix more semantic zooming bugs.
* Fix blank tracks when viewing a datasource composed of only a single BAM database.

2.37
* Fix summary mode to work again when no explicit configuration given.

Expand Down
9 changes: 6 additions & 3 deletions lib/Bio/Graphics/Browser2/DataSource.pm
Expand Up @@ -586,7 +586,7 @@ sub karyotype_setting {
sub semantic_setting {
my ($self,$label,$option,$length) = @_;
my $slabel = $self->semantic_label($label,$length);
my $val = $self->code_setting($slabel => $option) if defined $slabel;
my $val = $self->code_setting($slabel => $option) if defined $slabel;

return $val if defined $val;
return $self->code_setting($label => $option);
Expand All @@ -597,10 +597,11 @@ sub semantic_label {
return $label unless defined $length && $length > 0;

my $mult = $self->global_setting('details multiplier') || 1;
$length /= $mult;
# round a bit
$length = int(0.5+($length+1)/$mult);

# look for:
# 1. a section like "Gene:100000" where the cutoff is less than the length of the segment
# 1. a section like "Gene:100000" where the cutoff is <= the length of the segment
# under display.
# 2. a section like "Gene" which has no cutoff to use.
if (my @lowres = map {[split ':']}
Expand Down Expand Up @@ -751,6 +752,8 @@ sub invert_types {
$label = $1;
$length = $2;
}

$length *= $self->global_setting('details multiplier') || 1;
my $feature = $self->semantic_setting($label => 'feature',$length) or next;
my ($dbid) = $self->db_settings($label => $length) or next;
$dbid =~ s/:database$//;
Expand Down
9 changes: 6 additions & 3 deletions lib/Bio/Graphics/Browser2/Region.pm
Expand Up @@ -244,7 +244,12 @@ sub lookup_features {
{

warn "searchopts = ",join ',',%$searchopts if DEBUG;
last SEARCHING unless %$searchopts;
unless (%$searchopts) {
warn "segment(-name => $name,-start=>$start,-end=>$stop)" if DEBUG;
my @f = $db->segment(-name => $name,-start=>$start,-end=>$stop);
$features = \@f;
last SEARCHING;
}

for my $n ([$name,$start,$stop],
[$literal_name,undef,undef]) {
Expand Down Expand Up @@ -349,8 +354,6 @@ sub _feature_get {

warn "get_features_by_alias(@argv) => @features" if DEBUG;

# warn "get_feature_by_alias(@argv) => @features";

@features = grep {$_->length} $db->segment(@argv)
if !@features && $name !~ /[*?]/;
return [] unless @features;
Expand Down
2 changes: 1 addition & 1 deletion lib/Bio/Graphics/Browser2/Render/TrackConfig.pm
Expand Up @@ -572,7 +572,7 @@ sub region_size_menu {

$labels{MIN()} = $self->render->translate('MIN');
$labels{MAX()} = $self->render->translate('MAX');
@ranges = sort {$b<=>$a} @ranges;
@ranges = sort {$b||0<=>$a||0} @ranges;

return popup_menu(-name => $name,
-values => \@ranges,
Expand Down
4 changes: 2 additions & 2 deletions lib/Bio/Graphics/Browser2/RenderPanels.pm
Expand Up @@ -1647,11 +1647,11 @@ sub add_features_to_track {
next;
}


$source->add_dbid_to_feature($feature,$iterator2dbid{$iterator});

my @labels = $source->feature2label($feature,$length);

warn "[$$] $iterator->next_seq() returns $feature, will assign to @labels" if DEBUG;

for my $l (@labels) {

$l =~ s/:\d+//; # get rid of semantic zooming tag
Expand Down

0 comments on commit f871d69

Please sign in to comment.