|
@@ -928,103 +928,6 @@ function tripal_analyses_cleanup($dummy = NULL, $job_id = NULL) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
-function tripal_analysis_reindex_features ($analysis_id = NULL, $job_id = NULL){
|
|
|
- $i = 0;
|
|
|
-
|
|
|
- // if the caller provided a analysis_id then get all of the features
|
|
|
- // associated with the analysis. Otherwise get all sequences associated
|
|
|
- // with all libraries.
|
|
|
- if(!$analysis_id){
|
|
|
- $sql = "SELECT Analysis_id, Feature_id ".
|
|
|
- "FROM {Analysisfeature} ".
|
|
|
- "ORDER BY analysis_id";
|
|
|
- $previous_db = tripal_db_set_active('chado'); // use chado database
|
|
|
- $results = db_query($sql);
|
|
|
- tripal_db_set_active($previous_db); // now use drupal database
|
|
|
- } else {
|
|
|
- $sql = "SELECT Analysis_id, Feature_id ".
|
|
|
- "FROM {Analysisfeature} ".
|
|
|
- "WHERE analysis_id = %d";
|
|
|
- "ORDER BY analysis_id";
|
|
|
- $previous_db = tripal_db_set_active('chado'); // use chado database
|
|
|
- $results = db_query($sql,$analysis_id);
|
|
|
- tripal_db_set_active($previous_db); // now use drupal database
|
|
|
- }
|
|
|
-
|
|
|
- // load into ids array
|
|
|
- $count = 0;
|
|
|
- $ids = array();
|
|
|
- while($id = db_fetch_object($results)){
|
|
|
- $ids[$count] = $id->feature_id;
|
|
|
- $count++;
|
|
|
- }
|
|
|
-
|
|
|
- $interval = intval($count * 0.01);
|
|
|
- foreach($ids as $feature_id){
|
|
|
- // update the job status every 1% features
|
|
|
- if($job_id and $i % interval == 0){
|
|
|
- tripal_job_set_progress($job_id,intval(($i/$count)*100));
|
|
|
- }
|
|
|
- tripal_feature_sync_feature ($feature_id);
|
|
|
- $i++;
|
|
|
- }
|
|
|
-} */
|
|
|
-
|
|
|
-/**
|
|
|
-function tripal_analysis_taxonify_features ($analysis_id = NULL, $job_id = NULL){
|
|
|
- $i = 0;
|
|
|
-
|
|
|
- // if the caller provided a analysis_id then get all of the features
|
|
|
- // associated with the analysis. Otherwise get all sequences assoicated
|
|
|
- // with all libraries.
|
|
|
- if(!$analysis_id){
|
|
|
- $sql = "SELECT Analysis_id, Feature_id ".
|
|
|
- "FROM {Analysisfeature} ".
|
|
|
- "ORDER BY analysis_id";
|
|
|
- $previous_db = tripal_db_set_active('chado'); // use chado database
|
|
|
- $results = db_query($sql);
|
|
|
- tripal_db_set_active($previous_db); // now use drupal database
|
|
|
- } else {
|
|
|
- $sql = "SELECT Analysis_id, Feature_id ".
|
|
|
- "FROM {Analysisfeature} ".
|
|
|
- "WHERE analysis_id = %d";
|
|
|
- "ORDER BY analysis_id";
|
|
|
- $previous_db = tripal_db_set_active('chado'); // use chado database
|
|
|
- $results = db_query($sql,$analysis_id);
|
|
|
- tripal_db_set_active($previous_db); // now use drupal database
|
|
|
- }
|
|
|
-
|
|
|
- // load into ids array
|
|
|
- $count = 0;
|
|
|
- $ids = array();
|
|
|
- while($id = db_fetch_object($results)){
|
|
|
- $ids[$count] = $id->feature_id;
|
|
|
- $count++;
|
|
|
- }
|
|
|
-
|
|
|
- // make sure our vocabularies are set before proceeding
|
|
|
- tripal_feature_set_vocabulary();
|
|
|
-
|
|
|
- // use this SQL for getting the nodes
|
|
|
- $nsql = "SELECT * FROM {chado_feature} CF ".
|
|
|
- " INNER JOIN {node} N ON N.nid = CF.nid ".
|
|
|
- "WHERE feature_id = %d";
|
|
|
-
|
|
|
- // iterate through the features and set the taxonomy
|
|
|
- $interval = intval($count * 0.01);
|
|
|
- foreach($ids as $feature_id){
|
|
|
- // update the job status every 1% features
|
|
|
- if($job_id and $i % $interval == 0){
|
|
|
- tripal_job_set_progress($job_id,intval(($i/$count)*100));
|
|
|
- }
|
|
|
- $node = db_fetch_object(db_query($nsql,$feature_id));
|
|
|
- tripal_feature_set_taxonomy($node,$feature_id);
|
|
|
- $i++;
|
|
|
- }
|
|
|
-}
|
|
|
- */
|
|
|
-
|
|
|
/**
|
|
|
* Implements hook_views_api()
|
|
|
* Purpose: Essentially this hook tells drupal that there is views support for
|