function tripal_db_get_dbxref_by_accession
2.x tripal_db.DEPRECATED.inc | tripal_db_get_dbxref_by_accession($accession, $db_id = 0) |
3.x tripal_db.DEPRECATED.inc | tripal_db_get_dbxref_by_accession($accession, $db_id = 0) |
1.x tripal_db.api.inc | tripal_db_get_dbxref_by_accession($accession, $db_id = 0) |
Purpose: To retrieve a chado dbxref object with a given accession
Parameters
$accession: dbxref.accession
$db_id: dbxref.db_id
Return value
chado dbxref object with all fields from the chado dbxref table
Related topics
1 call to tripal_db_get_dbxref_by_accession()
- tripal_stock_add_ONE_dbreference_form_submit in tripal_stock/
includes/ tripal_stock-db_references.inc - Implements hoook_form_submit(): Actually adds the db reference to the stock
File
- tripal_db/
api/ tripal_db.api.inc, line 257 - Provides an application programming interface (API) to manage references to external databases
Code
function tripal_db_get_dbxref_by_accession($accession, $db_id = 0) {
if (!empty($db_id)) {
$r = db_fetch_object(chado_query(
"SELECT * FROM {dbxref} WHERE accession='%s' AND db_id=%d",
$accession, $db_id
));
}
else {
$r = db_fetch_object(chado_query(
"SELECT * FROM {dbxref} WHERE accession='%s'",
$accession
));
}
return $r;
}