[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.10, Wed Nov 5 22:39:29 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 (!defined($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    my $split_size = 3;
88    if ($FIG_Config::rast_contig_ambig_split_size =~ /^\d+$/)
89    {
90        $split_size = $FIG_Config::rast_contig_ambig_split_size;
91    }
92    
93    if ($keep_genecalls)
94    {
95        my $reformat_log = "$errdir/reformat_contigs.stderr";
96    
97        @cmd = ("$FIG_Config::bin/reformat_contigs", "-v", "-logfile=$reformat_log", $unformatted, $formatted);
98    }
99    else
100    {
101  my $reformat_split_log = "$errdir/reformat_contigs_split.stderr";  my $reformat_split_log = "$errdir/reformat_contigs_split.stderr";
102    
103  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=$split_size", $unformatted, $formatted);
104    }
105    
106  print "Run @cmd\n";  print "Run @cmd\n";
107    
# Line 92  Line 126 
126  # Determine if we are keeping the original gene calls.  # Determine if we are keeping the original gene calls.
127  #  #
128    
 my $keep_genecalls = $meta->get_metadata("keep_genecalls");  
129  my @keep_genecalls_flag;  my @keep_genecalls_flag;
130    
131  if ($keep_genecalls)  if ($keep_genecalls)
# Line 103  Line 136 
136    
137  @cmd = ("$FIG_Config::bin/rapid_propagation", "--errdir", $errdir,  @cmd = ("$FIG_Config::bin/rapid_propagation", "--errdir", $errdir,
138          @keep_genecalls_flag,          @keep_genecalls_flag,
139            "--code", $genetic_code,
140          "--meta", $meta_file,          "--meta", $meta_file,
141          "--tmpdir", $tmpdir,          "--tmpdir", $tmpdir,
142          $raw_dir, $rp_dir);          $raw_dir, $rp_dir);
# Line 136  Line 170 
170      my($msg) = @_;      my($msg) = @_;
171    
172      $meta->add_log_entry($0, ['fatal error', $msg]);      $meta->add_log_entry($0, ['fatal error', $msg]);
173        $meta->set_metadata("rp.error", $msg);
174        $meta->set_metadata("rp.running", "no");
175      $meta->set_metadata("status.rp", "error");      $meta->set_metadata("status.rp", "error");
176    
177      croak "$0: $msg";      croak "$0: $msg";

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3