Tripal
Functions
tripal_chado.schema.api.inc File Reference

Functions

 chado_table_exists ($table)
 
 chado_column_exists ($table, $column)
 
 chado_sequence_exists ($sequence)
 
 chado_index_exists ($table, $name)
 
 chado_add_index ($table, $name, $fields)
 
 chado_dbschema_exists ($schema)
 
 chado_is_local ()
 
 chado_is_installed ()
 
 chado_get_version ($exact=FALSE, $warn_if_unsupported=FALSE)
 
 chado_get_table_names ($include_custom=NULL)
 
 chado_get_schema ($table)
 
 chado_get_custom_table_schema ($table)
 
 chado_get_base_tables ()
 
 chado_get_cvterm_mapping ($params)
 

Detailed Description

Provides an application programming interface (API) for describing Chado tables.

Function Documentation

◆ chado_add_index()

chado_add_index (   $table,
  $name,
  $fields 
)

A Chado-aware wrapper for the db_add_index() function.

Parameters
$tableThe table to be altered.
$nameThe name of the index.
$fieldsAn array of field names.

◆ chado_get_cvterm_mapping()

chado_get_cvterm_mapping (   $params)

Get information about which Chado base table a cvterm is mapped to.

Vocbulary terms that represent content types in Tripal must be mapped to Chado tables. A cvterm can only be mapped to one base table in Chado. This function will return an object that contains the chado table and foreign key field to which the cvterm is mapped. The 'chado_table' property of the returned object contains the name of the table, and the 'chado_field' property contains the name of the foreign key field (e.g. type_id), and the 'cvterm' property contains a cvterm object.

@params An associative array that contains the following keys:

  • cvterm_id: the cvterm ID value for the term.
  • vocabulary: the short name for the vocabulary (e.g. SO, GO, PATO)
  • accession: the accession for the term.
  • bundle_id: the ID for the bundle to which a term is associated. The 'vocabulary' and 'accession' must be used together, the 'cvterm_id' can be used on it's own.
Returns
An object containing the chado_table and chado_field properties or NULL if if no mapping was found for the term.

◆ chado_index_exists()

chado_index_exists (   $table,
  $name 
)

A Chado-aware replacement for the db_index_exists() function.

Parameters
$tableThe table to be altered.
$nameThe name of the index.