|
Tripal 0.3b
|
Provides functions for managing chado stocks including creating details pages for each stock
The Tripal Stock Module provides functionality for adding, editing, deleting and accessing chado stocks. The stock module was designed to store information about stock collections in a laboratory. What is called a stock could also be called a strain or an accession. There is a lot in common between a Drosophila stock and a Saccharomyces strain and an Arabidopsis line. They all come from some taxon, have genotypes, physical locations in the lab, some conceivable relationship with a publication, some conceivable relationship with a sequence feature (such as a transgene), and could be described by some ontology term. For more information about the chado Stock Module see the GMOD Wiki Page (http://gmod.org/wiki/Chado_Stock_Module)
| chado_stock_access | ( | $ | op, |
| $ | node, | ||
| $ | account | ||
| ) |
Implements hook_access(): Maps permission catagories to actions
| $op | The operation current operation: one of create, update, delete |
| $node | The node object the current operation is being performed on |
| $account | A user object representing the user for whom the operation is to be performed |
Definition at line 195 of file tripal_stock.module.
| chado_stock_delete | ( | $ | node | ) |
Implements hook_delete(): Handles deleting of chado_stocks
NOTE: Currently deletes data -no undo or record-keeping functionality
| $node | The current node including fields with the form element names and submitted values |
Definition at line 862 of file tripal_stock.module.
References tripal_db_set_active().
| chado_stock_form | ( | $ | node, |
| $ | form_state | ||
| ) |
Implements hook_form(): Creates the main Add/Edit/Delete Form for chado stocks
Parts to be added by this form name, uniquename, description, type => select from cvterm with key cvterm_id, organism => select from available with key organism_id main_db_reference => accession, version, description, db_name(select from dropdown)
| $node | An empty node object on insert OR the current stock node object on update |
| $form_state | The current state of the form |
Definition at line 430 of file tripal_stock.module.
References tripal_core_expand_chado_vars(), tripal_cv_get_cvterm_options(), tripal_db_get_db_options(), tripal_organism_get_organism_options(), and tripal_stock_add_chado_properties_progress().
| chado_stock_insert | ( | $ | node | ) |
Implements hook_insert(): Inserts data from chado_stock_form() into drupal and chado
| $node | The current node including fields with the form element names and submitted values |
Definition at line 644 of file tripal_stock.module.
References tripal_core_chado_insert(), and tripal_core_chado_select().
Referenced by chado_stock_update().
| chado_stock_load | ( | $ | node | ) |
Implements hook_load(): Prepares the chado_stock node
| $node | The basic node containing all variables common to all nodes |
Definition at line 385 of file tripal_stock.module.
References tripal_core_generate_chado_var().
| chado_stock_update | ( | $ | node | ) |
Implements hook_update(): Handles Editing/Updating of main stock info
NOTE: Currently just writes over all old data
| $node | The current node including fields with the form element names and submitted values |
Definition at line 750 of file tripal_stock.module.
References chado_stock_insert(), tripal_core_chado_insert(), tripal_core_chado_select(), and tripal_core_chado_update().
| chado_stock_validate | ( | $ | node, |
| &$ | form | ||
| ) |
Implements hook_validate(): Validate the input from the chado_stock node form
| $node | The current node including fields with the form element names and submitted values |
| $form | A description of the form to be rendered by drupal_get_form() |
Definition at line 565 of file tripal_stock.module.
References tripal_db_set_active().
| cs_node_load | ( | $ | nid | ) |
Implements Menu wildcard_load hook
Purpose: Allows the node ID of a chado stock to be dynamically pulled from the path. The node is loaded from this node ID and supplied to the page as an arguement. This is an example of dynamic argument replacement using wildcards in the path.
| $nid | The node ID passed in from the path |
Definition at line 150 of file tripal_stock.module.
| theme_tripal_stock_edit_ALL_db_references_form | ( | $ | form | ) |
Themes the Edit All Database References for a stock form
| $form | An array describing the form to be themed |
Definition at line 399 of file tripal_stock-db_references.inc.
| theme_tripal_stock_edit_ALL_properties_form | ( | $ | form | ) |
Definition at line 354 of file tripal_stock-properties.inc.
| theme_tripal_stock_edit_ALL_relationships_form | ( | $ | form | ) |
Definition at line 447 of file tripal_stock-relationships.inc.
| theme_tripal_stock_stock_table | ( | &$ | stocks | ) |
A themeing funtion for the default tripal stock table
| $stocks | An array of all stock nodes |
Definition at line 328 of file tripal_stock.module.
| tripal_stock_add_ALL_dbreferences_page | ( | $ | node | ) |
Display the ADD Database References to Stock Page
This page is displayed after the stock is created as part of a simulated multi-part form
| $node | The stock node to add the database references to |
Definition at line 17 of file tripal_stock-db_references.inc.
References tripal_stock_add_chado_properties_progress().
| tripal_stock_add_ALL_property_page | ( | $ | node | ) |
Definition at line 8 of file tripal_stock-properties.inc.
References tripal_stock_add_chado_properties_progress().
| tripal_stock_add_ALL_relationships_page | ( | $ | node | ) |
Definition at line 8 of file tripal_stock-relationships.inc.
References tripal_stock_add_chado_properties_progress().
| tripal_stock_add_chado_properties_navigate | ( | $ | form_state, |
| $ | step, | ||
| $ | nid | ||
| ) |
Definition at line 72 of file tripal_stock-secondary_tables.inc.
| tripal_stock_add_chado_properties_navigate_submit | ( | $ | form, |
| $ | form_state | ||
| ) |
Definition at line 138 of file tripal_stock-secondary_tables.inc.
| tripal_stock_add_chado_properties_progress | ( | $ | current | ) |
Definition at line 39 of file tripal_stock-secondary_tables.inc.
Referenced by chado_stock_form(), tripal_stock_add_ALL_dbreferences_page(), tripal_stock_add_ALL_property_page(), and tripal_stock_add_ALL_relationships_page().
| tripal_stock_add_ONE_dbreference_form | ( | $ | form_state, |
| $ | node | ||
| ) |
Implements Hook_form(): Handles adding of Database References to Stocks
| $form_state | An array describing the current state of the form |
| $node | The stock node to add the database reference to |
Definition at line 45 of file tripal_stock-db_references.inc.
References tripal_db_get_db_options().
| tripal_stock_add_ONE_dbreference_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Implements hoook_form_submit(): Actually adds the db reference to the stock
| $form | An array describing the form that was rendered |
| $form_state | An array describing the current state of the form including user input |
Definition at line 149 of file tripal_stock-db_references.inc.
References tripal_db_get_dbxref_by_accession(), and tripal_db_set_active().
| tripal_stock_add_ONE_dbreference_form_validate | ( | $ | form, |
| &$ | form_state | ||
| ) |
Implements hook_form_validate(): Validates the input from tripal_stock_add_ONE_dbreference_form()
| $form | An array describing the form that was rendered |
| $form_state | An array describing the current state of the form including user input |
Definition at line 104 of file tripal_stock-db_references.inc.
References tripal_db_set_active().
| tripal_stock_add_ONE_property_form | ( | $ | form_state, |
| $ | node | ||
| ) |
Definition at line 27 of file tripal_stock-properties.inc.
References tripal_cv_get_cvterm_by_name(), and tripal_cv_get_cvterm_options().
| tripal_stock_add_ONE_property_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 122 of file tripal_stock-properties.inc.
References get_max_chado_rank(), and tripal_db_set_active().
| tripal_stock_add_ONE_property_form_validate | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 82 of file tripal_stock-properties.inc.
References tripal_cv_get_cvterm_by_name(), and tripal_db_set_active().
| tripal_stock_add_ONE_relationship_form | ( | $ | form_state, |
| $ | node | ||
| ) |
Implements Hook_form(): Handles adding of Relationships to Stocks
Definition at line 29 of file tripal_stock-relationships.inc.
References tripal_cv_get_cvterm_options().
| tripal_stock_add_ONE_relationship_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 168 of file tripal_stock-relationships.inc.
References tripal_db_set_active().
| tripal_stock_add_ONE_relationship_form_validate | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 105 of file tripal_stock-relationships.inc.
References tripal_db_set_active(), and tripal_stock_get_stock_by_name_identifier().
| tripal_stock_admin | ( | ) |
Purpose: Provide administration options for chado_stocks
Definition at line 145 of file tripal_stock-administration.inc.
References tripal_cv_get_cv_options(), tripal_get_module_active_jobs(), and tripal_organism_get_organism_options().
| tripal_stock_admin_validate | ( | $ | form, |
| &$ | form_state | ||
| ) |
Implements hook_form_validate(): Validates user input
| $form | An array describing the form that was rendered |
| $form_state | An array describing the current state of the form including user input |
Definition at line 260 of file tripal_stock-administration.inc.
References $user, and tripal_add_job().
| tripal_stock_back_to_stock_button | ( | $ | form_state, |
| $ | nid | ||
| ) |
Definition at line 9 of file tripal_stock-secondary_tables.inc.
| tripal_stock_back_to_stock_button_submit | ( | $ | form, |
| $ | form_state | ||
| ) |
Definition at line 30 of file tripal_stock-secondary_tables.inc.
| tripal_stock_block | ( | $ | op = 'list', |
| $ | delta = 0, |
||
| $ | edit = array() |
||
| ) |
Purpose: Implement Blocks relating to stock content
| $op | What kind of information to retrieve about the block or blocks. Possible values include list, configure, save, view. |
| $delta | Which block to return (not applicable if $op is 'list'). |
| $edit | If $op is 'save', the submitted form data from the configuration form. |
Definition at line 897 of file tripal_stock.module.
| tripal_stock_delete_db_reference | ( | $ | dbxref_id | ) |
Deletes a given database reference
| $dbxref_id | The chado unique idenfier for the database reference to be deleted |
Definition at line 372 of file tripal_stock-db_references.inc.
References tripal_db_set_active().
Referenced by tripal_stock_edit_ALL_db_references_form_submit().
| tripal_stock_delete_property | ( | $ | stockprop_id | ) |
Definition at line 338 of file tripal_stock-properties.inc.
References tripal_db_set_active().
Referenced by tripal_stock_edit_ALL_properties_form_submit().
| tripal_stock_delete_relationship | ( | $ | stock_relationship_id | ) |
Definition at line 431 of file tripal_stock-relationships.inc.
References tripal_db_set_active().
Referenced by tripal_stock_edit_ALL_relationships_form_submit().
| tripal_stock_edit_ALL_db_references_form | ( | $ | form_state, |
| &$ | node | ||
| ) |
Implements Hook_form(): Handles adding of Database References to Stocks
Specifically this adds dbxrefs to a current stock using the stock_dbxref table
| $form_state | An array describing the current state of the form |
| $node | The stock node whose database references should be edited |
Definition at line 228 of file tripal_stock-db_references.inc.
References tripal_core_expand_chado_vars(), and tripal_db_get_db_options().
| tripal_stock_edit_ALL_db_references_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Implements hook_form_submit(): Actually edits the database references
| $form | An array representing the form |
| $form_state | An array representing the current state of the form including user input |
Definition at line 307 of file tripal_stock-db_references.inc.
References tripal_stock_delete_db_reference(), and tripal_stock_update_db_reference().
| tripal_stock_edit_ALL_dbreferences_page | ( | $ | node | ) |
Display the EDIT Database References to Stock Page
This page is displayed as a tab on each stock details page (by default)
| $node | The stock node to add the database references to |
Definition at line 201 of file tripal_stock-db_references.inc.
| tripal_stock_edit_ALL_properties_form | ( | $ | form_state, |
| &$ | node | ||
| ) |
Implements Hook_form(): Handles adding of Properties & Synonyms to Stocks
Definition at line 187 of file tripal_stock-properties.inc.
References tripal_core_expand_chado_vars(), and tripal_cv_get_cvterm_options().
| tripal_stock_edit_ALL_properties_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 257 of file tripal_stock-properties.inc.
References tripal_stock_delete_property(), and tripal_stock_update_property().
| tripal_stock_edit_ALL_properties_page | ( | $ | node | ) |
Definition at line 170 of file tripal_stock-properties.inc.
| tripal_stock_edit_ALL_relationships_form | ( | $ | form_state, |
| $ | node | ||
| ) |
Implements Hook_form()
Definition at line 208 of file tripal_stock-relationships.inc.
References tripal_core_expand_chado_vars(), and tripal_cv_get_cvterm_options().
| tripal_stock_edit_ALL_relationships_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 376 of file tripal_stock-relationships.inc.
References tripal_stock_delete_relationship(), and tripal_stock_update_relationship().
| tripal_stock_edit_ALL_relationships_form_validate | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 307 of file tripal_stock-relationships.inc.
References tripal_db_set_active(), and tripal_stock_get_stock_by_name_identifier().
| tripal_stock_edit_ALL_relationships_page | ( | $ | node | ) |
Definition at line 191 of file tripal_stock-relationships.inc.
| tripal_stock_is_obsolete_form | ( | $ | node, |
| $ | stock_id | ||
| ) |
Definition at line 190 of file tripal_stock-secondary_tables.inc.
| tripal_stock_is_obsolete_form_submit | ( | $ | form, |
| &$ | form_state | ||
| ) |
Definition at line 211 of file tripal_stock-secondary_tables.inc.
References tripal_db_set_active().
| tripal_stock_list_dbreferences_for_node | ( | $ | db_references | ) |
List all database references for a given node
| $db_references | An array of database references to be listed |
Definition at line 437 of file tripal_stock-db_references.inc.
| tripal_stock_list_properties_for_node | ( | $ | properties, |
| $ | synonyms | ||
| ) |
Definition at line 382 of file tripal_stock-properties.inc.
| tripal_stock_list_relationships_for_node | ( | $ | stock_name, |
| $ | subject_relationships, | ||
| $ | object_relationships | ||
| ) |
Definition at line 479 of file tripal_stock-relationships.inc.
| tripal_stock_menu | ( | ) |
Implements hook_menu(): Adds menu items for the tripal_stock
Definition at line 43 of file tripal_stock.module.
| tripal_stock_module_description_page | ( | ) |
Purpose: Provide Guidance to new Tripal Admin
Definition at line 12 of file tripal_stock-administration.inc.
| tripal_stock_node_info | ( | ) |
Implements hook_node_info(): registers a stock node type
Definition at line 362 of file tripal_stock.module.
| tripal_stock_perm | ( | ) |
Implementation of hook_perm()
Purpose: Set the permission types that the chado stock module uses
Definition at line 171 of file tripal_stock.module.
| tripal_stock_show_stocks | ( | ) |
Purpose: show stocks stored in drupals chado_stock table
This function provides the default html representation of the stock table. This representation can be overridden using Drupal Views2 to create more flexible tables listing stocks.
Definition at line 302 of file tripal_stock.module.
References tripal_stock_get_all_stocks().
| tripal_stock_sync_stock_set | ( | $ | organism_id, |
| $ | job_id | ||
| ) |
Syncs all Stocks associated with an organism
Note: Handling of multiple organisms is done in tripal_stock_admin_validate()
| $organism_id | The chado primary key of the organism for which stocks should be sync'd |
| $job_id | The tripal job ID |
Definition at line 303 of file tripal_stock-administration.inc.
References $user, and tripal_db_set_active().
| tripal_stock_theme | ( | ) |
Implements hook_theme(): Register themeing functions for this module
Definition at line 244 of file tripal_stock.module.
| tripal_stock_update_db_reference | ( | $ | dbxref_id, |
| $ | database_id, | ||
| $ | accession | ||
| ) |
Updates a Database Reference
| $dbxref_id | The unique chado identifier of the database reference to be updated |
| $database_id | The new database ID |
| $accession | The new accession |
Definition at line 348 of file tripal_stock-db_references.inc.
References tripal_db_set_active().
Referenced by tripal_stock_edit_ALL_db_references_form_submit().
| tripal_stock_update_property | ( | $ | stockprop_id, |
| $ | cvterm_id, | ||
| $ | value, | ||
| $ | preferred, | ||
| $ | nid | ||
| ) |
Definition at line 282 of file tripal_stock-properties.inc.
References get_max_chado_rank(), and tripal_db_set_active().
Referenced by tripal_stock_edit_ALL_properties_form_submit().
| tripal_stock_update_relationship | ( | $ | stock_relationship_id, |
| $ | subject_id, | ||
| $ | cvterm_id, | ||
| $ | object_id | ||
| ) |
Definition at line 412 of file tripal_stock-relationships.inc.
References tripal_db_set_active().
Referenced by tripal_stock_edit_ALL_relationships_form_submit().
| tripal_stock_views_api | ( | ) |
Implements hook_views_api()
Purpose: Essentially this hook tells drupal that there is views support for for this module which then includes tripal_stock.views.inc where all the views integration code is
Definition at line 230 of file tripal_stock.module.