|
Tripal 0.3b
|
Provides functions for managing chado analysis' including creating details pages for each one
| chado_analysis_access | ( | $ | op, |
| $ | node, | ||
| $ | account | ||
| ) |
The following function proves access control for users trying to perform actions on data managed by this module
Definition at line 713 of file tripal_analysis.module.
| chado_analysis_delete | ( | $ | node | ) |
Definition at line 215 of file tripal_analysis.module.
References tripal_db_set_active().
| chado_analysis_form | ( | $ | node | ) |
When editing or creating a new node of type 'chado_analysis' we need a form. This function creates the form that will be used for this.
Definition at line 308 of file tripal_analysis.module.
References tripal_core_expand_chado_vars().
| chado_analysis_insert | ( | $ | node | ) |
When a new chado_analysis node is created we also need to add information to our chado_analysis table. This function is called on insert of a new node of type 'chado_analysis' and inserts the necessary information.
Definition at line 140 of file tripal_analysis.module.
References $user, tripal_core_chado_insert(), tripal_core_chado_select(), and tripal_db_set_active().
| chado_analysis_load | ( | $ | node | ) |
When a node is requested by the user this function is called to allow us to add auxiliary data to the node object.
Definition at line 462 of file tripal_analysis.module.
References chado_get_id_for_node(), and tripal_core_generate_chado_var().
| chado_analysis_update | ( | $ | node | ) |
Update analyses
Definition at line 249 of file tripal_analysis.module.
References $user, and tripal_db_set_active().
| chado_analysis_validate | ( | $ | node, |
| &$ | form | ||
| ) |
Definition at line 629 of file tripal_analysis.module.
References tripal_analysis_validate().
| chado_analysis_view | ( | $ | node, |
| $ | teaser = FALSE, |
||
| $ | page = FALSE |
||
| ) |
This function customizes the view of the chado_analysis node. It allows us to generate the markup.
Definition at line 480 of file tripal_analysis.module.
| get_chado_analyses | ( | ) |
This function uses analysis_id's of all drupal analysis nodes as input and pull the analysis information (name, description, program, programversion, algorithm, sourcename, sourceversion, sourceuri, timeexecuted) from chado database. The return type is an object array that stores $analysis objects sorted by program
Definition at line 776 of file tripal_analysis.module.
References tripal_db_set_active().
Referenced by tripal_analysis_show_analyses().
| get_tripal_analysis_admin_form_cleanup_set | ( | &$ | form | ) |
Definition at line 299 of file tripal_analysis.admin.inc.
Referenced by tripal_analysis_admin().
| get_tripal_analysis_admin_form_reindex_set | ( | &$ | form | ) |
Definition at line 255 of file tripal_analysis.admin.inc.
References tripal_db_set_active().
| get_tripal_analysis_admin_form_sync_set | ( | &$ | form | ) |
Definition at line 323 of file tripal_analysis.admin.inc.
References tripal_db_set_active(), and tripal_get_module_active_jobs().
Referenced by tripal_analysis_admin().
| get_tripal_analysis_admin_form_taxonomy_set | ( | &$ | form | ) |
Definition at line 209 of file tripal_analysis.admin.inc.
References tripal_db_set_active().
| theme_tripal_analysis_analysis_page | ( | $ | analyses | ) |
Definition at line 814 of file tripal_analysis.module.
| tripal_analyses_cleanup | ( | $ | dummy = NULL, |
| $ | job_id = NULL |
||
| ) |
Definition at line 869 of file tripal_analysis.module.
References tripal_db_set_active().
| tripal_analysis_admin_validate | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 401 of file tripal_analysis.admin.inc.
References $user, tripal_add_job(), and tripal_db_set_active().
| tripal_analysis_help | ( | $ | path, |
| $ | arg | ||
| ) |
Display help and module information
| path | which path of the site we're displaying help |
| arg | array that holds the current path as would be returned from arg() function |
Definition at line 696 of file tripal_analysis.module.
| tripal_analysis_init | ( | ) |
Definition at line 45 of file tripal_analysis.module.
| tripal_analysis_menu | ( | ) |
tripal_analysis_menu() HOOK: Implementation of hook_menu() Entry points and paths of the module
Definition at line 56 of file tripal_analysis.module.
| tripal_analysis_module_description_page | ( | ) |
Purpose: Provide Guidance to new Tripal Admin
Definition at line 14 of file tripal_analysis.admin.inc.
| tripal_analysis_node_info | ( | ) |
Provide information to drupal about the node types that we're creating in this module
Definition at line 119 of file tripal_analysis.module.
| tripal_analysis_perm | ( | ) |
Set the permission types that the chado module uses. Essentially we want permissionis that protect creation, editing and deleting of chado # data objects
Definition at line 743 of file tripal_analysis.module.
| tripal_analysis_register_child | ( | $ | modulename | ) |
Definition at line 25 of file tripal_analysis.module.
| tripal_analysis_show_analyses | ( | ) |
Display the summary view of analyses when click on the 'Analyses' primary-link
Definition at line 100 of file tripal_analysis.module.
References get_chado_analyses().
| tripal_analysis_sync_analyses | ( | $ | analysis_id = NULL, |
| $ | job_id = NULL |
||
| ) |
Synchronize analyses from chado to drupal
Definition at line 503 of file tripal_analysis.module.
References $user, and tripal_db_set_active().
| tripal_analysis_theme | ( | ) |
We need to let drupal know about our theme functions and their arguments. We create theme functions to allow users of the module to customize the look and feel of the output generated in this module
Definition at line 759 of file tripal_analysis.module.
| tripal_analysis_unregister_child | ( | $ | modulename | ) |
Definition at line 34 of file tripal_analysis.module.
| tripal_analysis_validate | ( | $ | node, |
| &$ | form | ||
| ) |
Definition at line 637 of file tripal_analysis.module.
References tripal_core_chado_select().
Referenced by chado_analysis_validate().
| tripal_analysis_views_api | ( | ) |
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 for this module which then includes tripal_analysis.views.inc where all the views integration code is
Definition at line 1029 of file tripal_analysis.module.