spficklin vor 14 Jahren
Ursprung
Commit
68a12f10e2

+ 4 - 4
tripal_db/tripal_db.module

@@ -18,7 +18,7 @@ function tripal_db_menu() {
    $items = array();
 
    $items['admin/tripal/tripal_db'] = array(
-     'title' => 'External Database References',
+     'title' => 'Databases',
      'description' => 'Basic Description of Tripal DB Module Functionality',
      'page callback' => 'tripal_db_module_description_page',
      'access arguments' => array('administer site configuration'),
@@ -27,21 +27,21 @@ function tripal_db_menu() {
 
    $items['admin/tripal/tripal_db/edit_db'] = array(
      'title' => 'Update/Delete Database References',
-     'description' => 'Manage External Databases ',
+     'description' => 'Manage Databases ',
      'page callback' => 'tripal_db_admin_page',
      'access arguments' => array('administer site configuration'),
      'type' => MENU_NORMAL_ITEM,
    );
    
    $items['admin/tripal/tripal_db/add_db'] = array(
-     'title' => 'Add an External Database',
+     'title' => 'Add a Database',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('tripal_db_form'),
      'access arguments' => array('access administration pages'),
      'type' => MENU_NORMAL_ITEM,
    );
    $items['admin/tripal/tripal_db/edit/js'] = array(
-     'title' => 'Edit External Databases',
+     'title' => 'Edit Databases',
      'page callback' => 'tripal_ajax_db_edit',
      'access arguments' => array('access administration pages'),
      'type' => MENU_CALLBACK,

+ 14 - 6
tripal_feature/syncFeatures.php

@@ -20,7 +20,6 @@ if(isset($arguments['f'])){
    $feature_id = $arguments['f'];
 
    if($feature_id > 0 ){ 
-      print "syncing feature $feature_id\n";
       tripal_feature_sync_feature($feature_id); 
    }
    else{ 
@@ -83,6 +82,9 @@ function tripal_feature_sync_features ($max_sync = 0, $job_id = NULL){
    // is not one of the specified typse we won't build a node for it.
    $allowed_types = variable_get('chado_feature_types','EST contig');
    $allowed_types = preg_replace("/[\s\n\r]+/"," ",$allowed_types);
+
+   print "Looking for features of type: $allowed_types\n";
+
    $so_terms = split(' ',$allowed_types);
    $where_cvt = "";
    foreach ($so_terms as $term){
@@ -95,16 +97,20 @@ function tripal_feature_sync_features ($max_sync = 0, $job_id = NULL){
    $orgs = organism_get_synced();
    $where_org = "";
    foreach($orgs as $org){
-      $where_org .= "F.organism_id = $org->organism_id OR ";
+      if($org->organism_id){
+         $where_org .= "F.organism_id = $org->organism_id OR ";
+      }
    }
    $where_org = substr($where_org,0,strlen($where_org)-3);  # strip trailing 'OR'
 
    // use this SQL statement to get the features that we're going to upload
    $sql = "SELECT feature_id ".
           "FROM {FEATURE} F ".
-          "   INNER JOIN Cvterm CVT ON F.type_id = CVT.cvterm_id ".
-          "WHERE ($where_cvt) AND ($where_org) ".
+          "  INNER JOIN Cvterm CVT ON F.type_id = CVT.cvterm_id ".
+          "  INNER JOIN CV on CV.cv_id = CVT.cv_id ".
+          "WHERE ($where_cvt) AND ($where_org) AND CV.name = 'sequence' ".
           "ORDER BY feature_id";
+
    // get the list of features
    $previous_db = tripal_db_set_active('chado');  // use chado database
    $results = db_query($sql);
@@ -129,6 +135,8 @@ function tripal_feature_sync_features ($max_sync = 0, $job_id = NULL){
 
    // Iterate through features that need to be synced
    $interval = intval($count * 0.01);
+   $num_ids = sizeof($ids);
+   $i = 0;
    foreach($ids as $feature_id){
       // update the job status every 1% features
       if($job_id and $i % $interval == 0){
@@ -145,7 +153,7 @@ function tripal_feature_sync_features ($max_sync = 0, $job_id = NULL){
          # we are not sure why PHP does not clean up the memory as it goes
          # to avoid this problem we will call this script through an
          # independent system call
-
+         print "$i of $num_ids Syncing feature id: $feature_id\n";
          $cmd = "php " . drupal_get_path('module', 'tripal_feature') . "/syncFeatures.php -f $feature_id ";
          system($cmd);
 
@@ -162,7 +170,7 @@ function tripal_feature_sync_features ($max_sync = 0, $job_id = NULL){
  * @ingroup tripal_feature
  */
 function tripal_feature_sync_feature ($feature_id){
-//   print "\tfeature $feature_id\n";
+//   print "\tSyncing feature $feature_id\n";
 
    $mem = memory_get_usage(TRUE);
    $mb = $mem/1048576;

+ 1 - 2
tripal_feature/tripal_feature.admin.inc

@@ -221,8 +221,7 @@ function tripal_feature_admin () {
          '#type'        => t('textfield'),
          '#description' => t("Internal ID numbers for features consist of the ".
             "chado feature_id and a site specific prefix.  Set the prefix that ".
-            "will be incorporated in front of each feature_id to form a unique ".
-            "accession number for this site."),
+            "will be incorporated in front of each feature_id."),
          '#required'    => TRUE,
          '#default_value' => variable_get('chado_feature_accession_prefix','ID'),
       );