Sfoglia il codice sorgente

Fixed BLAST Path configuration to work if no path is selected.

Lacey Sanderson 10 anni fa
parent
commit
e93e589573
2 ha cambiato i file con 13 aggiunte e 15 eliminazioni
  1. 5 6
      api/blast_ui.api.inc
  2. 8 9
      includes/blast_ui.admin.inc

+ 5 - 6
api/blast_ui.api.inc

@@ -121,12 +121,11 @@ function run_BLAST_tripal_job($program, $query, $database, $output_filestub, $op
 
   print "Options:\n";
 
-	$blast_formatter_command = 'blast_formatter';
-	$blast_path = variable_get('blast_path');
-	if(!empty($blast_path)){
-		$program = 	$blast_path . $program;
-		$blast_formatter_command = $blast_path .  $blast_formatter_command;
-	}
+  // Allow administrators to use an absolute path for these commands.
+  // Defaults to using $PATH.
+	$blast_path = variable_get('blast_path', '');
+	$program = 	$blast_path . $program;
+	$blast_formatter_command = $blast_path .  'blast_formatter';
 
   $blast_cmd = "$program -query $query -db $database -out $output_file -outfmt=11";
   if (!empty($options)) {

+ 8 - 9
includes/blast_ui.admin.inc

@@ -15,6 +15,13 @@ function blast_ui_admin_form($form, $form_state) {
     '#title' => 'General'
   );
 
+  $form['general']['blast_path']= array(
+    '#type' => 'textfield',
+    '#title' => t('Enter the path of the BLAST program'),
+    '#description' => t('You can ignore if your $PATH variable is set. Otherwise, enter the absoulte path to bin folder. For example, /opt/blast/2.2.29+/bin/'),
+    '#default_value' => variable_get('blast_path', ''),
+  );
+
   $form['general']['target_upload'] = array(
     '#type' => 'checkbox',
     '#title' => 'Enable Taget Sequence Upload',
@@ -94,14 +101,6 @@ KRSLEEGLKTTGEGLDWGVLFGFGPGLTIETVVLRSVAI';
       )
   );
 
-$form['blast_path']= array(
-    '#type' => 'textfield',
-    '#title' => t('Enter the path of the BLAST program '),
-    '#required' => TRUE,
-    '#description' => t('You can ignore if your $PATH variable is set. Otherwise, enter the absoulte path to bin folder. For example,  /opt/blast/2.2.29+/bin/'),
-    '#default_value' => variable_get('blast_path', ''),
-  );
-
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => 'Save Configuration'
@@ -121,7 +120,7 @@ function blast_ui_validate($form, &$form_state) {
 			variable_set('blast_path', $form_state['values']['blast_path']);
 		}
 		else {
-			form_set_error('blast_path', t('Please enter a valid path or you can leave it blank'));	
+			form_set_error('blast_path', t('Please enter a valid path or you can leave it blank'));
 		}
 	}