Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Edits to beta API #506

Merged
merged 3 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 16, 2013
  1. @jaredbischof
Commits on Mar 3, 2014
  1. @jaredbischof

    Adding this where clause makes queries for metadata verbosity=full ca…

    jaredbischof authored
    …lls execute at least 30 times faster, and should not break anything
  2. @jaredbischof
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +1 −1  Makefile
  2. +2 −1  src/MGRAST/lib/Metadata.pm
View
2  Makefile
@@ -53,7 +53,7 @@ OVERRIDES = \
# if you change all: make sure all: in standard.mk is consistent.
# api-doc target must be run last.
-all: installdirs $(TOOL_HDR) lib api-doc
+all: installdirs $(TOOL_HDR) lib
# Use the PACKAGES macro to transform lib, bin, etc., targets
# into package level dependencies, e.g., lib -> PkgA.lib, PkgB.lib
View
3  src/MGRAST/lib/Metadata.pm
@@ -234,8 +234,9 @@ sub get_jobs_metadata_fast {
my $dbh = $self->{_handle}->db_handle;
my $key = $is_mgid ? 'metagenome_id' : 'job_id';
my $where = $is_mgid ? 'metagenome_id IN ('.join(',', map {"'$_'"} @$job_ids).')' : 'job_id IN ('.join(',', @$job_ids).')';
+ my $where2= $is_mgid ? 'j.metagenome_id IN ('.join(',', map {"'$_'"} @$job_ids).')' : 'j.job_id IN ('.join(',', @$job_ids).')';
my $jobs = $dbh->selectall_arrayref("SELECT ".$key.",primary_project,sample,library,sequence_type,name,metagenome_id,file,file_checksum_raw FROM Job WHERE ".$where);
- my $meth = $dbh->selectall_arrayref("SELECT j.".$key.", a.value FROM Job j, JobAttributes a WHERE j._id=a.job AND a.tag='sequencing_method_guess'");
+ my $meth = $dbh->selectall_arrayref("SELECT j.".$key.", a.value FROM Job j, JobAttributes a WHERE j._id=a.job AND a.tag='sequencing_method_guess' AND ".$where2);
my %pids = map { $_->[1], 1 } grep {$_->[1] && ($_->[1] =~ /\d+/)} @$jobs;
my %sids = map { $_->[2], 1 } grep {$_->[2] && ($_->[2] =~ /\d+/)} @$jobs;
my %lids = map { $_->[3], 1 } grep {$_->[3] && ($_->[3] =~ /\d+/)} @$jobs;
Something went wrong with that request. Please try again.