Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:MG-RAST/MG-RAST into develop

  • Loading branch information...
commit afec48c4b9932b05d8ff7f45aed70e8204080eed 2 parents 9c5a85a + 18ed6d5
Jared Bischof authored
Showing with 20 additions and 12 deletions.
  1. +18 −10 src/MGRAST/lib/Analysis.pm
  2. +2 −2 src/MGRAST/lib/WebPage/Analysis.pm
28 src/MGRAST/lib/Analysis.pm
View
@@ -729,7 +729,7 @@ sub delete_job {
my $all = $self->_dbh->selectcol_arrayref("SELECT DISTINCT version FROM job_info WHERE job = ".$job);
eval {
$self->_dbh->do("DELETE FROM job_info WHERE job = ".$job);
- foreach my $tbl (keys %{$self->_jtbl}) {
+ foreach my $tbl (values %{$self->_jtbl}) {
$self->_dbh->do("DELETE FROM $tbl WHERE version IN (".join(",", @$all).") AND job = ".$job);
}
};
@@ -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; }
4 src/MGRAST/lib/WebPage/Analysis.pm
View
@@ -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];
Please sign in to comment.
Something went wrong with that request. Please try again.