Эх сурвалжийг харах

Merge pull request #2 from tripal/7.x-2.x

Update tripal
Abdullah Almsaeed 8 жил өмнө
parent
commit
6963a7659d

+ 2 - 2
tripal_core/includes/tripal_core.form_elements.inc

@@ -177,7 +177,7 @@ function expand_sequence_combo($element, $form_state, $complete_form) {
   $element['upstream'] = array(
      '#type' => 'textfield',
      '#title' => t('Get Upstream Bases'),
-     '#description' => t('Specify the number of upstream bases to include in the sequnce'),
+     '#description' => t('Specify the number of upstream bases to include in the sequence'),
      '#default_value' => $element['#value']['upstream'],
   );
   // add the downstream box
@@ -187,7 +187,7 @@ function expand_sequence_combo($element, $form_state, $complete_form) {
      '#type' => 'textfield',
      '#prefix' => '<br>',
      '#title' => t('Get Downstream Bases'),
-     '#description' => t('Specify the number of downstream bases to include in the sequnce'),
+     '#description' => t('Specify the number of downstream bases to include in the seqeunce'),
      '#default_value' => $element['#value']['downstream'],
   );
   return $element;

+ 2 - 2
tripal_feature/includes/tripal_feature.fasta_loader.inc

@@ -670,7 +670,7 @@ function tripal_feature_load_fasta_feature($fh, $name, $uname, $db_id, $accessio
     }
 
     // If the feature exists but this is an "insert only" then skip.
-    if ($feature and (strcmp($method, 'Insert only') == 0)) {
+    if (isset($feature) and (strcmp($method, 'Insert only') == 0)) {
       tripal_report_error('T_fasta_loader', TRIPAL_WARNING, "Feature already exists '%name' ('%uname') while matching on %type. Skipping insert.", array(
         '%name' => $name,'%uname' => $uname,'%type' => drupal_strtolower($match_type)
       ));
@@ -733,7 +733,7 @@ function tripal_feature_load_fasta_feature($fh, $name, $uname, $db_id, $accessio
   }
 
   // if we do have a feature and this is an update then proceed with the update
-  if ($feature and !$inserted and (strcmp($method, 'Update only') == 0 or
+  if (isset($feature) and !$inserted and (strcmp($method, 'Update only') == 0 or
      strcmp($method, 'Insert and update') == 0)) {
 
     // if the user wants to match on the Name field

+ 11 - 3
tripal_feature/includes/tripal_feature.gff_loader.inc

@@ -462,6 +462,10 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
   // to do the database query every time.
   $cvterm_lookup = array();
 
+  // An array that stores Landmarks that have been looked up so we don't have
+  // to do the database query every time.
+  $landmark_lookup = array();
+
   // empty the temp tables
   $sql = "DELETE FROM {tripal_gff_temp}";
   chado_query($sql);
@@ -803,9 +807,10 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
       // Make sure the landmark sequence exists in the database.  If the user
       // has not specified a landmark type (and it's not required in the GFF
       // format) then we don't know the type of the landmark so we'll hope
-      // that it's unique across all types for the orgnaism. Only do this
+      // that it's unique across all types for the organism. Only do this
       // test if the landmark and the feature are different.
-      if (!$remove and !(strcmp($landmark, $attr_uniquename) == 0 or strcmp($landmark, $attr_name) == 0)) {
+      if (!$remove and !(strcmp($landmark, $attr_uniquename) == 0 or strcmp($landmark, $attr_name) == 0) and !in_array($landmark, $landmark_lookup)) {
+
         $select = array(
           'organism_id' => $organism->organism_id,
           'uniquename'  => $landmark,
@@ -848,6 +853,9 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
                 "The features cannot be associated", array('%landmark' => $landmark));
           return '';
         }
+
+        // The landmark was found, remember it
+        $landmark_lookup[] = $landmark;
       }
 /*
       // If the option is to remove or refresh then we want to remove
@@ -888,7 +896,7 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
             'type_name' => $type,
             'uniquename' => $feature->uniquename
           );
-          // make sure this record doesn't already exist in oru temp table
+          // make sure this record doesn't already exist in our temp table
           $results = chado_select_record('tripal_gff_temp', array('*'), $values);
 
           if (count($results) == 0) {

+ 1 - 1
tripal_feature/theme/templates/tripal_feature_sequence.tpl.php

@@ -171,7 +171,7 @@ if ($residues or count($featureloc_sequences) > 0) {
       // that one mRNA is only aligned to a single location on the assembly so we
       // can access the CDS sequence with index 0.
       if ($cds_sequence[0]['residues']) {
-        $list_items[] = '<a href="#coding_' . $attrs['id'] . '">coding sequnece from alignment at  ' . $attrs['location'] . "</a>";
+        $list_items[] = '<a href="#coding_' . $attrs['id'] . '">coding sequence from alignment at  ' . $attrs['location'] . "</a>";
         $sequences_html .= '<a name="ccoding_' . $attrs['id'] . '"></a>';
         $sequences_html .= '<div id="coding_' . $attrs['id'] . '" class="tripal_feature-sequence-item">';
         $sequences_html .= '<p><b>Coding sequence (CDS) from alignment at  ' . $attrs['location'] . '</b></p>';