Forráskód Böngészése

Debugging issue with OBO loader

Stephen Ficklin 8 éve
szülő
commit
2a29ef5ad0

+ 0 - 22
tripal/api/tripal.DEPRECATED.api.inc

@@ -89,25 +89,3 @@ function tripal_get_job_submit_date($job) {
   );
   return format_date($job->submit_date);
 }
-
-
-/**
- * @deprecated Restructured API to make naming more readable and consistent.
- * Function was deprecated in Tripal 3.0 and will be removed a later release.
- * This function has been replaced by tripal_get_running_jobs().
- *
- * @see chado_get_id_from_nid()
- */
-function tripal_is_job_running() {
-
-  tripal_report_error('tripal_deprecated',TRIPAL_NOTICE,
-    "DEPRECATED: %old_function has been replaced with %new_function. The arguments have been changed slightly (ie: $nid instead of $node). Please update your code.",
-    array(
-      '%old_function'=>'tripal_is_job_running',
-      '%new_function' => 'tripal_get_running_jobs'
-    )
-  );
-
-  //New API Function
-  return tripal_get_running_jobs();
-}

+ 7 - 5
tripal/api/tripal.jobs.api.inc

@@ -181,14 +181,18 @@ function tripal_get_job($job_id) {
 }
 
 /**
- * Returns a list of running tripal jobs
+ * Indicates if any jobs are running.
+ *
+ * This function will check the system to see if a job has a process ID
+ * and if that process ID is still running. It will update the job status
+ * accordingly before returning.
  *
  * @return
- *    and array of objects where each object describes a running job or FALSE if no jobs are running
+ *   Returns TRUE if any job is running or FALSE otherwise.
  *
  * @ingroup tripal_jobs_api
  */
-function tripal_get_running_jobs() {
+function tripal_is_job_running() {
 
   // iterate through each job that has not ended
   // and see if it is still running. If it is not
@@ -220,8 +224,6 @@ function tripal_get_running_jobs() {
 }
 
 
-
-
 /**
  * Set a job to be re-ran (ie: add it back into the job queue)
  *

+ 1 - 1
tripal/includes/tripal.jobs.inc

@@ -120,7 +120,7 @@ function tripal_jobs_report() {
 
   // run the following function which will
   // change the status of jobs that have errored out
-  tripal_is_job_running();
+  tripal_get_running_jobs();
 
   $job_status = '';
   $job_name = '';

+ 13 - 1
tripal_chado/includes/loaders/tripal_chado.obo_loader.inc

@@ -510,7 +510,7 @@ function tripal_chado_load_update_cvtermpath($newcvs, $jobid) {
  */
 function tripal_chado_load_obo_v1_2($file, $jobid = NULL, &$newcvs) {
 
-  $transaction = db_transaction();
+  #$transaction = db_transaction();
   print "\nNOTE: Loading of this OBO file is performed using a database transaction. \n" .
       "If the load fails or is terminated prematurely then the entire set of \n" .
       "insertions/updates is rolled back and will not be found in the database\n\n";
@@ -900,6 +900,18 @@ function tripal_cv_obo_process_term($term, $defaultcv, $is_relationship = 0, &$n
     foreach ($term['relationship'] as $value) {
       $rel = preg_replace('/^(.+?)\s.+?$/', '\1', $value);
       $object = preg_replace('/^.+?\s(.+?)$/', '\1', $value);
+      // The Gene Ontology uses 'has_part' for transitive relationships, but
+      // it specifically indicates that 'has_part' should not be used for
+      // grouping annotations.  Unfortunately, this means that when we
+      // try to popoulate the cvtermpath table a 'has_part' relationships
+      // will be used for exactly that purpose: to group annotations.  This
+      // doesn't seem to the be the case for other vocabularies such as the
+      // sequence ontology that uses has_part as primary relationship between
+      // terms. So, when loading the GO, we'll not include has_part
+      // relationships.
+      if ($rel == 'has_part' and $cvterm->dbxref_id->db_id->name = 'GO') {
+        continue;
+      }
       if (!tripal_cv_obo_add_relationship($cvterm, $defaultcv, $rel, $object, $is_relationship, $default_db)) {
         tripal_cv_obo_quiterror("Cannot add relationship $rel: $object");
       }