[Bio] / FortyEight / rp_chunk_sims.pl Repository:
ViewVC logotype

Diff of /FortyEight/rp_chunk_sims.pl

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

revision 1.3, Wed Sep 5 20:59:03 2007 UTC revision 1.4, Mon Mar 16 18:47:00 2009 UTC
# Line 14  Line 14 
14  use File::Basename;  use File::Basename;
15  use Cwd 'abs_path';  use Cwd 'abs_path';
16    
17  my $usage = "Usage: $0 [-size max-size] fasta-file nr peg.synonyms sims-job-dir";  my $usage = "Usage: $0 [-size max-size] [-include-self] fasta-file nr peg.synonyms sims-job-dir";
18    
19  my $max_size = 10_000;  my $max_size = 10_000;
20    my $include_self = 0;
21    
22  while (@ARGV > 0 and $ARGV[0] =~ /^-/)  while (@ARGV > 0 and $ARGV[0] =~ /^-/)
23  {  {
# Line 25  Line 26 
26      {      {
27          $max_size = shift @ARGV;          $max_size = shift @ARGV;
28      }      }
29        elsif ($arg =~ /^-include-self/)
30        {
31            $include_self++;
32        }
33      else      else
34      {      {
35          die $usage;          die $usage;
# Line 77  Line 82 
82    
83      open(F, "<$file") or die "Cannot open $file: $!\n";      open(F, "<$file") or die "Cannot open $file: $!\n";
84    
85        #
86        # Prepare and submit self-sims.
87        #
88        if ($include_self)
89        {
90            system("$FIG_Config::ext_bin/formatdb", "-p", "t", "-i", $file);
91            my $task = $next_task++;
92            print TASK join("\t", $task, $file, $file, $flags,
93                            "$output_dir/$base/out.$task", "$error_dir/$base/err.$task"), "\n";
94        }
95    
96      print "Chunk file $file\n";      print "Chunk file $file\n";
97    
98      while (<F>)      while (<F>)
# Line 106  Line 122 
122      }      }
123      close(F);      close(F);
124  }  }
125    
126  close(TASK);  close(TASK);
127    
128  print "tasks\t1\t$last_task\n";  print "tasks\t1\t$last_task\n";

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3