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

Annotation of /FigKernelScripts/prepare_metagenome_files_for_ftp.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : mkubal 1.1 if(scalar(@ARGV) != 2){
2 :     print "usage: prepare_metagenome_files_for_ftp location_of_jobs_dir ftp_dir\n";
3 :     print "example: prepare_metagenome_files_for_ftp /vol/mg-rast/Jobs.dev /vol/ftp.theseed.org/Metagenomes\n";
4 :     exit;
5 :     }
6 :    
7 :     #$jobs_dir is location of jobs to moved to ftp
8 :     my $jobs_dir = shift(@ARGV);
9 :    
10 :     #$target_dir is is destination directory to be mirrored to ftp dir
11 :     my $target_dir = shift(@ARGV);
12 :    
13 :     opendir(DIR,"$jobs_dir");
14 :     @jobs = readdir(DIR);
15 :     close(DIR);
16 :    
17 :     foreach my $job (@jobs){
18 :     $job = 13;
19 :    
20 :     if(-e "$jobs_dir/$job/PRIVATE"){next}
21 :    
22 :     my $mg_id;
23 :     open(IN,"$jobs_dir/$job/GENOME_ID");
24 :     while($_ = <IN>){
25 :     chomp($_);
26 :     $mg_id = $_;
27 :     }
28 :     close(IN);
29 :    
30 :     if(-e $target_dir/$mg_id.peg.fasta){
31 :     if(`cmp $jobs_dir/$job/$mg_id.peg.fasta $target_dir/$mg_id.peg.fasta`){
32 :     `cp $jobs_dir/$job/$mg_id.peg.fasta $target_dir/$mg_id.peg.fasta`;
33 :     }
34 :     }
35 :     else{
36 :     `cp $jobs_dir/$job/$mg_id.peg.fasta $target_dir/$mg_id.peg.fasta`;
37 :     }
38 :    
39 :     if(-e $target_dir/$mg_id.assigned_functions.txt){
40 :     if(`cmp $jobs_dir/$job/$mg_id.assigned_functions.txt $target_dir/$mg_id.assigned_functions.txt`){
41 :     `cp $jobs_dir/$job/$mg_id.assigned_functions.txt $target_dir/$mg_id.assigned_functions.txt`;
42 :     }
43 :     }
44 :     else{
45 :     `cp $jobs_dir/$job/$mg_id.assigned_functions.txt $target_dir/$mg_id.assigned_functions.txt`;
46 :     }
47 :    
48 :     if(-e $target_dir/$mg_id.genome_and_proc_dir.tar.gz){
49 :     if(`cmp $jobs_dir/$job/$mg_id.genome_and_proc_dir.tar.gz $target_dir/$mg_id.genome_and_proc_dir.tar.gz`){
50 :     `cp $jobs_dir/$job/$mg_id.genome_and_proc_dir.tar.gz $target_dir/$mg_id.genome_and_proc_dir.tar.gz`;
51 :     }
52 :     }
53 :     else{
54 :     `cp $jobs_dir/$job/$mg_id.genome_and_proc_dir.tar.gz $target_dir/$mg_id.genome_and_proc_dir.tar.gz`;
55 :     }
56 :    
57 :     if(-e $target_dir/$mg_id.normalized.fasta){
58 :     if(`cmp $jobs_dir/$job/$mg_id.normalized.fasta $target_dir/$mg_id.normalized.fasta`){
59 :     `cp $jobs_dir/$job/$mg_id.normalized.fasta $target_dir/$mg_id.normalized.fasta`;
60 :     }
61 :     }
62 :     else{
63 :     `cp $jobs_dir/$job/$mg_id.normalized.fasta $target_dir/$mg_id.normalized.fasta`;
64 :     }
65 :    
66 :     if(-e $target_dir/$mg_id.gbk.gz){
67 :     if(`cmp $jobs_dir/$job/$mg_id.gbk.gz $target_dir/$mg_id.gbk.gz`){
68 :     `cp $jobs_dir/$job/$mg_id.gbk.gz $target_dir/$mg_id.gbk.gz`;
69 :     }
70 :     }
71 :     else{
72 :     `cp $jobs_dir/$job/$mg_id.gbk.gz $target_dir/$mg_id.gbk.gz`;
73 :     }
74 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3