Browse Source

Changing tabs to spaces...

Lacey Sanderson 8 years ago
parent
commit
f74e12185b

+ 10 - 10
api/blast_ui.api.inc

@@ -78,9 +78,9 @@ function get_blast_database_options($type) {
   $options = array();
   foreach ($nodes as $node) {
     if ( isset($node) && isset($node->db_dbtype) ) {
-	    if ( ($node->db_dbtype == $type) OR ($node->db_dbtype == $obs_type) ) {
+      if ( ($node->db_dbtype == $type) OR ($node->db_dbtype == $obs_type) ) {
         $options[$node->nid] = $node->db_name;
-	    }
+      }
     }
   }
 
@@ -142,7 +142,7 @@ function get_BLAST_job($job_id) {
   $job->files->result->tsv = $blastjob->result_filestub . '.tsv';
   $job->files->result->html = $blastjob->result_filestub . '.html';
   $job->files->result->gff = $blastjob->result_filestub . '.gff';
-  
+
   return $job;
 }
 
@@ -179,15 +179,15 @@ function run_BLAST_tripal_job($program, $query, $database, $output_filestub, $op
 
   // Allow administrators to use an absolute path for these commands.
   // Defaults to using $PATH.
-	$blast_path    = variable_get('blast_path', '');
-	$blast_threads = variable_get('blast_threads', 1);
+  $blast_path    = variable_get('blast_path', '');
+  $blast_threads = variable_get('blast_threads', 1);
 
-	// Strip the extension off the BLAST target
-	$database = preg_replace("/(.*)\.[pn]\w\w/", '$1', $database);
+  // Strip the extension off the BLAST target
+  $database = preg_replace("/(.*)\.[pn]\w\w/", '$1', $database);
 
-	// The executables:
-	$program       = $blast_path . $program;
-	$blast_formatter_command = $blast_path . 'blast_formatter';
+  // The executables:
+  $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)) {

+ 11 - 11
includes/blast_ui.admin.inc

@@ -22,7 +22,7 @@ function blast_ui_admin_form($form, $form_state) {
     '#default_value' => variable_get('blast_path', ''),
   );
 
-	$form['general']['blast_threads']= array(
+  $form['general']['blast_threads']= array(
     '#type' => 'textfield',
     '#title' => t('Enter the number of CPU threads to use in blast search.'),
     '#description' => t('You can increase the number to reduce the search time. Before you increase, please check your hardware configurations . A value of one(1) can result in a slower search for some programs eg. tblastn.'),
@@ -143,16 +143,16 @@ KRSLEEGLKTTGEGLDWGVLFGFGPGLTIETVVLRSVAI';
  * Validate the Admin/Settings form.
  */
 function blast_ui_admin_form_validate($form, &$form_state) {
-	$blast_path = $form_state['values']['blast_path'];
-	$blast_path .= 'blastn';
-	if(!empty($form_state['values']['blast_path'])) {
-		if(file_exists($blast_path) ) {
-			variable_set('blast_path', $form_state['values']['blast_path']);
-		}
-		else {
-			form_set_error('blast_path', t('Please enter a valid path not including the name of the blast program (ie: /urs/bin/). You can leave this blank if you have your $PATH variable set appropriately.'));
-		}
-	}
+  $blast_path = $form_state['values']['blast_path'];
+  $blast_path .= 'blastn';
+  if(!empty($form_state['values']['blast_path'])) {
+    if(file_exists($blast_path) ) {
+      variable_set('blast_path', $form_state['values']['blast_path']);
+    }
+    else {
+      form_set_error('blast_path', t('Please enter a valid path not including the name of the blast program (ie: /urs/bin/). You can leave this blank if you have your $PATH variable set appropriately.'));
+    }
+  }
 
 }
 

+ 110 - 110
includes/blast_ui.form_advanced_options.inc

@@ -142,7 +142,7 @@ function blast_ui_blastn_advanced_options_form_submit($form, $form_state) {
   $qRange = $form_state['values']['qRange'];
 
   return array(
-  	'max_target_seqs' => $numAlign,
+    'max_target_seqs' => $numAlign,
     'evalue'          => $eVal,
     'word_size'       => $wordSize,
     'gapopen'         => $gap['gapOpen'],
@@ -258,11 +258,11 @@ function blast_ui_blastx_advanced_options_form(&$form, $form_state) {
     '#type' => 'select',
     '#title' => t('Match/Mismatch Scores:'),
     '#options' => array(
-				0 => t('No adjustment'),
-				1 => t('Composition-based statistics'),
-				2 => t('Conditional compositional score matrix adjustment'),
-				3 => t('Universal composition score matrix adjustment '),
-			),
+        0 => t('No adjustment'),
+        1 => t('Composition-based statistics'),
+        2 => t('Conditional compositional score matrix adjustment'),
+        3 => t('Universal composition score matrix adjustment '),
+      ),
     '#default_value' => 2,
     '#description' => t('Matrix adjustment method to compensate for amino acid composition of sequences'),
   );
@@ -802,7 +802,7 @@ function blast_ui_blastp_advanced_options_form_submit($form, $form_state) {
 //  q_range
 
   return array(
-  	'max_target_seqs' => $numAlign,
+    'max_target_seqs' => $numAlign,
     'evalue'          => $eVal,
     'word_size'       => $wordSize,
     'gapopen'         => $gapOpen,
@@ -820,14 +820,14 @@ function blast_ui_blastp_advanced_options_form_submit($form, $form_state) {
  */
 function _get_matrix_options() {
   return drupal_map_assoc(array(
-		t('PAM30'),
-		t('PAM70'),
-		t('PAM250'),
-		t('BLOSUM80'),
-		t('BLOSUM62'),
-		t('BLOSUM45'),
-		t('BLOSUM50'),
-		t('BLOSUM90'),
+    t('PAM30'),
+    t('PAM70'),
+    t('PAM250'),
+    t('BLOSUM80'),
+    t('BLOSUM62'),
+    t('BLOSUM45'),
+    t('BLOSUM50'),
+    t('BLOSUM90'),
   ));
 }
 
@@ -935,12 +935,12 @@ function _get_gap_for_matrix($key = '') {
     )),
   );
 
-	if (isset($options[$key])) {
-		return $options[$key];
-	}
-	else {
-		return array();
-	}
+  if (isset($options[$key])) {
+    return $options[$key];
+  }
+  else {
+    return array();
+  }
 }//_get_gap_for_matrix
 
 /**
@@ -1085,73 +1085,73 @@ function blast_ui_tblastn_advanced_options_form_submit($form, $form_state) {
 function _get_default_values($options) {
   // restore previous values or set to default
   $max_target = (isset($options['max_target_seqs']))
-  					? $options['max_target_seqs'] : 10;
+            ? $options['max_target_seqs'] : 10;
   $short_queries = (isset($options['shortQueries']))
-  					? $options['shortQueries'] : true;
+            ? $options['shortQueries'] : true;
   $evalue = (isset($options['evalue']))
-  					? $options['evalue'] : variable_get('eVal', 0.001);
+            ? $options['evalue'] : variable_get('eVal', 0.001);
   $word_size = (isset($options['word_size']))
-  					? $options['word_size'] : 11;
+            ? $options['word_size'] : 11;
   $qRange = (isset($options['culling_limit']))
-  					? $options['culling_limit'] : variable_get('qRange',0);
+            ? $options['culling_limit'] : variable_get('qRange',0);
 
   $matchmiss = 0;
   $reward = (isset($options['reward']))
-  					? $options['reward'] : 1;
+            ? $options['reward'] : 1;
   $penalty = (isset($options['penalty']))
-  					? $options['penalty'] : -2;
+            ? $options['penalty'] : -2;
   if ($reward == 1) {
-  	switch ($penalty) {
-  		case -1: $matchmiss = 5; break;
-  	  case -2: $matchmiss = 0; break;
-  	  case -3: $matchmiss = 1; break;
-  	  case -4: $matchmiss = 2; break;
-  	}
+    switch ($penalty) {
+      case -1: $matchmiss = 5; break;
+      case -2: $matchmiss = 0; break;
+      case -3: $matchmiss = 1; break;
+      case -4: $matchmiss = 2; break;
+    }
   }
   else if ($reward == 2) {
-  	$matchmiss = 3;
+    $matchmiss = 3;
   }
   else if ($reward == 3) {
-  	 $matchmis = 4;
+     $matchmis = 4;
   }
   else if ($eward == 4) {
-  	 $matchmiss = 5;
+     $matchmiss = 5;
   }
 
   $gap = 0;
   $gapopen = (isset($options['gapopen']))
-  					? $options['gapopen'] : 5;
+            ? $options['gapopen'] : 5;
   $gapextend = (isset($options['gapextend']))
-  					? $options['gapextend'] : 2;
+            ? $options['gapextend'] : 2;
   if ($gapextend == 2) {
-  	switch ($gapopen) {
-  		case 5: $gap = 0; break;
-  		case 2: $gap = 1; break;
-  		case 1: $gap = 2; break;
-  		case 0: $gap = 3; break;
-  	}
+    switch ($gapopen) {
+      case 5: $gap = 0; break;
+      case 2: $gap = 1; break;
+      case 1: $gap = 2; break;
+      case 0: $gap = 3; break;
+    }
   }
   else if ($gapextend == 1) {
-  	switch ($gapopen) {
-  		case 3: $gap = 4;
-  		case 2: $gap = 5;
-  		case 1: $gap = 6;
-  	}
+    switch ($gapopen) {
+      case 3: $gap = 4;
+      case 2: $gap = 5;
+      case 1: $gap = 6;
+    }
   }
 
 // eksc- need to implement query range limit
 //  $q_range = 0;
 
   $matrix = (isset($options['matrix']))
-  					? $options['matrix'] : 'PAM30';
+            ? $options['matrix'] : 'PAM30';
   return array(
-  	'max_target_seqs' => $max_target,
-  	'short_queries'   => $short_queries,
-  	'word_size'       => $word_size,
-  	'evalue'          => $evalue,
-  	'matchmiss'       => $matchmiss,
-  	'gap'             => $gap,
-  	'qRange'          => $qRange,
+    'max_target_seqs' => $max_target,
+    'short_queries'   => $short_queries,
+    'word_size'       => $word_size,
+    'evalue'          => $evalue,
+    'matchmiss'       => $matchmiss,
+    'gap'             => $gap,
+    'qRange'          => $qRange,
     'matrix'          => $matrix,
   );
 }//_get_default_values
@@ -1163,69 +1163,69 @@ function _get_default_values($options) {
  * and describe the maximum number of aligned sequences to keep.
  */
 function _get_max_target($which) {
-	switch ($which) {
-	  case 'blastn':
-	  case 'blastx':
-	  case 'blastp':
-	  case 'tblastn':
-			return array(
-				10 => t('10'),
-				50 => t('50'),
-				100 => t('100'),
-				250 => t('250'),
-				500 => t('500'),
-				1000 => t('1000'),
-				5000 => t('5000'),
-				10000 => t('10000'),
-				20000 => t('20000'),
-			);
-	}//switch
+  switch ($which) {
+    case 'blastn':
+    case 'blastx':
+    case 'blastp':
+    case 'tblastn':
+      return array(
+        10 => t('10'),
+        50 => t('50'),
+        100 => t('100'),
+        250 => t('250'),
+        500 => t('500'),
+        1000 => t('1000'),
+        5000 => t('5000'),
+        10000 => t('10000'),
+        20000 => t('20000'),
+      );
+  }//switch
 }
 
 /**
  * Get a list of options for work size.
  */
 function _get_word_size($which) {
-	switch ($which) {
-		case 'blastn':
-			 return array(
-				 7 => t('7'),
-				 11 => t('11'),
-				 15 => t('15'),
-				 16 => t('16'),
-				 20 => t('20'),
-				 24 => t('24'),
-				 28 => t('28'),
-				 32 => t('32'),
-				 48 => t('48'),
-				 64 => t('64'),
-			 	 128 => t('128'),
-				 256 => t('256'),
-	    );
+  switch ($which) {
+    case 'blastn':
+       return array(
+         7 => t('7'),
+         11 => t('11'),
+         15 => t('15'),
+         16 => t('16'),
+         20 => t('20'),
+         24 => t('24'),
+         28 => t('28'),
+         32 => t('32'),
+         48 => t('48'),
+         64 => t('64'),
+          128 => t('128'),
+         256 => t('256'),
+      );
     case 'blastx':
     case 'blastp':
     case 'tblastn':
-    	return array(
+      return array(
       //  2 => t('2'),
         3 => t('3'),
         6 => t('6'),
       );
-	}//switch
+  }//switch
 }
 
 /**
  * Get a list of options for match/mismatch ratio.
  */
 function _get_match_mismatch($which) {
-	switch ($which) {
-		case 'blastn':
+  switch ($which) {
+    case 'blastn':
       return array(
-				 0 => t('1,-2'),
-				 1 => t('1,-3'),
-				 2 => t('1,-4'),
-				 3 => t('2,-3'),
-				 4 => t('4,-5'),
-				 5 => t('1,-1'),
+         0 => t('1,-2'),
+         1 => t('1,-3'),
+         2 => t('1,-4'),
+         3 => t('2,-3'),
+         4 => t('4,-5'),
+         5 => t('1,-1'),
       );
   }//switch
 }
@@ -1234,16 +1234,16 @@ function _get_match_mismatch($which) {
  * Get a list of options for gaps.
  */
 function _get_gap($which) {
-	switch ($which) {
-		case 'blastn':
+  switch ($which) {
+    case 'blastn':
       return array(
-				0 => t('Existence: 5 Extension: 2'),
-				1 => t('Existence: 2 Extension: 2'),
-				2 => t('Existence: 1 Extension: 2'),
-				3 => t('Existence: 0 Extension: 2'),
-				4 => t('Existence: 3 Extension: 1'),
-				5 => t('Existence: 2 Extension: 1'),
-				6 => t('Existence: 1 Extension: 1'),
+        0 => t('Existence: 5 Extension: 2'),
+        1 => t('Existence: 2 Extension: 2'),
+        2 => t('Existence: 1 Extension: 2'),
+        3 => t('Existence: 0 Extension: 2'),
+        4 => t('Existence: 3 Extension: 1'),
+        5 => t('Existence: 2 Extension: 1'),
+        6 => t('Existence: 1 Extension: 1'),
       );
    }//switch
 }

+ 1 - 1
includes/blast_ui.form_per_program.inc

@@ -512,7 +512,7 @@ your sequence headers include pipes (i.e.: | ) they adhere to '
     );
   }
   else {
-  	$advanced_options = array('none' => 0);
+    $advanced_options = array('none' => 0);
   }
 
   $blastjob['options'] = serialize($advanced_options);

+ 87 - 87
includes/blast_ui.services.inc

@@ -13,7 +13,7 @@ function blast_ui_services_resources()
             'callback' => 'getBlastData',
             'access callback' => 'user_access',
             'access arguments' => array(
-                'access content' 
+                'access content'
             ),
             'access arguments append' => FALSE,
             'args' => array(
@@ -22,30 +22,30 @@ function blast_ui_services_resources()
                   'type' => 'int',
                   'description' => 'The information needed',
                   'source' => array(
-                      'path' => '0' 
+                      'path' => '0'
                   ),
-                  'optional' => FALSE 
-               ) 
-            ) 
+                  'optional' => FALSE
+               )
+            )
          ),
          'index' => array(
              'help' => 'Retrieves a listing of blast_ui',
             'callback' => '_blast_ui_index',
             'access callback' => 'user_access',
             'access arguments' => array(
-                'access content' 
+                'access content'
             ),
             'access arguments append' => FALSE,
             'args' => array ()
          ),
-         
+
          'actions' => array(
              'getJobId' => array(
                 'help' => 'Retrieves a listing of database',
                'callback' => '_blast_ui_getJobId',
                'access callback' => 'user_access',
                'access arguments' => array(
-                   'access content' 
+                   'access content'
                ),
                'args' => array(
                    array(
@@ -53,18 +53,18 @@ function blast_ui_services_resources()
                      'type' => 'array',
                      'description' => 'Retrieve blast job id',
                      'source' => 'data',
-                     'optional' => FALSE 
-                  ) 
+                     'optional' => FALSE
+                  )
                ),
-               'access arguments append' => FALSE 
+               'access arguments append' => FALSE
             ),
-            
+
             'getDatabaseOptions' => array(
                 'help' => 'Retrieves a listing of database',
                'callback' => '_blast_ui_getDatabaseOption',
                'access callback' => 'user_access',
                'access arguments' => array(
-                   'access content' 
+                   'access content'
                ),
                'args' => array(
                    array(
@@ -72,13 +72,13 @@ function blast_ui_services_resources()
                      'type' => 'array',
                      'description' => 'The set database_type information',
                      'source' => 'data',
-                     'optional' => FALSE 
-                  ) 
+                     'optional' => FALSE
+                  )
                ),
-               'access arguments append' => false 
-            ) 
-         ) 
-      ) 
+               'access arguments append' => false
+            )
+         )
+      )
    );
  }
 
@@ -103,21 +103,21 @@ function _blast_ui_retrieve( $id )
 function _blast_ui_index()
  {
    return array(
-      
+
        'query_type' => array(
           '1' => 'nucleotide',
-         '2' => 'protein' 
+         '2' => 'protein'
       ),
       'db_type' => array(
           '1' => 'nucleotide',
-         '2' => 'protein' 
+         '2' => 'protein'
       ),
       'blast_program' => array(
           '1' => 'blastn',
          '2' => 'blastx',
          '3' => 'tblastn',
-         '4' => 'blastp' 
-      ) 
+         '4' => 'blastp'
+      )
    );
  }
 
@@ -129,7 +129,7 @@ function _blast_ui_index()
 
 function _blast_ui_getDatabaseOption( $data )
  {
-   
+
    if ( !isset( $data[ query_type ] ) )
     {
       return services_error( 'Missing blast attribute $query_type [ set necleotide or protein in post request of query_type ]', 406 );
@@ -142,12 +142,12 @@ function _blast_ui_getDatabaseOption( $data )
     {
       return services_error( 'Missing blast attribute $blast_program [ set blastn, blastx, tblastn, blastp in post request of blast_program ]', 406 );
     }
-   
+
    $query_type       = $data[ db_type ];
    $db_type          = $data[ db_type ];
    $blast_program    = $data[ blast_program ];
    $options_database = get_blast_database_options( $db_type );
-   
+
    // Data Set send to user for selection of Blastn
    if ( $blast_program == 'blastn' )
     {
@@ -156,7 +156,7 @@ function _blast_ui_getDatabaseOption( $data )
          'Max_target_sequences' => _get_max_target( $blast_program ),
          'Word_size' => _get_word_size( $blast_program ),
          'Match_Mismatch_Scores' => _get_match_mismatch( $blast_program ),
-         'Gap_Costs' => _get_gap( $blast_program ) 
+         'Gap_Costs' => _get_gap( $blast_program )
       );
     }
    // Data Set send to user for selection of Blastx
@@ -166,8 +166,8 @@ function _blast_ui_getDatabaseOption( $data )
           'Select_Database' => $options_database,
          'Max_target_sequences' => _get_max_target( $blast_program ),
          'Word_size' => _get_word_size( $blast_program ),
-         'Matrix_options' => _get_matrix_options() 
-         
+         'Matrix_options' => _get_matrix_options()
+
       );
     }
    //Data Set send to user for selection of tblastn
@@ -178,7 +178,7 @@ function _blast_ui_getDatabaseOption( $data )
          'Max_target_sequences' => _get_max_target( $blast_program ),
          'Word_size' => _get_word_size( $blast_program ),
          'Matrix_options' => _get_matrix_options(),
-         'Gap_Costs' => getGap_cost() 
+         'Gap_Costs' => getGap_cost()
       );
     }
    //Data Set send to user for selection of blastp
@@ -189,13 +189,13 @@ function _blast_ui_getDatabaseOption( $data )
          'Max_target_sequences' => _get_max_target( $blast_program ),
          'Word_size' => _get_word_size( $blast_program ),
          'Matrix_options' => _get_matrix_options(),
-         'Gap_Costs' => getGap_cost() 
+         'Gap_Costs' => getGap_cost()
       );
     }
  }
 
 /*
- ** validate the data  			           
+ ** validate the data
  */
 
 function blast_validation( $query_type, $db_type, $data )
@@ -204,7 +204,7 @@ function blast_validation( $query_type, $db_type, $data )
     {
       if ( $db_type == 'nucleotide' )
        {
-         
+
          if ( !isset( $data[ Select_Database ] ) )
           {
             return services_error( 'Missing blast attribute $Select_Database [ query blast/getDatabaseOptions for options :- Add database you need to use]', 406 );
@@ -239,7 +239,7 @@ function blast_validation( $query_type, $db_type, $data )
        }
       else
        {
-         
+
          if ( !isset( $data[ Select_Database ] ) )
           {
             return services_error( 'Missing blast attribute $Select_Database [ query blast/getDatabaseOptions for options :- Add database used by you]', 406 );
@@ -267,7 +267,7 @@ function blast_validation( $query_type, $db_type, $data )
           {
             return services_error( 'Missing blast attribute data[seqQuery]', 406 );
           }
-         
+
        }
     }
    else
@@ -294,7 +294,7 @@ function blast_validation( $query_type, $db_type, $data )
           {
             return services_error( 'Missing blast attribute [ query blast/getDatabaseOptions for options ]', 406 );
           }
-         
+
          if ( isset( $data[ seqQuery ] ) )
           {
             if ( validate_fasta_sequence( $query_type, $data[ seqQuery ] ) == 1 )
@@ -309,9 +309,9 @@ function blast_validation( $query_type, $db_type, $data )
        }
       else
        {
-         
+
          //return $data;
-         
+
          if ( !isset( $data[ Select_Database ] ) )
           {
             return services_error( 'Missing blast attribute $Select_Database [ query blast/getDatabaseOptions for options :- Add database used by you]', 406 );
@@ -352,15 +352,15 @@ function blast_validation( $query_type, $db_type, $data )
 
 function _blast_ui_getJobId( $data )
  {
-   
+
    $query_type;
    $db_type;
    // Setting the default value of qRange and eValue from blast_ui.admin
    $eVal   = variable_get( 'eVal', '' );
    $qRange = variable_get( 'qRange', '' );
-   
+
    /* check values in post query */
-   
+
    if ( !isset( $data[ query_type ] ) )
     {
       return services_error( 'Missing blast attribute $query_type [ set necleotide or protein in post request of query_type ]', 406 );
@@ -369,14 +369,14 @@ function _blast_ui_getJobId( $data )
     {
       return services_error( 'Missing blast attribute $db_type [ set necleotide or protein in post request of db_type ]', 406 );
     }
-   
+
    $query_type = $data[ query_type ];
    $db_type    = $data[ db_type ];
-   
+
    // check the user input in $data
    blast_validation( $query_type, $db_type, $data );
-   
-   
+
+
    if ( isset( $data[ $eVal ] ) )
     {
       $eVal = $data[ $eVal ];
@@ -385,7 +385,7 @@ function _blast_ui_getJobId( $data )
     {
       $qRange = $data[ $culling_limit ];
     }
-   
+
    if ( $query_type == 'nucleotide' )
     {
       if ( $db_type == 'nucleotide' )
@@ -395,7 +395,7 @@ function _blast_ui_getJobId( $data )
          $options_database = get_blast_database_options( $data[ db_type ] );
          $Databasekey      = array_search( $data[ Select_Database ], $options_database );
          $advanced_options = advanced_options( $blast_program, $eVal, $qRange, $data );
-         
+
        }
       elseif ( $db_type == 'protein' )
        {
@@ -414,7 +414,7 @@ function _blast_ui_getJobId( $data )
          $options_database = get_blast_database_options( $data[ db_type ] );
          $Databasekey      = array_search( $data[ Select_Database ], $options_database );
          $advanced_options = advanced_options( $blast_program, $eVal, $qRange, $data );
-         
+
        }
       elseif ( $db_type == 'protein' )
        {
@@ -424,33 +424,33 @@ function _blast_ui_getJobId( $data )
          $advanced_options = advanced_options( $blast_program, $eVal, $qRange, $data );
        }
     }
-   
-   
+
+
    return blast_ui_getblastJobId( $data[ query_type ], $data[ db_type ], $data[ seqQuery ], $Databasekey, $advanced_options );
-   
-   
+
+
  }
 /*
- ** Define the advanced Options for Blast 
+ ** Define the advanced Options for Blast
  ** @return : advanced_options according to blast_program
  */
 function advanced_options( $blast_program, $eVal, $qRange, $data )
  {
-   
+
    if ( $blast_program == 'blastn' )
     {
       $wordvalue = intval( $data[ Word_size ] );
       $numAlign  = intval( $data[ Max_target_sequences ] );
-      
+
       $Data_GapCost = _get_gap( $blast_program );
       $gapkey       = array_search( $data[ Gap_Costs ], $Data_GapCost );
-      
+
       $gap                  = _set_gap( $gapkey );
       $Data_Mismatch_Scores = _get_match_mismatch( $blast_program );
-      
+
       $Mismatch_Scores_key = array_search( $data[ Match_Mismatch_Scores ], $Data_Mismatch_Scores );
       $m_m                 = _set_match_mismatch( $Mismatch_Scores_key );
-      
+
       return array(
           'max_target_seqs' => $numAlign,
          'evalue' => $eVal,
@@ -459,9 +459,9 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
          'gapextend' => $gap[ 'gapExtend' ],
          'penalty' => $m_m[ 'penalty' ],
          'reward' => $m_m[ 'reward' ],
-         'culling_limit' => $qRange 
+         'culling_limit' => $qRange
       );
-      
+
     }
    elseif ( $blast_program == 'blastx' )
     {
@@ -469,7 +469,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
       $numAlign = intval( $data[ Max_target_sequences ] );
       $matrix   = $data[ Matrix_options ];
       $gap      = getGap( $matrix, 1 );
-      
+
       return array(
           'max_target_seqs' => $numAlign,
          'evalue' => $eVal,
@@ -477,7 +477,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
          'gapopen' => $gap[ 'gapOpen' ],
          'gapextend' => $gap[ 'gapExtend' ],
          'culling_limit' => $qRange,
-         'matrix' => $matrix 
+         'matrix' => $matrix
       );
     }
    elseif ( $blast_program == 'tblastn' )
@@ -486,7 +486,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
       $numAlign = intval( $data[ Max_target_sequences ] );
       $matrix   = $data[ Matrix_options ];
       $gap      = getGap( $matrix, 1 );
-      
+
       return array(
           'max_target_seqs' => $numAlign,
          'evalue' => $eVal,
@@ -494,7 +494,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
          'gapopen' => $gap[ 'gapOpen' ],
          'gapextend' => $gap[ 'gapExtend' ],
          'culling_limit' => $qRange,
-         'matrix' => $matrix 
+         'matrix' => $matrix
       );
     }
    elseif ( $blast_program == 'blastp' )
@@ -503,7 +503,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
       $numAlign = intval( $data[ Max_target_sequences ] );
       $matrix   = $data[ Matrix_options ];
       $gap      = getGap( $matrix, 1 );
-      
+
       return array(
           'max_target_seqs' => $numAlign,
          'evalue' => $eVal,
@@ -511,7 +511,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
          'gapopen' => $gap[ 'gapOpen' ],
          'gapextend' => $gap[ 'gapExtend' ],
          'culling_limit' => $qRange,
-         'matrix' => $matrix 
+         'matrix' => $matrix
       );
     }
  }
@@ -519,7 +519,7 @@ function advanced_options( $blast_program, $eVal, $qRange, $data )
 
 /*
  ** Call the core API of Triple
- ** @return :  Job_ID 
+ ** @return :  Job_ID
  */
 
 function blast_ui_getblastJobId( $query_type, $db_type, $seqQuery, $Databasekey, $adv_options )
@@ -546,33 +546,33 @@ function blast_ui_getblastJobId( $query_type, $db_type, $seqQuery, $Databasekey,
          $blast_program = 'blastp';
        }
     }
-   
+
    $query = '/tmp/' . date( 'YMd_His' ) . '_query.fasta';
    file_put_contents( $query, $seqQuery );
    $blastdb_node      = node_load( $Databasekey );
    $blastdb_name      = $blastdb_node->db_name;
    $blastdb_with_path = $blastdb_node->db_path;
-   
+
    // Now let each program process its own advanced options.
-   
-   
+
+
    $advanced_options = $adv_options;
    global $user;
-   
+
    $output_filestub = date( 'YMd_His' );
    $job_args        = array(
        'program' => $blast_program,
       'query' => $query,
       'database' => $blastdb_with_path,
       'output_filename' => $output_filestub,
-      'options' => $advanced_options 
+      'options' => $advanced_options
    );
-   
+
    $job_id = tripal_add_job( t( 'BLAST (@program): @query', array(
        '@program' => $blast_program,
-      '@query' => $query 
+      '@query' => $query
    ) ), 'blast_job', 'run_BLAST_tripal_job', $job_args, $user->uid );
-   
+
    ob_start();
    tripal_launch_job( 1, $job_id );
    ob_end_clean();
@@ -595,7 +595,7 @@ function getBlaststatus( $job_id )
 
 
 /*
- **Method returns file output data 
+ **Method returns file output data
  **  @param int $job_id
  **  web service url :  http://localhost:8080/restapi/blast/job_id
  */
@@ -605,12 +605,12 @@ function getBlastData( $job_id )
    $result;
    $sql     = "SELECT job_name FROM tripal_jobs WHERE job_id = :job_id ";
    $job_res = db_query( $sql, array(
-       ':job_id' => $job_id 
+       ':job_id' => $job_id
    ) )->fetchField();
-   
+
    $file_path = str_replace( '_query.fasta', '.blast.asn', $job_res );
-   
-   
+
+
    if ( stristr( $file_path, "tblastn" ) )
     {
       $file_path = str_replace( 'BLAST (tblastn): /', '/', $file_path );
@@ -627,8 +627,8 @@ function getBlastData( $job_id )
     {
       $file_path = str_replace( 'BLAST (blastp): /', '/', $file_path );
     }
-   
-   
+
+
    if ( file_exists( $file_path ) )
     {
       $result = file_get_contents( $file_path );
@@ -1001,11 +1001,11 @@ function getGap( $matrix, $gapkey )
                break;
          }
          break;
-         
+
    }
    return array(
        'gapOpen' => $gapOpen,
-      'gapExtend' => $gapExtend 
+      'gapExtend' => $gapExtend
    );
  }
 
@@ -1022,6 +1022,6 @@ function getGap_cost()
       'BLOSUM62' => _get_gap_for_matrix( 'BLOSUM62' ),
       'BLOSUM45' => _get_gap_for_matrix( 'BLOSUM45' ),
       'BLOSUM50' => _get_gap_for_matrix( 'BLOSUM50' ),
-      'BLOSUM90' => _get_gap_for_matrix( 'BLOSUM90' ) 
+      'BLOSUM90' => _get_gap_for_matrix( 'BLOSUM90' )
    );
  }

+ 3 - 3
theme/css/blast_report.css

@@ -16,11 +16,11 @@ table#blast_report th {
   text-align: left;
 }
 table#blast_report tr td {
-	vertical-align : top;
+  vertical-align : top;
 }
 table#blast_report tr.odd td {
   cursor:pointer;
-	vertical-align : top;
+  vertical-align : top;
 }
 table#blast_report .arrow {
   background:transparent url('../images/arrows.png') no-repeat scroll 0px -16px;
@@ -67,4 +67,4 @@ table#blast_report div.alignment-row{
 }
 table#blast_report div.alignment-subrow{
   padding-bottom: 15px;
-}
+}