[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.2, Wed Nov 29 15:19:19 2006 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  @ARGV == 4 or die "Usage: $0 fasta-file nr peg.synonyms sims-job-dir\n";  my $usage = "Usage: $0 [-size max-size] [-include-self] fasta-file nr peg.synonyms sims-job-dir";
18    
19    my $max_size = 10_000;
20    my $include_self = 0;
21    
22    while (@ARGV > 0 and $ARGV[0] =~ /^-/)
23    {
24        my $arg = shift @ARGV;
25        if ($arg =~ /^-size/)
26        {
27            $max_size = shift @ARGV;
28        }
29        elsif ($arg =~ /^-include-self/)
30        {
31            $include_self++;
32        }
33        else
34        {
35            die $usage;
36        }
37    }
38    
39    @ARGV == 4 or die $usage;
40    
41  my $fasta = shift;  my $fasta = shift;
42  my $nr_file = shift;  my $nr_file = shift;
# Line 23  Line 45 
45    
46  -d $jobdir or mkdir $jobdir or die "Cannot mkdir $jobdir: $!\n";  -d $jobdir or mkdir $jobdir or die "Cannot mkdir $jobdir: $!\n";
47    
 my $max_size = 10_000;  
48  my $next_task = 1;  my $next_task = 1;
49  my $last_task;  my $last_task;
50    
# Line 61  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 90  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.2  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3