|
@@ -603,7 +603,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
if (count($results) == 1) {
|
|
if (count($results) == 1) {
|
|
- $reature = $results[0];
|
|
|
|
|
|
+ $feature = $results[0];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// check to see if this feature already exists if the match_type is 'Unique Name'
|
|
// check to see if this feature already exists if the match_type is 'Unique Name'
|
|
@@ -613,6 +613,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
|
|
'uniquename' => $uname,
|
|
'uniquename' => $uname,
|
|
'type_id' => $cvterm->cvterm_id,
|
|
'type_id' => $cvterm->cvterm_id,
|
|
);
|
|
);
|
|
|
|
+
|
|
$options = array('statement_name' => 'sel_feature_oruqty');
|
|
$options = array('statement_name' => 'sel_feature_oruqty');
|
|
$results = tripal_core_chado_select('feature', array('feature_id'), $values, $options);
|
|
$results = tripal_core_chado_select('feature', array('feature_id'), $values, $options);
|
|
if (count($results) > 1) {
|
|
if (count($results) > 1) {
|
|
@@ -621,7 +622,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
if (count($results) == 1) {
|
|
if (count($results) == 1) {
|
|
- $reature = $results[0];
|
|
|
|
|
|
+ $feature = $results[0];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -791,7 +792,7 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // now add the database cross reference
|
|
|
|
|
|
+ // now add the database cross reference
|
|
if ($db_id) {
|
|
if ($db_id) {
|
|
// check to see if this accession reference exists, if not add it
|
|
// check to see if this accession reference exists, if not add it
|
|
$values = array(
|
|
$values = array(
|
|
@@ -800,10 +801,11 @@ function tripal_feature_fasta_loader_handle_feature($name, $uname, $db_id, $acce
|
|
);
|
|
);
|
|
$sel_options = array('statement_name' => 'sel_dbxref_dbac');
|
|
$sel_options = array('statement_name' => 'sel_dbxref_dbac');
|
|
$results = tripal_core_chado_select('dbxref', array('dbxref_id'), $values, $sel_options);
|
|
$results = tripal_core_chado_select('dbxref', array('dbxref_id'), $values, $sel_options);
|
|
|
|
+ // if the accession doesn't exist then add it
|
|
if (count($results) == 0) {
|
|
if (count($results) == 0) {
|
|
- $ins_options = array('statement_name' => 'sel_dbxref_dbac');
|
|
|
|
- $success = tripal_core_chado_insert('dbxref', $values, $ins_options);
|
|
|
|
- if (!$success) {
|
|
|
|
|
|
+ $ins_options = array('statement_name' => 'ins_dbxref_dbac');
|
|
|
|
+ $results = tripal_core_chado_insert('dbxref', $values, $ins_options);
|
|
|
|
+ if (!$results) {
|
|
watchdog('T_fasta_loader', "Failed to add database accession '%accession'",
|
|
watchdog('T_fasta_loader', "Failed to add database accession '%accession'",
|
|
array('%accession' => $accession), WATCHDOG_ERROR);
|
|
array('%accession' => $accession), WATCHDOG_ERROR);
|
|
return 0;
|
|
return 0;
|