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

Diff of /FigKernelScripts/build_initial_objects_for_start_predictions.pl

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

revision 1.10, Mon Dec 5 18:56:37 2005 UTC revision 1.11, Fri Nov 30 21:53:05 2007 UTC
# Line 1  Line 1 
1  # -*- perl -*-  # -*- perl -*-
2  #  ########################################################################
3  # Copyright (c) 2003-2006 University of Chicago and Fellowship  # Copyright (c) 2003-2006 University of Chicago and Fellowship
4  # for Interpretations of Genomes. All Rights Reserved.  # for Interpretations of Genomes. All Rights Reserved.
5  #  #
# Line 14  Line 14 
14  # at info@ci.uchicago.edu or the Fellowship for Interpretation of  # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15  # Genomes at veronika@thefig.info or download a copy from  # Genomes at veronika@thefig.info or download a copy from
16  # http://www.theseed.org/LICENSE.TXT.  # http://www.theseed.org/LICENSE.TXT.
17  #  ########################################################################
   
18    
19  use FIG;  use FIG;
20  my $fig = new FIG;  my $fig = new FIG;
21    use FIGV;
22    
23  $usage = "usage: build_initial_objects_for_start_predictions [tbl] < pegs_to_call > initial_objects";  $0 =~ m/([^\/]+)$/;  $self = $1;
24    warn "$0 " . join(" ", @ARGV) . "\n";
25    $usage = "build_initial_objects_for_start_predictions [-orgdir=OrgDir] [tbl] < pegs_to_call > initial_objects";
26    
27  use constant FID    =>  0;  use constant FID    =>  0;
28  use constant LOCUS  =>  1;  use constant LOCUS  =>  1;
# Line 32  Line 34 
34  use constant LEN    =>  7;  use constant LEN    =>  7;
35  use constant STRAND =>  8;  use constant STRAND =>  8;
36    
   
37  $tbl_file = "";  $tbl_file = "";
38  $trouble  = 0;  $trouble  = 0;
39  while (@ARGV)  while (@ARGV)
40  {  {
41      if ($ARGV[0] =~ m/-h(elp)?/)      if ($ARGV[0] =~ m/-h(elp)?/) {
     {  
42          die "\n\tusage: $usage\n\n";          die "\n\tusage: $usage\n\n";
43      }      }
44      elsif (-s $ARGV[0])      elsif ($ARGV[0] =~ /-orgdir=(\S+)/) {
45      {          warn "Using $ARGV[0]\n";
46            $fig = new FIGV($1);
47        }
48        elsif (-s $ARGV[0]) {
49          $tbl_file = $ARGV[0];          $tbl_file = $ARGV[0];
50      }      }
51      else      else {
     {  
52          warn "Invalid argument $ARGV[0]\n";          warn "Invalid argument $ARGV[0]\n";
53      }      }
54      shift @ARGV;      shift @ARGV;
# Line 126  Line 128 
128    
129  foreach $peg (@pegs)  foreach $peg (@pegs)
130  {  {
131        my $tmp = $peg;
132      if ($peg =~ /^fig\|\d+\.\d+\.peg\.\d+$/)      if ($peg =~ /^fig\|\d+\.\d+\.peg\.\d+$/)
133      {      {
134          $genome = $fig->genome_of($peg);          $genome = $fig->genome_of($peg);
# Line 142  Line 145 
145          $peg = $1;          $peg = $1;
146          $genome = $2;          $genome = $2;
147          $loc = $3;          $loc = $3;
148            ($peg && $genome && $loc) || confess "could not parse \'$tmp\'";
149        }
150        else {
151            confess "Could not parse \'$peg\'";
152      }      }
   
     ($genome && $loc) || confess $peg;  
153    
154      my $lnC = $fig->contig_ln($genome,$contig);      my $lnC = $fig->contig_ln($genome,$contig);
155      ($contig,$begin,$end) = $fig->boundaries_of($loc);      ($contig,$begin,$end) = $fig->boundaries_of($loc);
# Line 170  Line 175 
175    
176      if (! $seq)      if (! $seq)
177      {      {
178          print STDERR &Dumper($peg,$loc,$seq); die "could not get sequence for $peg";          confess "could not get sequence for fid=$peg, loc=$loc;\n   seq=\'$seq\'";
179      }      }
180    
181  #   The following hack handles uncertainty about whether SEED gives back the STOP or not  #   The following hack handles uncertainty about whether SEED gives back the STOP or not

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3