[Bio] / FigKernelScripts / prepare_metagenome_files_for_download.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/prepare_metagenome_files_for_download.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Thu Jan 17 21:30:52 2008 UTC revision 1.3, Tue Jan 29 21:57:33 2008 UTC
# Line 13  Line 13 
13  close(DIR);  close(DIR);
14    
15  foreach my $job (@jobs){  foreach my $job (@jobs){
16        if($job != 13){next;}
17    
18      my $mg_id;      my $mg_id;
19      open(IN,"$jobs_dir/$job/GENOME_ID");      open(IN,"$jobs_dir/$job/GENOME_ID");
20      while($_ = <IN>){      while($_ = <IN>){
# Line 21  Line 23 
23      }      }
24      close(IN);      close(IN);
25    
26      if(! -d "$jobs_dir/$job/DOWNLOAD"){      if(! -d "$jobs_dir/$job/download"){
27          `mkdir $jobs_dir/$job/DOWNLOAD`;          `mkdir $jobs_dir/$job/download`;
28      };      };
29    
30      `cp $jobs_dir/$job/rp/$mg_id/Features/peg/fasta $jobs_dir/$job/DOWNLOAD/$mg_id.peg.fasta`;      `cp $jobs_dir/$job/rp/$mg_id/Features/peg/fasta $jobs_dir/$job/download/$mg_id.protein.fa`;
31      `cp $jobs_dir/$job/rp/$mg_id/assigned_functions $jobs_dir/$job/DOWNLOAD/$mg_id.assigned_functions.txt`;      `gzip $jobs_dir/$job/download/$mg_id.protein.fa`;
32    
33        `cp $jobs_dir/$job/rp/$mg_id/assigned_functions $jobs_dir/$job/download/$mg_id.functions.txt`;
34        `gzip $jobs_dir/$job/download/$mg_id.functions.txt`;
35    
36      opendir(DIR,"$jobs_dir/$job/proc");      opendir(DIR,"$jobs_dir/$job/proc");
37      my @files = readdir(DIR);      my @files = readdir(DIR);
38      close(DIR);      close(DIR);
39      foreach my $file (@files){      foreach my $file (@files){
40          if($file =~/(\d+.fa)$/){          if($file =~/(\d+.fa)$/){
41              `cp $jobs_dir/$job/proc/$file $jobs_dir/$job/DOWNLOAD/$mg_id.normalized.fasta`;              `cp $jobs_dir/$job/proc/$file $jobs_dir/$job/download/$mg_id.dna.fa`;
42                `gzip $jobs_dir/$job/download/$mg_id.dna.fa`;
43              last;              last;
44          }          }
45      }      }
46    
47      `tar -czf $jobs_dir/$job/DOWNLOAD/$mg_id.genome_and_proc_dir.tar.gz $jobs_dir/$job/proc $jobs_dir/$job/rp/$mg_id`;      open(INDEX,">$jobs_dir/$job/download/index");
48        print INDEX "$mg_id.all_internal_data.tar.gz      MGRAST data directories\n";
49        print INDEX "$mg_id.complete.gbk.gz       Genbank File\n";
50        print INDEX "$mg_id.dna.fa.gz        Normalized DNA FASTA\n";
51        print INDEX "$mg_id.functions.txt.gz Assigned Protein Functions\n";
52        print INDEX "$mg_id.protein.fa.gz    Assigned Protein Sequences FASTA\n";
53        close(INDEX);
54    
55        `tar -czf $jobs_dir/$job/download/$mg_id.all_internal_data.tar.gz $jobs_dir/$job/proc $jobs_dir/$job/rp/$mg_id`;
56  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3