Browse Source

Fixed submission of advanced options (broken by nesting of blast form

Lacey Sanderson 9 years ago
parent
commit
ec4a1cee12

+ 15 - 9
api/blast_ui.api.inc

@@ -137,16 +137,19 @@ function run_BLAST_tripal_job($program, $query, $database, $output_filestub, $op
   $blast_cmd = "$program -query '$query' -db '$database' -out '$output_file' -outfmt=11";
   if (!empty($options)) {
     foreach ($options as $opt => $val) {
-      print "\t$opt: $val\n";
-      $blast_cmd .= " -$opt $val";
+      if ($val) {
+        print "\t$opt: $val\n";
+        $blast_cmd .= " -$opt $val";
+      }
     }
   }
 
   print "\nExecuting the following BLAST command:\n" . $blast_cmd . "\n";
 
+  ddl($blast_cmd);
   system($blast_cmd);
 
-  if(!file_exists($output_file)) {
+  if (!file_exists($output_file)) {
     tripal_report_error(
       'blast_ui',
       TRIPAL_ERROR,
@@ -160,38 +163,41 @@ function run_BLAST_tripal_job($program, $query, $database, $output_filestub, $op
   print "\nGenerating additional download formats...\n";
 
   print "\tXML\n";
+  ddl("$blast_formatter_command -archive $output_file -outfmt 5 -out $output_file_xml");
   $format_cmd = "$blast_formatter_command -archive $output_file -outfmt 5 -out $output_file_xml";
   print "\nExecuting $format_cmd\n\n";
   system($format_cmd);
-  if(!file_exists($output_file_xml)) {
+  if (!file_exists($output_file_xml)) {
     tripal_report_error(
       'blast_ui',
       TRIPAL_ERROR,
-      "Unable to convert BLAST ASN.1 archive (%archive) to XML (%file).",
+      "Unable to convert BLAST ASN.1 archive to XML (%archive => %file).",
       array('%archive' => $output_file, '%file' => $output_file_xml),
       array('print' => TRUE)
     );
   }
 
   print "\tTab-delimited\n";
+  ddl("$blast_formatter_command -archive $output_file -outfmt 7 -out $output_file_tsv");
   system("$blast_formatter_command -archive $output_file -outfmt 7 -out $output_file_tsv");
-  if(!file_exists($output_file_tsv)) {
+  if (!file_exists($output_file_tsv)) {
     tripal_report_error(
       'blast_ui',
       TRIPAL_WARNING,
-      "Unable to convert BLAST ASN.1 archive (%archive) to Tabular Output (%file).",
+      "Unable to convert BLAST ASN.1 archive to Tabular Output (%archive => %file).",
       array('%archive' => $output_file, '%file' => $output_file_tsv),
       array('print' => TRUE)
     );
   }
 
   print "\tHTML (includes alignments)\n";
+  ddl("$blast_formatter_command -archive $output_file -outfmt 0 -out $output_file_html -html");
   system("$blast_formatter_command -archive $output_file -outfmt 0 -out $output_file_html -html");
-  if(!file_exists($output_file_tsv)) {
+  if (!file_exists($output_file_tsv)) {
     tripal_report_error(
       'blast_ui',
       TRIPAL_WARNING,
-      "Unable to convert BLAST ASN.1 archive (%archive) to HTML Output (%file).",
+      "Unable to convert BLAST ASN.1 archive to HTML Output (%archive => %file).",
       array('%archive' => $output_file, '%file' => $output_file_html),
       array('print' => TRUE)
     );

+ 6 - 2
includes/blast_ui.form_advanced_options.inc

@@ -128,10 +128,14 @@ function blast_ui_blastn_advanced_options_form_submit($form, $form_state) {
 
   $trgtKey = $form_state['values']['maxTarget'];
   $numAlign = $form['ALG']['GParam']['maxTarget']['#options'][$trgtKey];
-
+  ddl($form['ALG']['GParam']['maxTarget']['#options']);
+  ddl($trgtKey);
+  
   $wsKey = $form_state['values']['wordSize'];
   $wordSize = $form['ALG']['GParam']['wordSize']['#options'][$wsKey];
-
+  ddl($form['ALG']['GParam']['wordSize']['#options']);
+  ddl($wsKey);
+  
   // Expand Gap Cost key into open and extend penalties
   $gap = _set_gap($form_state['values']['gapCost']);
 

+ 1 - 1
includes/blast_ui.form_per_program.inc

@@ -435,7 +435,7 @@ your sequence headers include pipes (i.e.: | ) they adhere to '
   if (function_exists($advanced_options_form_submit)) {
     $advanced_options = call_user_func_array(
       $advanced_options_form_submit,
-      array($form, &$form_state)
+      array($form['B'], $form_state)
     );
   }
   else {