Browse Source

Fixed schema API: analysisprop doesn't have rank field

Lacey Sanderson 13 years ago
parent
commit
eb6f73ee17

+ 2 - 0
base/tripal_bulk_loader/tripal_bulk_loader.admin.inc

@@ -117,6 +117,7 @@ function tripal_bulk_loader_modify_template_base_form ($form_state = NULL, $mode
   $form['records'] = array(
 		'#type' => ($form_state['storage']['template_id'])? 'fieldset' : 'hidden',
 		'#title' => t('Current Records'), 
+		'#collapsible' => TRUE,
 		'#weight' => 2,
   );
   
@@ -149,6 +150,7 @@ function tripal_bulk_loader_modify_template_base_form ($form_state = NULL, $mode
 	$form['fields'] = array(
 		'#type' => ($form_state['storage']['template_id'])? 'fieldset' : 'hidden',
 		'#title' => t('Current Fields'),
+		'#collapsible' => TRUE,
 		'#weight' => 3,
 	);
 

+ 3 - 0
base/tripal_core/tripal_core.api.inc

@@ -113,6 +113,9 @@ function tripal_core_chado_insert($table,$values){
    
    // get the table description
    $table_desc = module_invoke_all('chado_'.$table.'_schema');
+   if (empty($table_desc)) {
+   	watchdog('tripal_core', 'tripal_core_chado_insert: There is no table description for !table_name', array('!table_name' => $table), WATCHDOG_WARNING);       
+   }
 
    // iterate through the values array and create a new 'insert_values' array
    // that has all the values needed for insert with all foreign relationsihps

+ 0 - 7
base/tripal_core/tripal_core.schema.api.inc

@@ -9019,12 +9019,6 @@ function tripal_core_chado_analysisprop_schema () {
         'type' => 'text',
         'not null' => '',
       ),
-      'rank' => array(
-//        'description' => 'TODO: please describe this field!',
-        'type' => 'int',
-        'not null' => '1',
-        'default' => '0',
-      ),
     ),
     'primary key' => array(
       '0' => 'analysisprop_id',
@@ -9033,7 +9027,6 @@ function tripal_core_chado_analysisprop_schema () {
       'analysisprop_c1' => array(
         '0' => 'analysis_id',
         '1' => 'type_id',
-        '2' => 'rank',
       ),
     ),
     'indexes' => array(

+ 6 - 2
extensions/tripal_analysis_blast/includes/parse_blast_XML.inc

@@ -598,8 +598,12 @@ function tripal_analysis_blast_get_result_object($xml_string,$db,$max,$feature_i
 		}
 		
 		$hits_array[$hit_count]['best_evalue'] = $best_evalue;
-		$percent_identity = number_format($best_identity/$best_len*100, 2);
-		$hits_array[$hit_count]['percent_identity'] = $percent_identity;
+		
+		if (!empty($best_len)) {
+			$percent_identity = number_format($best_identity/$best_len*100, 2);
+			$hits_array[$hit_count]['percent_identity'] = $percent_identity;
+		}
+		
 		$hits_array[$hit_count]['description'] = $description;
 		$hits_array[$hit_count]['hsp'] = $hsp_array;
 		$hit_count ++;

+ 6 - 2
extensions/tripal_analysis_blast/theme/tripal_feature/tripal_feature_blast_results.tpl.php

@@ -81,9 +81,12 @@ if(count($blast_results_list) > 0){
 			      <td><?php print $hit['hit_name'] ?></td>
 		      <?php } ?>
 			   <td nowrap><?php print $hit['best_evalue']?></td>
-			   <td nowrap><?php  print $hit['percent_identity']?></td>
+			   <td nowrap><?php  if (!empty($hit['percent_identity'])) { print $hit['percent_identity']; } ?></td>
 			   <td><?php print $hit['description']?></td>
 		   </tr>
+		   
+		   <!-- If there is alignment information for at least one HSP -->
+		   <?php if (!empty($hit['hsp'][0]['query_frame'])) { ?>
 	      <tr class="<?php print $class ?>">
 		      <td colspan=5>
 			      <a class="blast-hit-arrow-icon" onclick="return tripal_blast_toggle_alignment(<?php print $analysis->analysis_id ?>,<?php print $i?>)"><img id="tripal_analysis_blast-info-toggle-image-<?php print $analysis->analysis_id ?>-<?php print $i?>" src=<?php print $hit['arrowr_url']?> align="top"> View Alignment</a>
@@ -102,7 +105,8 @@ if(count($blast_results_list) > 0){
 		      <?php } ?>
 		      </td>
 	      </tr>		
-         <?php $i++;
+         <?php }
+         $i++;
 	   } ?>
 	</table>
 </div>