[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.5, Wed Feb 21 13:16:59 2007 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 57  Line 53 
53  use FIG;  use FIG;
54  use Sprout;  use Sprout;
55  use SFXlate;  use SFXlate;
56    use FIGRules;
57    
58  # Get the command-line options and parameters.  # Get the command-line options and parameters.
59  my ($options, @parameters) = StandardSetup([qw(Sprout) ],  my ($options, @parameters) = StandardSetup([qw(Sprout) ],
# Line 88  Line 85 
85      for my $name (sort keys %genomeNames) {      for my $name (sort keys %genomeNames) {
86          my $genome = $genomeNames{$name};          my $genome = $genomeNames{$name};
87          # Count this genome's BBHs.          # Count this genome's BBHs.
88          my $count = $sprout->GetCount(['IsBidirectionalBestHitOf', 'HasFeature', 'Genome'],          my $count = FIGRules::BatchBBHs("fig|$genome.%", 1e-10);
                                       "HasFeature(from-link) = ?", [$genome]);  
89          # Get the genome name.          # Get the genome name.
90          my $name = $sprout->GenusSpecies($genome) . " [$genome]";          my $name = $sprout->GenusSpecies($genome) . " [$genome]";
91          # A count of 0 is bad.          # A count of 0 is bad.
92          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.  
93                  Trace("$name has no BBHs. ***") if T(1);                  Trace("$name has no BBHs. ***") if T(1);
             }  
94              $badGenomes++;              $badGenomes++;
95            } else {
96                Trace("$name BBH count is $count.") if T(3);
97          }          }
98      }      }
99      # 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.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3