[Bio] / FigKernelScripts / assess_gene_call_quality.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/assess_gene_call_quality.pl

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

revision 1.9, Thu Feb 1 21:17:50 2007 UTC revision 1.10, Wed Apr 11 21:00:38 2007 UTC
# Line 6  Line 6 
6    
7  $0 =~ m/([^\/]+)$/;  $0 =~ m/([^\/]+)$/;
8  my $this_tool_name = $1;  my $this_tool_name = $1;
9  my $usage = "$this_tool_name [-h(elp)] [-meta=meta.file] [-parms=minlen,rna,conv,div,samestrand] OrgDir > fatal_errs 2> warnings";  my $usage = "$this_tool_name [-h(elp)] [-no_fatal] [-meta=meta.file] [-parms=minlen,rna,conv,div,samestrand] OrgDir > fatal_errs 2> warnings";
10    
11  if ((not @ARGV) || ($ARGV[0] =~ m/^-{1,2}h(elp)?/)) {  if ((not @ARGV) || ($ARGV[0] =~ m/^-{1,2}h(elp)?/)) {
12      die "\n   usage: $usage\n\n";      die "\n   usage: $usage\n\n";
13  }  }
14    
15    my $no_fatal      = "";
16  my $meta_file = "";  my $meta_file = "";
17  my $overlap_parms = "";  my $overlap_parms = "";
18    
19    my $FATAL = qq(FATAL);
20  while (@ARGV && ($ARGV[0] =~ m/^-/))  while (@ARGV && ($ARGV[0] =~ m/^-/))
21  {  {
22      if    ($ARGV[0] =~ m/^-{1,2}meta=(\S+)/) {      if    ($ARGV[0] =~ m/^-{1,2}no_fatal/) {
23            $no_fatal = shift @ARGV;
24            $FATAL    = qq(WARNING);
25        }
26        elsif ($ARGV[0] =~ m/^-{1,2}meta=(\S+)/) {
27          $meta_file = $1;          $meta_file = $1;
28          shift @ARGV;          shift @ARGV;
29      }      }
# Line 209  Line 216 
216    
217  my $num_fatal = $rna_overlaps + $bad_starts + $bad_stops + $same_stop + $embedded + $impossible;  my $num_fatal = $rna_overlaps + $bad_starts + $bad_stops + $same_stop + $embedded + $impossible;
218  my $num_warn  = $too_short + $convergent + $divergent + $same_strand;  my $num_warn  = $too_short + $convergent + $divergent + $same_strand;
219    
220    if ($no_fatal) {
221        $num_warn += $num_fatal;
222        $num_fatal = 0;
223    }
224    
225  my $num_tot   = $num_fatal + $num_warn;  my $num_tot   = $num_fatal + $num_warn;
226    
227  my ($pct_fatal, $pct_warn, $pct_tot, $pct_missing);  my ($pct_fatal, $pct_warn, $pct_tot, $pct_missing);
# Line 229  Line 242 
242  }  }
243    
244  my $out_fh = \*STDERR;  my $out_fh = \*STDERR;
245  if ($num_fatal || ($num_tot >= (0.10) * $num_features)) {  if (($num_fatal && !$no_fatal) || ($num_tot >= (0.10) * $num_features)) {
246      $recall = 1;      $recall = 1;
247      $out_fh = \*STDOUT;      $out_fh = \*STDOUT;
248  }  }
# Line 252  Line 265 
265          $meta->set_metadata( qq(qc.Pct_warn),          [ qq(SCORE), $pct_warn      ] );          $meta->set_metadata( qq(qc.Pct_warn),          [ qq(SCORE), $pct_warn      ] );
266          $meta->set_metadata( qq(qc.Pct_missing),       [ qq(SCORE), $pct_missing   ] );#     if $num_missing;          $meta->set_metadata( qq(qc.Pct_missing),       [ qq(SCORE), $pct_missing   ] );#     if $num_missing;
267    
268          $meta->set_metadata( qq(qc.RNA_overlaps),      [ qq(FATAL), $rna_overlaps  ] );#     if $rna_overlaps;          $meta->set_metadata( qq(qc.RNA_overlaps),      [ qq($FATAL),  $rna_overlaps  ] );#   if $rna_overlaps;
269          $meta->set_metadata( qq(qc.Bad_STARTs),        [ qq(FATAL), $bad_starts    ] );#     if $bad_starts;          $meta->set_metadata( qq(qc.Bad_STARTs),        [ qq($FATAL),  $bad_starts    ] );#   if $bad_starts;
270          $meta->set_metadata( qq(qc.Bad_STOPs),         [ qq(FATAL), $bad_stops     ] );#     if $bad_stops;          $meta->set_metadata( qq(qc.Bad_STOPs),         [ qq($FATAL),  $bad_stops     ] );#   if $bad_stops;
271          $meta->set_metadata( qq(qc.Embedded),          [ qq(FATAL), $embedded      ] );#     if $embedded;          $meta->set_metadata( qq(qc.Embedded),          [ qq($FATAL),  $embedded      ] );#   if $embedded;
272          $meta->set_metadata( qq(qc.Impossible),        [ qq(FATAL), $impossible    ] );#     if $impossible;          $meta->set_metadata( qq(qc.Impossible),        [ qq($FATAL),  $impossible    ] );#   if $impossible;
273    
274          $meta->set_metadata( qq(qc.Too_short),         [ qq(WARNING), $too_short   ] );#     if $too_short;          $meta->set_metadata( qq(qc.Too_short),         [ qq(WARNING), $too_short   ] );#     if $too_short;
275          $meta->set_metadata( qq(qc.Convergent),        [ qq(WARNING), $convergent  ] );#     if $convergent;          $meta->set_metadata( qq(qc.Convergent),        [ qq(WARNING), $convergent  ] );#     if $convergent;
# Line 297  Line 310 
310      print $out_fh "SCORE\tPct_warn\t$pct_warn\n";      print $out_fh "SCORE\tPct_warn\t$pct_warn\n";
311      print $out_fh "SCORE\tPct_missing\t$pct_missing\n"       ;#   if $num_missing;      print $out_fh "SCORE\tPct_missing\t$pct_missing\n"       ;#   if $num_missing;
312    
313      print $out_fh "FATAL\tRNA_overlaps\t$rna_overlaps\n"     ;#   if $rna_overlaps;      print $out_fh "$FATAL\tRNA_overlaps\t$rna_overlaps\n"     ;#   if $rna_overlaps;
314      print $out_fh "FATAL\tBad_STARTs\t$bad_starts\n"         ;#   if $bad_starts;      print $out_fh "$FATAL\tBad_STARTs\t$bad_starts\n"         ;#   if $bad_starts;
315      print $out_fh "FATAL\tBad_STOPs\t$bad_stops\n"           ;#   if $bad_stops;      print $out_fh "$FATAL\tBad_STOPs\t$bad_stops\n"           ;#   if $bad_stops;
316      print $out_fh "FATAL\tSame_STOP\t$same_stop\n"           ;#   if $same_stop;      print $out_fh "$FATAL\tSame_STOP\t$same_stop\n"           ;#   if $same_stop;
317      print $out_fh "FATAL\tEmbedded\t$embedded\n"             ;#   if $embedded;      print $out_fh "$FATAL\tEmbedded\t$embedded\n"             ;#   if $embedded;
318      print $out_fh "FATAL\tImpossible_overlaps\t$impossible\n";#   if $impossible;      print $out_fh "$FATAL\tImpossible_overlaps\t$impossible\n";#   if $impossible;
319    
320      print $out_fh "WARNING\tToo_short\t$too_short\n"         ;#   if $too_short;      print $out_fh "WARNING\tToo_short\t$too_short\n"         ;#   if $too_short;
321      print $out_fh "WARNING\tConvergent\t$convergent\n"       ;#   if $convergent;      print $out_fh "WARNING\tConvergent\t$convergent\n"       ;#   if $convergent;

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3