[Bio] / Sprout / BBHCheck.pl Repository:
ViewVC logotype

Diff of /Sprout/BBHCheck.pl

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

revision 1.4, Mon Aug 14 22:53:24 2006 UTC revision 1.6, Tue Feb 5 05:47:32 2008 UTC
# Line 20  Line 20 
20  as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,  as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,
21  where I<User> is the value of the B<user> option above.  where I<User> is the value of the B<user> option above.
22    
 =item fig  
   
 Check the SEED for genomes that have no BBHs in Sprout.  
   
23  =item sql  =item sql
24    
25  If specified, turns on tracing of SQL activity.  If specified, turns on tracing of SQL activity.
# Line 49  Line 45 
45    
46  use strict;  use strict;
47  use Tracer;  use Tracer;
 use DocUtils;  
 use TestUtils;  
48  use Cwd;  use Cwd;
49  use File::Copy;  use File::Copy;
50  use File::Path;  use File::Path;
51  use FIG;  use FIG;
52  use Sprout;  use Sprout;
53  use SFXlate;  use SFXlate;
54    use FIGRules;
55    
56  # Get the command-line options and parameters.  # Get the command-line options and parameters.
57  my ($options, @parameters) = StandardSetup([qw(Sprout) ],  my ($options, @parameters) = StandardSetup([qw(Sprout) ],
# Line 88  Line 83 
83      for my $name (sort keys %genomeNames) {      for my $name (sort keys %genomeNames) {
84          my $genome = $genomeNames{$name};          my $genome = $genomeNames{$name};
85          # Count this genome's BBHs.          # Count this genome's BBHs.
86          my $count = $sprout->GetCount(['IsBidirectionalBestHitOf', 'HasFeature', 'Genome'],          my $count = FIGRules::BatchBBHs("fig|$genome.%", 1e-10);
                                       "HasFeature(from-link) = ?", [$genome]);  
87          # Get the genome name.          # Get the genome name.
88          my $name = $sprout->GenusSpecies($genome) . " [$genome]";          my $name = $sprout->GenusSpecies($genome) . " [$genome]";
89          # A count of 0 is bad.          # A count of 0 is bad.
90          if ($count) {          if (! $count) {
             Trace("$name BBH count is $count.") if T(3);  
         } else {  
             if ($options->{fig}) {  
                 # Check to see if the SEED is bad, too.  
                 my @fids = $fig->all_features($genome);  
                 my $seedCount = 0;  
                 for my $fid (@fids) {  
                     my @bbhs = $fig->bbhs($fid);  
                     $seedCount += scalar @bbhs;  
                 }  
                 if ($seedCount == 0) {  
                     # Here there are no BBHs anywhere.  
                     Trace("$name has no BBHs in SEED or Sprout. ***") if T(1);  
                 } else {  
                     # Here we can fix the problem by reloading the Sprout.  
                     Trace("$name has no BBHs in Sprout but $seedCount in SEED.") if T(1);  
                 }  
             } else {  
                 # Here we don't care about the SEED.  
91                  Trace("$name has no BBHs. ***") if T(1);                  Trace("$name has no BBHs. ***") if T(1);
             }  
92              $badGenomes++;              $badGenomes++;
93            } else {
94                Trace("$name BBH count is $count.") if T(3);
95          }          }
96      }      }
97      # Tell the user how bad things are.      # Tell the user how bad things are.

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3