Permalink
Browse files

awkward workaround for search options=none bug

  • Loading branch information...
1 parent 454f8f0 commit 574c5abdcf19f318096c3e73895e1422c5db2095 @lstein lstein committed with Lincoln Stein Nov 2, 2011
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/Bio/Graphics/Browser2/Region.pm
  2. +2 −2 lib/Bio/Graphics/Browser2/RegionSearch.pm
View
5 lib/Bio/Graphics/Browser2/Region.pm
@@ -6,7 +6,7 @@ package Bio::Graphics::Browser2::Region;
use strict;
use warnings;
use Bio::Graphics::Browser2::Shellwords;
-use constant DEBUG=>0;
+use constant DEBUG=>1;
sub new {
my $self = shift;
@@ -198,6 +198,7 @@ sub get_whole_segment {
sub search_db {
my $self = shift;
my $args = shift;
+ warn join ' ',%$args;
my ($features);
if (my $name = $args->{-search_term}) {
$name =~ tr/a-zA-Z0-9|.'"_*?: ;+-\/\#\[\]//cd; # remove rude/naughty characters
@@ -216,6 +217,7 @@ sub search_db {
sub lookup_features {
my $self = shift;
+ warn join ',',@_;
my ($name,$start,$stop,$class,$literal_name,$id) = @_;
my $source = $self->source;
@@ -233,6 +235,7 @@ sub lookup_features {
if (defined $id && $db->can('get_feature_by_id')) { # this overrides everything else
my $f = $db->get_feature_by_id($id);
+ warn "\$db->get_feature_by_id($id) got $f";
return $f ? [$f] : [];
}
View
4 lib/Bio/Graphics/Browser2/RegionSearch.pm
@@ -12,7 +12,7 @@ use HTTP::Request::Common 'POST';
use Carp 'cluck','croak';
use Storable 'nfreeze','thaw';
-use constant DEBUG => 0;
+use constant DEBUG => 1;
# search multiple databases using crazy heuristics
@@ -398,7 +398,7 @@ sub _search_features_locally {
for my $dbid (@dbids) {
my $opts = $self->source->search_options($dbid);
- next if $opts =~ /none/i;
+ next if $opts =~ /none/i && $args->{-name} !~ /^id:/;
warn "searching in ",$dbid if DEBUG;
my $db = $self->source->open_database($dbid);
next if $seenit{$db}++;

0 comments on commit 574c5ab

Please sign in to comment.