Tripal Plant PopGen Submit
|
Go to the source code of this file.
Functions | |
tpps_add_project_file (array &$state, &$fid) | |
tpps_chado_insert_multi (array $record_groups, array $options=array()) | |
tpps_chado_insert_record ($table, $records, array $options=array()) | |
tpps_chado_prop_exists ($base_table, $id, $name, array $options=array()) | |
tpps_get_taxon ($org_name, $rank) | |
tpps_table_columns ($table) | |
tpps_tripal_entity_publish ($bundle_name, array $vals, array $options=array()) | |
Defines useful functions that interact with Chado.
Definition in file chado_utils.inc.
tpps_add_project_file | ( | array & | $state, |
& | $fid | ||
) |
Add a file path as a projectprop to a submission.
array | $state | The TPPS submission associated with the file. |
int | $fid | The managed file id number. |
Definition at line 522 of file chado_utils.inc.
tpps_chado_insert_multi | ( | array | $record_groups, |
array | $options = array() |
||
) |
Inserts multiple records into the chado database.
This function will insert multiple records into multiple tables in the chado database. This function is much faster than the tpps_chado_insert_record() function with the 'multi' option set to true, because .
array | $record_groups | An array of tables and the records that will be going into each table. |
array | $options | Additional options. |
Definition at line 141 of file chado_utils.inc.
tpps_chado_insert_record | ( | $table, | |
$records, | |||
array | $options = array() |
||
) |
Inserts a record to a chado table using the Tripal Chado API.
This function uses the Tripal Chado API to insert a record. However, if the record already exists, then this function will update that record in the database instead. This function also supports insertion of multiple records at a time, while the standard Tripal chado_insert_record function does not.
string | $table | The name of the Chado table being inserted to. |
mixed | $records | The record or array of records to be inserted to chado. |
array | $options | An array of additional options which can be passed to chado_insert_record. |
Definition at line 27 of file chado_utils.inc.
tpps_chado_prop_exists | ( | $base_table, | |
$id, | |||
$name, | |||
array | $options = array() |
||
) |
Checks to see if a property of an item already exists in chado.
string | $base_table | The name of the base chado table. |
int | $id | The record if of the base item. |
string | $name | The name of the type_id of the property we are looking for. |
array | $options | Additional options. |
Definition at line 433 of file chado_utils.inc.
tpps_get_taxon | ( | $org_name, | |
$rank | |||
) |
Tries to retrieve taxonomy information about an organism from the db.
If taxonomy information for the genus does not already exist, then the function tries to retrieve taxonomy information from NCBI.
string | $org_name | The full name (genus, species) of the organism. |
string | $rank | The taxonomic rank (subkingdom, order, family, etc). |
Definition at line 496 of file chado_utils.inc.
tpps_table_columns | ( | $table | ) |
Returns an array of field names associated with a db table.
This function first checks the chado schema of the table. If there is no existing chado schema, then it will check the drupal schema. If there is no existing drupal schema, it will return an empty array.
string | $table | The name of the table. |
Definition at line 467 of file chado_utils.inc.
tpps_tripal_entity_publish | ( | $bundle_name, | |
array | $vals, | ||
array | $options = array() |
||
) |
Publish a Tripal Entity based on the bundle name, title, and record id.
string | $bundle_name | The name of the bundle, for example, "Organism", "Gene", "Project", etc. |
array | $vals | The an array of entity values to be published. |
array | $options | Additional options for publishing. |
Definition at line 333 of file chado_utils.inc.