Chado API
- 2.x tripal_core/api/tripal_core.chado_general.api.inc tripal_chado_api
- 3.x tripal_chado/tripal_chado.module tripal_chado_api
- 1.x tripal_core/api/tripal_core_chado.api.inc tripal_chado_api
Provides an application programming interface (API) to manage data withing the Chado database.
This includes functions for selecting, inserting, updating and deleting records in Chado tables. The functions will ensure proper integrity contraints are met for inserts and updates.
Also, a set of functions is provided for creating template variables. First, is the chado_generate_var which is used to select one ore more records from a table and return an array with foreign key relationships fully populated. For example, if selecting a feature, the organism_id and type_id would be present in the returned array as a nested array with their respective foreign keys also nested. The only fields that are not included are text fields (which may be very large) or many-to-many foreign key relationships. However, these fields and relationships can be expanded using the chado_expand_var.
When a row from a chado table is selected using these two functions, it provides a way for users who want to cutomize Drupal template files to access all data associate with a specific record.
Finally, the property tables in Chado generally follow the same format. Therefore there is a set of functions for inserting, updating and deleting properties for any table. This provides quick lookup of properties (provided the CV term is known).
File
- tripal_core/
api/ tripal_core.chado_general.api.inc, line 10 - Provides an application programming interface (API) to manage data withing the Chado database.
Functions
Name | Location | Description |
---|---|---|
chado_delete_property |
tripal_core/ |
Deletes a property for a given base table record using the property name |
chado_get_property |
tripal_core/ |
Retrieve a property for a given base table record. |
chado_get_record_with_property |
tripal_core/ |
Get all records in the base table assigned one or more properties. |
chado_get_table_max_rank |
tripal_core/ |
Get max rank for a given set of criteria This function was developed with the many property tables in chado in mind but will work for any table with a rank |
chado_insert_property |
tripal_core/ |
Insert a property for a given base table. |
chado_set_active |
tripal_core/ |
Set the Tripal Database |
chado_update_property |
tripal_core/ |
Update a property for a given base table record and property name. |
hook_chado_connection_alter |
tripal_core/ |
Alter Chado connection settings. |
tripal_insert_cvterm |
tripal_cv/ |
Add's a controlled vocabulary term to Chado. |
Sub-Topics
Name | Location | Description |
---|---|---|
Chado Node API |
tripal_core/ |
Many Tripal modules implement Drupal node types as a means of displaying chado records individually through Drupal as a single web page. In order to do this, many of the same drupal hooks are implemented and the code between modules is actually… |
Chado Query API |
tripal_core/ |
Provides an API for querying of chado including inserting, updating, deleting and selecting from specific chado tables. There is also a generic function, chado_query(), to execute and SQL statement on chado. It is ideal to use these functions to… |
Chado Schema API |
tripal_core/ |
Provides an application programming interface (API) for describing Chado tables. This API consists of a set of functions, one for each table in Chado. Each function simply returns a Drupal style array that defines the table. |