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

Diff of /FortyEight/rp_rapid_propagation.pl

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

revision 1.4, Fri Jun 1 16:26:26 2007 UTC revision 1.8, Tue Jun 17 16:12:32 2008 UTC
# Line 8  Line 8 
8  use FIG_Config;  use FIG_Config;
9  use File::Basename;  use File::Basename;
10  use GenomeMeta;  use GenomeMeta;
11    use Carp 'croak';
12    
13  @ARGV == 1 or die "Usage: $0 job-dir\n";  @ARGV == 1 or die "Usage: $0 job-dir\n";
14    
# Line 52  Line 53 
53  # and rerun reformat_contigs without the split option in order  # and rerun reformat_contigs without the split option in order
54  # to recover the original contig coordinates.  # to recover the original contig coordinates.
55  #  #
56    # If keep_genecalls is enabled, we do not split the contigs.
57    #
58    
59    my $keep_genecalls = $meta->get_metadata("keep_genecalls");
60  my $unformatted = "$raw_dir/unformatted_contigs";  my $unformatted = "$raw_dir/unformatted_contigs";
61    
62  if (! -f $unformatted)  if (! -f $unformatted)
# Line 61  Line 65 
65  }  }
66    
67  #  #
68    # Determine genetic code.
69    #
70    
71    my $genetic_code = $meta->get_metadata("genome.genetic_code");
72    if (!define($genetic_code))
73    {
74        $meta->add_log_entry("Genetic code not defined; defaulting to 11");
75        $genetic_code = 11;
76    }
77    
78    #
79  # Reformat and split.  # Reformat and split.
80  #  #
81    # Only do this if we are doing gene calling.
82    #
83    
84  my $formatted = "$raw_dir/contigs";  my $formatted = "$raw_dir/contigs";
85    my @cmd;
86    
87    if ($keep_genecalls)
88    {
89        my $reformat_log = "$errdir/reformat_contigs.stderr";
90    
91        @cmd = ("$FIG_Config::bin/reformat_contigs", "-v", "-logfile=$reformat_log", $unformatted, $formatted);
92    }
93    else
94    {
95  my $reformat_split_log = "$errdir/reformat_contigs_split.stderr";  my $reformat_split_log = "$errdir/reformat_contigs_split.stderr";
96    
97  my @cmd = ("$FIG_Config::bin/reformat_contigs", "-v", "-logfile=$reformat_split_log", "-split", $unformatted, $formatted);      @cmd = ("$FIG_Config::bin/reformat_contigs", "-v", "-logfile=$reformat_split_log", "-split", $unformatted, $formatted);
98    }
99    
100  print "Run @cmd\n";  print "Run @cmd\n";
101    
# Line 92  Line 120 
120  # Determine if we are keeping the original gene calls.  # Determine if we are keeping the original gene calls.
121  #  #
122    
 my $keep_genecalls = $meta->get_metadata("keep_genecalls");  
123  my @keep_genecalls_flag;  my @keep_genecalls_flag;
124    
125  if ($keep_genecalls)  if ($keep_genecalls)
# Line 103  Line 130 
130    
131  @cmd = ("$FIG_Config::bin/rapid_propagation", "--errdir", $errdir,  @cmd = ("$FIG_Config::bin/rapid_propagation", "--errdir", $errdir,
132          @keep_genecalls_flag,          @keep_genecalls_flag,
133            "--code", $genetic_code,
134          "--meta", $meta_file,          "--meta", $meta_file,
135          "--tmpdir", $tmpdir,          "--tmpdir", $tmpdir,
136          $raw_dir, $rp_dir);          $raw_dir, $rp_dir);
# Line 136  Line 164 
164      my($msg) = @_;      my($msg) = @_;
165    
166      $meta->add_log_entry($0, ['fatal error', $msg]);      $meta->add_log_entry($0, ['fatal error', $msg]);
167        $meta->set_metadata("rp.error", $msg);
168        $meta->set_metadata("rp.running", "no");
169      $meta->set_metadata("status.rp", "error");      $meta->set_metadata("status.rp", "error");
170    
171      croak "$0: $msg";      croak "$0: $msg";

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3