[Bio] / FortyEightMeta / mg_compute_sims_on_timelogic.pl Repository:
ViewVC logotype

Diff of /FortyEightMeta/mg_compute_sims_on_timelogic.pl

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

revision 1.3, Thu Sep 27 19:48:15 2007 UTC revision 1.9, Thu Oct 11 16:37:35 2007 UTC
# Line 5  Line 5 
5  use FIG_Config;  use FIG_Config;
6  use File::Basename;  use File::Basename;
7  use GenomeMeta;  use GenomeMeta;
 #use lib "/home/mkubal/public_html/FIGdisk/dist/releases/dev/FortyEight";  
 #use lib "/home/mkubal/public_html/FIGdisk/dist/releases/dev/PPO";  
8    
9  use DBMaster;  use DBMaster;
10  use Job48;  use Job48;
11  #use SGE;  
12    my $STAGE = "sims";
13    
14  my $fig = new FIG;  my $fig = new FIG;
15    
# Line 41  Line 40 
40  my $fasta = $meta->get_metadata("preprocess.fasta_file");  my $fasta = $meta->get_metadata("preprocess.fasta_file");
41    
42    
43  my $tempf = "/vol/metagenome-48-hour/Data/tblastx-template";  my $tempf;
 #my $tempf = "/home/mkubal/TimeLogic_Templates/tblastx-template";  
44    
45  my @databases = ("nr_2007_0208","16s","lsu","gg");  my @databases = ("nr_2007_0208","16s","lsu","gg","ssu");
46    
47  foreach my $db (@databases){  foreach my $db (@databases){
48    
49        if($db eq "nr_2007_0208"){ $tempf = "/vol/metagenome-48-hour/Data/tblastx-template-nr";}
50        else{$tempf = "/vol/metagenome-48-hour/Data/tblastn-template-others";}
51    
52      my $fa=raelib->read_fasta("$fasta"); # this is a generic method of reading a fasta file into a ref to a hash      my $fa=raelib->read_fasta("$fasta"); # this is a generic method of reading a fasta file into a ref to a hash
53      my @keys=keys %$fa;      my @keys=keys %$fa;
54    
# Line 62  Line 63 
63          map {print OUT ">$_\n",$fa->{$_},"\n"} @subset;          map {print OUT ">$_\n",$fa->{$_},"\n"} @subset;
64          close OUT;          close OUT;
65    
66          my $job = `/decypher/cli/bin/dc_template -query sequences_to_blast -template $tempf -targ $db`;          my $tl_job = `/decypher/cli/bin/dc_template -query sequences_to_blast -template $tempf -targ $db -priority 5`;
67          $job =~ s/^OK1\s+//;          $tl_job =~ s/^OK1\s+//;
68          chomp($job);          chomp($tl_job);
69          push(@jobs,$job);          push(@jobs,$tl_job);
70            $job->meta->set_metadata("$tl_job", "submitted");
71      }      }
72    
73      unlink "sequences_to_blast";      unlink "sequences_to_blast";
# Line 86  Line 88 
88              }              }
89              if($_ =~/Completed/){              if($_ =~/Completed/){
90                  $record_jobs = 1;                  $record_jobs = 1;
91    
92              }              }
93              if($_ =~/Running/){              if($_ =~/Running/){
94                  $record_jobs = 0;                  $record_jobs = 0;
# Line 95  Line 98 
98          close(RUN);          close(RUN);
99    
100          $jobs_not_done = 0;          $jobs_not_done = 0;
101          foreach my $job (@jobs){          foreach my $tl_job (@jobs){
102              if(!$completed_jobs{$job}){              if(!$completed_jobs{$tl_job}){
103                  $jobs_not_done = 1;                  $jobs_not_done = 1;
104              }              }
105                else{
106                    $job->meta->set_metadata("$tl_job", "completed");
107                }
108          }          }
109          sleep(60);          sleep(60);
110      }      }
# Line 153  Line 159 
159          }          }
160          close(IN);          close(IN);
161      }      }
162    
163  }  }
164    
165    $job->meta->set_metadata("status.$STAGE", "complete");
166    $job->meta->set_metadata("$STAGE.running", "no");

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3