Browse Source

Updated seq extract with better from field descriptions

Stephen Ficklin 12 years ago
parent
commit
1f1a1c213a

+ 6 - 6
tripal_feature/api/tripal_feature.api.inc

@@ -697,7 +697,7 @@ function tripal_feature_get_formatted_sequence($feature_id, $feature_name,
          $seq = wordwrap($seq, $num_bases_per_line, "<br>", TRUE);
       } 
       elseif ($output_format == 'fasta_txt') {
-         $seq = wordwrap($seq, $num_bases_per_line, "\n", TRUE);
+         $seq = wordwrap($seq, $num_bases_per_line, "\r\n", TRUE);
       }
       $residues .= ">$feature_name ($parent->typename) $parent->srcname:" . ($parent->adjfmin + 1) . ".." . $parent->adjfmax ." ($dir). ";
       if (count($types) > 0) {
@@ -715,14 +715,14 @@ function tripal_feature_get_formatted_sequence($feature_id, $feature_name,
           $residues .= "No sequence available.</br>"; 
         } 
         else {
-          $residues .= "No sequence available.\n"; 
+          $residues .= "No sequence available.\r\n"; 
         }         
       }
       else {
         if ($output_format == 'fasta_html') {
           $residues .= "<br>";
         }
-        $residues .= "\n" . $seq . "\n";          
+        $residues .= "\r\n" . $seq . "\r\n";          
         if ($output_format == 'fasta_html') {
           $residues .= "<br>";
         }
@@ -739,9 +739,9 @@ function tripal_feature_get_formatted_sequence($feature_id, $feature_name,
        $residues = wordwrap($residues, $num_bases_per_line, "<br>", TRUE);  
     } 
     elseif ($output_format == 'fasta_txt') {
-       $residues = wordwrap($residues, $num_bases_per_line, "\n", TRUE);  
+       $residues = wordwrap($residues, $num_bases_per_line, "\r\n", TRUE);  
     }
-    $residues = ">$feature_name\n$residues\n";
+    $residues = ">$feature_name\r\n$residues\r\n";
   }
   
   // format the residues for display
@@ -1050,4 +1050,4 @@ function tripal_feature_add_cvterm($feature_id, $cvname, $cvterm) {
     }
   }
   return TRUE;
-}
+}

+ 3 - 3
tripal_feature/includes/seq_extract.inc

@@ -23,7 +23,7 @@ function tripal_feature_seq_extract_page() {
     }
     else {
       drupal_set_header('Content-Type: text');
-      drupal_set_header('Content-Disposition: attachment; filename="sequences.fna"');
+      drupal_set_header('Content-Disposition: attachment; filename="sequences.fasta.txt"');
     }
     
     tripal_feature_seq_extract_get_features(NULL, $genus, $species, $analysis, 
@@ -242,14 +242,14 @@ function tripal_feature_seq_extract_form(&$form_state = NULL) {
   $form['upstream'] = array(
     '#title'         => t('Upstream Bases'),
     '#type'          => 'textfield',
-    '#description'   => t('An numeric value specifying the number of upstream bases to include.'),
+    '#description'   => t('A numeric value specifying the number of upstream bases to include. Only works if the feature is aligned to a larger sequence.'),
     '#default_value' => $dupstream,
     '#size'          => 5,
   );
   $form['downstream'] = array(
     '#title'         => t('Downstream Bases'),
     '#type'          => 'textfield',
-    '#description'   => t('An numeric value specifying the number of downstream bases to incldue.'),
+    '#description'   => t('A numeric value specifying the number of downstream bases to incldue.  Only works if the feature is aligned to a larger sequence.'),
     '#default_value' => $ddownstream,
     '#size'          => 5,
   );