function tripal_insert_cvterm

2.x tripal_cv.api.inc tripal_insert_cvterm($term, $options = array())
3.x tripal_chado.module.DEPRECATED.api.inc tripal_insert_cvterm($term, $options = array())

Add's a controlled vocabulary term to Chado.

This function will add a cvterm record (and a dbxref record if appropriate values are provided). If the parent vocabulary does not exist then that also is added to the cv table. If the cvterm is a relationship term then the 'is_relationship' value should be set. All terms must also have a corresponding database. This is specified in the term's ID just before the colon (e.g. GO:003824). If the database does not exist in the DB table then it will be added automatically. The accession (the value just after the colon in the term's ID) will be added to the dbxref table. If the CVterm already exists and $update is set (default) then the cvterm is updated. If the CVTerm already exists and $update is not set, then no changes are made and the CVTerm object is returned.

Parameters

$term: An associative array with the following keys:

  • id: the term accession. must be of the form <DB>:<ACCESSION>, where <DB> is the name of the database to which the cvterm belongs and the <ACCESSION> is the term's accession number in the database.
  • name: the name of the term. usually meant to be human-readable.
  • is_obsolete: is present and set to 1 if the term is defunct.
  • definition: the definition of the term.
  • cv_name: The CV name to which the term belongs. If this arugment is null or not provided then the function tries to find a record in the CV table with the same name provided in the $term[namespace]. If this field is provided then it overrides what the value in $term[namespace].
  • is_relationship: If this term is a relationship term then this value should be 1.
  • db_name: In some cases the database name will not be part of the $term['id'] and it needs to be explicitly set. Use this argument only if the database name cannot be specififed in the term ID (e.g. <DB>:<ACCESSION>).

$options: An associative array with the following keys:

  • update_existing: By default this is TRUE. If the term exists it is automatically updated.

Return value

A cvterm object

6 calls to tripal_insert_cvterm()
tripal_analysis_add_cvterms in legacy/tripal_analysis/tripal_analysis.install
Adds controlled vocabulary terms needed by this module.
tripal_cv_add_cvterm in legacy/tripal_cv/api/tripal_cv.DEPRECATED.inc
tripal_featuremap_add_cvterms in legacy/tripal_featuremap/tripal_featuremap.install
Add cv terms needed by the featuremap module
tripal_library_add_cvterms in legacy/tripal_library/tripal_library.install
Adds cvterms needed for the library module
tripal_natural_diversity_add_cvterms in legacy/tripal_natural_diversity/tripal_natural_diversity.install
Add cvterms related to natural diversity

... See full list

1 string reference to 'tripal_insert_cvterm'

File

tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc, line 288
These api functions are deprecated, if your site is currently using them please update your code with the newer tripal_chado functions.

Code

function tripal_insert_cvterm($term, $options = array()) {
  chado_insert_cvterm($term, $options);
}