| 
					
				 | 
			
			
				@@ -346,71 +346,6 @@ function tripal_feature_theme($existing, $type, $theme, $path) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   return $items; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * The CV module will create the JSON array necessary for buillding a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * pie chart using jgChart and Google Charts.  We have to pass to it 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * a table that contains count information, tell it which column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * contains the cvterm_id and provide a filter for getting the 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * results we want from the table. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * @ingroup tripal_feature 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-function tripal_feature_cv_chart($chart_id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  // we only want the chart to show feature types setup by the admin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $temp = rtrim(variable_get('tripal_feature_summary_report_mapping', '')); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $where = ''; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  if ($temp) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $temp = explode("\n", $temp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    foreach ($temp as $key => $value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      $temp2 = explode("=", $value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      $feature_type = rtrim($temp2[0]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      $where .= "CNT.feature_type = '$feature_type' OR \n"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if ($where) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      $where = drupal_substr($where, 0, -5);  # remove OR from the end 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      $where = "($where) AND"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $organism_id = preg_replace("/^tripal_feature_cv_chart_(\d+)$/", "$1", $chart_id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $options = array( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    count_mview      => 'organism_feature_count', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    cvterm_id_column => 'cvterm_id', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    count_column     => 'num_features', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    size             => '550x200', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    filter           => "$where CNT.organism_id = $organism_id", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  return $options; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * The CV module will create the JSON array necessary for buillding a 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * pie chart using jgChart and Google Charts.  We have to pass to it 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * a table that contains count information, tell it which column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * contains the cvterm_id and provide a filter for getting the 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * results we want from the table. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- * @ingroup tripal_feature 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-function tripal_feature_cv_tree($tree_id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $organism_id = preg_replace("/^tripal_feature_cv_tree_(\d+)$/", "$1", $tree_id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  $options = array( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    cv_id            => tripal_get_cv(array('name' => 'sequence')), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    count_mview      => 'organism_feature_count', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    cvterm_id_column => 'cvterm_id', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    count_column     => 'num_features', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    filter           => "CNT.organism_id = $organism_id", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    label            => 'Features', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  ); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  return $options; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * Implements hook_job_describe_args() in order to describe the various feature jobs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * to the tripal jobs interface. 
			 |