Provides API functions specificially for managing organism records in Chado.
◆ chado_abbreviate_infraspecific_rank()
chado_abbreviate_infraspecific_rank |
( |
|
$rank | ) |
|
A handy function to abbreviate the infraspecific rank.
- Parameters
-
$rank | The rank below species. |
- Returns
- The proper abbreviation for the rank.
◆ chado_autocomplete_organism()
chado_autocomplete_organism |
( |
|
$text | ) |
|
This function is intended to be used in autocomplete forms for searching for organisms that begin with the provided string.
- Parameters
-
$text | The string to search for. |
- Returns
- A json array of terms that begin with the provided string.
◆ chado_get_organism()
chado_get_organism |
( |
|
$identifiers, |
|
|
|
$options = [] , |
|
|
|
$schema_name = NULL |
|
) |
| |
Retrieves a chado organism variable.
- Parameters
-
| $identifiers | An array with the key stating what the identifier is. Supported keys (only on of the following unique keys is required):
- organism_id: the chado organism.organism_id primary key.
- genus & species: the chado organism.genus field & organism.species field.
- scientific_name: Full taxonomic name, can include infraspecific nomenclature. There are also some specially handled keys. They are:
- property: An array/object describing the property to select records for. It should at least have either a type_name (if unique across cvs) or type_id. Other supported keys include: cv_id/cv_name (of the type), value and rank.
|
| $options | An array of options. Supported keys include:
|
string | $schema_name | The name of the schema to pull the variable from. |
NOTE: the $identifiers parameter can really be any array similar to $values passed into chado_select_record(). It should fully specify the organism record to be returned.
- Returns
- If unique values were passed in as an identifier then an object describing the organism will be returned (will be a chado variable from chado_generate_var()). Otherwise, NULL will be returned.
◆ chado_get_organism_id_from_scientific_name()
chado_get_organism_id_from_scientific_name |
( |
|
$name, |
|
|
|
$options = [] |
|
) |
| |
Returns organism_id values of organisms matching the specified full scientific name, abbreviation, or common name of an organism.
- Parameters
-
$name | The organism name to be queried. Infraspecific type can be abbreviated. |
$options | An array of options. The following keys are available:
- check_abbreviation: If TRUE and the $name did not match the scientific name, then check the abbreviation.
- check_common_name: If TRUE and the $name did not match the scientific name, then check the common name.
- case_sensitive: If TRUE then all searches should be case sensitive. Default is FALSE. If no options are specified, search is for a match of $name to the scientific_name only, case insensitive.
|
- Returns
- Array of matching organism_id values.
◆ chado_get_organism_image_url()
chado_get_organism_image_url |
( |
|
$organism | ) |
|
Return the path for the organism image.
- Parameters
-
$organism | An organism table record. |
- Returns
- If the type parameter is 'url' (the default) then the fully qualified url to the image is returned. If no image is present then NULL is returned.
◆ chado_get_organism_scientific_name()
chado_get_organism_scientific_name |
( |
|
$organism, |
|
|
|
$schema_name = NULL |
|
) |
| |
Returns the full scientific name of an organism.
- Parameters
-
| $organism | An organism object. |
string | $schema_name | The name of the schema to pull the variable from. |
- Returns
- The full scientific name of the organism.
◆ chado_get_organism_select_options()
chado_get_organism_select_options |
( |
|
$published_only = FALSE , |
|
|
|
$show_common_name = FALSE , |
|
|
|
$schema_name = NULL |
|
) |
| |
Returns a list of organisms to use in select lists.
- Parameters
-
| $published_only | Only return organisms that have been published within Tripal. |
| $show_common_name | When true, include the organism common name, if present, in parentheses. |
string | $schema_name | The name of the schema to pull the variable from. |
- Returns
- An array of organisms where each value is the organism scientific name and the keys are organism_id's.
◆ chado_unabbreviate_infraspecific_rank()
chado_unabbreviate_infraspecific_rank |
( |
|
$rank | ) |
|
A handy function to expand the infraspecific rank from an abbreviation.
- Parameters
-
$rank | The rank below species or its abbreviation. A period at the end of the abbreviation is optional. |
- Returns
- The proper unabbreviated form for the rank.