Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fixed bug in workbench display table #214

Merged
merged 1 commit into from

2 participants

@teharrison
Owner

No description provided.

@jaredbischof jaredbischof merged commit 18ed6d5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 20, 2012
  1. fixed bug in workbench display table

    Travis Harrison authored
This page is out of date. Refresh to see the latest.
Showing with 19 additions and 11 deletions.
  1. +17 −9 src/MGRAST/lib/Analysis.pm
  2. +2 −2 src/MGRAST/lib/WebPage/Analysis.pm
View
26 src/MGRAST/lib/Analysis.pm
@@ -1599,10 +1599,14 @@ sub get_md5_data {
my $data = {};
my $jobs = [];
- while ( my ($mg, $j) = each %{$self->_job_map} ) {
- my $c = $self->_memd->get($mg.$cache_key);
- if ($c) { $data->{$mg} = $c; }
- else { push @$jobs, $j; }
+ if ($md5s && (@$md5s > 0)) {
+ $jobs = $self->_jobs;
+ } else {
+ while ( my ($mg, $j) = each %{$self->_job_map} ) {
+ my $c = $self->_memd->get($mg.$cache_key);
+ if ($c) { $data->{$mg} = $c; }
+ else { push @$jobs, $j; }
+ }
}
unless (@$jobs) { return [ map { @$_ } values %$data ]; }
@@ -1611,7 +1615,7 @@ sub get_md5_data {
$alen = (defined($alen) && ($alen =~ /^\d+$/)) ? "j.len_avg >= $alen" : "";
my %umd5s = ($md5s && (@$md5s > 0)) ? map {$_, 1} @$md5s : {};
- my $qmd5s = ($md5s && (@$md5s > 0)) ? "j.md5 IN (" . join(",", map {"'$_'"} keys %umd5s) . ")" : "";
+ my $qmd5s = ($md5s && (@$md5s > 0)) ? "j.md5 IN (" . join(",", keys %umd5s) . ")" : "";
my $qseek = $ignore_sk ? "" : "j.seek IS NOT NULL AND j.length IS NOT NULL";
my $qrep = $rep_org_src ? "j.md5=r.md5 AND r.source=".$self->_src_id->{$rep_org_src} : "";
my $where = $self->_get_where_str(['j.'.$self->_qver, "j.job IN (".join(",", @$jobs).")", $qrep, $qmd5s, $eval, $ident, $alen, $qseek]);
@@ -1643,10 +1647,14 @@ sub get_md5_abundance {
my $data = {};
my $jobs = [];
- while ( my ($mg, $j) = each %{$self->_job_map} ) {
- my $c = $self->_memd->get($mg.$cache_key);
- if ($c) { $data->{$mg} = $c; }
- else { push @$jobs, $j; }
+ if ($md5s && (@$md5s > 0)) {
+ $jobs = $self->_jobs;
+ } else {
+ while ( my ($mg, $j) = each %{$self->_job_map} ) {
+ my $c = $self->_memd->get($mg.$cache_key);
+ if ($c) { $data->{$mg} = $c; }
+ else { push @$jobs, $j; }
+ }
}
unless (@$jobs) { return $data; }
View
4 src/MGRAST/lib/WebPage/Analysis.pm
@@ -1577,7 +1577,7 @@ sub workbench_hits_table {
my $md5_type = $self->{mgdb}->type_for_md5s(\@md5s, 1); # id => [md5, type]
my $source_data = {}; # md5 => [ source, id, function ]
if (@ach_srcs > 0) {
- map { $source_data->{$_->[1]} = [ @$_[4,0,2] ] } grep { $_->[2] } @{$self->{mgdb}->annotation_for_md5s(\@md5s, \@ach_srcs)};
+ map { push @{$source_data->{$_->[1]}}, [ @$_[4,0,2] ] } grep { $_->[2] } @{$self->{mgdb}->annotation_for_md5s(\@md5s, \@ach_srcs)};
}
my $html = "<p>Hits for " . scalar(@md5s) . " unique sequences within ";
@@ -1604,7 +1604,7 @@ sub workbench_hits_table {
$html .= "source ".$srcs[0];
}
$html .= "</p>";
-
+
my @table_data = ();
foreach my $row ( @$analysis_data ) {
my ($mg, $md5, $num, $seek, $len) = @$row[0,1,2,9,10];
Something went wrong with that request. Please try again.