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

fix issue of vcf files not copied to right sub-dir

Jiu9Shen 4 жил өмнө
parent
commit
95e9353c39

+ 1 - 1
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt_commands.inc

@@ -78,7 +78,7 @@ function tripal_jbrowse_mgmt_cmd_add_track($track) {
       $file_name = $track->file;
       if (is_dir($track->file)) {
         $file_name = glob($track->file . '/' . '*.vcf.gz')[0];
-        $index_name = glob($track->file . '/' . '*.vcf.gz.[tbi][csi][idx]')[0];
+        $index_name = glob($track->file . '/' . '*.vcf.gz.[cti][sbd][ix]')[0];
       }
       $file_name = pathinfo($file_name)['basename'];
 

+ 4 - 7
tripal_jbrowse_mgmt/includes/tripal_jbrowse_mgmt_tracks.form.inc

@@ -143,13 +143,7 @@ function tripal_jbrowse_mgmt_add_track_form_validate($form, &$form_state) {
   }
   $base_path = $base_path . '/data';
 
-  if ($file_type === 'vcf') {
-    $path = $base_path . '/vcf';
-  }
-  if (($file_type === 'bam') OR ($file_type === 'cram')){
-    $path = $base_path . '/bam';
-  }
-  elseif ($file_type === 'bw') {
+  if ($file_type === 'bw') {
     $path = $base_path . '/wig';
   }
   else {
@@ -157,16 +151,19 @@ function tripal_jbrowse_mgmt_add_track_form_validate($form, &$form_state) {
   }
   switch ($file_type) {
     case 'vcf':
+      $path = $base_path . '/vcf';
       $index = $_FILES['files']['tmp_name']['file2'];
       $form_state = tripal_jbrowse_mgmt_validate_folder_upload($file, $index, $path, $form_state);
       break;
 
     case 'bam':
+      $path = $base_path . '/bam';
       $index = $_FILES['files']['tmp_name']['file2'];
       $form_state = tripal_jbrowse_mgmt_validate_folder_upload($file, $index, $path, $form_state);
       break;
 
     case 'cram':
+      $path = $base_path . '/bam';
       $index = $_FILES['files']['tmp_name']['file2'];
       $form_state = tripal_jbrowse_mgmt_validate_folder_upload($file, $index, $path, $form_state);
       break;