[Bioperl-guts-l] bioperl-live/Bio/Search/Iteration GenericIteration.pm, 1.6, 1.6.4.1

Senduran Balasubramaniam sendu at dev.open-bio.org
Sun Sep 17 13:26:16 EDT 2006


Update of /home/repository/bioperl/bioperl-live/Bio/Search/Iteration
In directory dev.open-bio.org:/tmp/cvs-serv26285/Bio/Search/Iteration

Modified Files:
      Tag: branch-1-5-2
	GenericIteration.pm 
Log Message:
merge Bio::SearchIO speedup from experimental

Index: GenericIteration.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Search/Iteration/GenericIteration.pm,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -C2 -d -r1.6 -r1.6.4.1
*** GenericIteration.pm	4 Jul 2006 22:23:20 -0000	1.6
--- GenericIteration.pm	17 Sep 2006 17:26:14 -0000	1.6.4.1
***************
*** 131,135 ****
                          previous iteration above threshold that and are still above
                          the inclusion threshold threshold.
! 
  =cut
  
--- 131,137 ----
                          previous iteration above threshold that and are still above
                          the inclusion threshold threshold.
!            
!            -hit_factory => Bio::Factory::ObjectFactoryI capable of making
!                         Bio::Search::Hit::HitI objects
  =cut
  
***************
*** 139,143 ****
    my $self = $class->SUPER::new(@args);
    my ($number, $newhits_unclassified, $newhits_below, $newhits_not_below,
!       $oldhits_below, $oldhits_newly_below, $oldhits_not_below, $converged) =
        $self->_rearrange([qw(NUMBER
                              NEWHITS_UNCLASSIFIED
--- 141,146 ----
    my $self = $class->SUPER::new(@args);
    my ($number, $newhits_unclassified, $newhits_below, $newhits_not_below,
!       $oldhits_below, $oldhits_newly_below, $oldhits_not_below, $converged,
!       $h_f) =
        $self->_rearrange([qw(NUMBER
                              NEWHITS_UNCLASSIFIED
***************
*** 148,151 ****
--- 151,155 ----
                              OLDHITS_NOT_BELOW
                              CONVERGED
+                             HIT_FACTORY
                             )], @args);
  
***************
*** 229,233 ****
        $self->{'_oldhits_not_below_threshold'} = [];
    }
! 
    return $self;
  }
--- 233,239 ----
        $self->{'_oldhits_not_below_threshold'} = [];
    }
!   
!   $self->hit_factory($h_f) if $h_f;
!   
    return $self;
  }
***************
*** 267,270 ****
--- 273,292 ----
  
  
+ =head2 hit_factory
+ 
+  Title   : hit_factory
+  Usage   : $hit->hit_factory($hit_factory)
+  Function: Get/set the factory used to build HitI objects if necessary.
+  Returns : Bio::Factory::ObjectFactoryI
+  Args    : Bio::Factory::ObjectFactoryI
+ 
+ =cut
+ 
+ sub hit_factory {
+     my $self = shift;
+     if (@_) { $self->{_hit_factory} = shift }
+     return $self->{_hit_factory} || return;
+ }
+ 
  =head2 next_hit
  
***************
*** 392,396 ****
      my $count = 0;
  
!     unless( $hit->isa('Bio::Search::Hit::HitI') ) { 
          $self->throw(-class=>'Bio::Root::BadParameter',
                       -text=>"Passed in " .ref($hit). 
--- 414,418 ----
      my $count = 0;
  
!     unless( ref($hit) eq 'HASH' || $hit->isa('Bio::Search::Hit::HitI') ) { 
          $self->throw(-class=>'Bio::Root::BadParameter',
                       -text=>"Passed in " .ref($hit). 
***************
*** 472,480 ****
  sub newhits_below_threshold  { 
      my $self = shift;
-     my @hits = ();
      if (ref $self->{'_newhits_below_threshold'} ) {
!         @hits = @{$self->{'_newhits_below_threshold'}};
      }
!     return @hits;
  }
  
--- 494,506 ----
  sub newhits_below_threshold  { 
      my $self = shift;
      if (ref $self->{'_newhits_below_threshold'} ) {
!         my $factory = $self->hit_factory || return @{$self->{'_newhits_below_threshold'}};
!         for (0..$#{$self->{'_newhits_below_threshold'}}) {
!             ref(${$self->{'_newhits_below_threshold'}}[$_]) eq 'HASH' || next;
!             ${$self->{'_newhits_below_threshold'}}[$_] = $factory->create_object(%{${$self->{'_newhits_below_threshold'}}[$_]});
!         }
!         return @{$self->{'_newhits_below_threshold'}};
      }
!     return;
  }
  
***************
*** 487,495 ****
  sub newhits_not_below_threshold  { 
      my $self = shift;
-     my @hits = ();
      if (ref $self->{'_newhits_not_below_threshold'} ) {
!         @hits = @{$self->{'_newhits_not_below_threshold'}};
      }
!     return @hits;
  }
  
--- 513,525 ----
  sub newhits_not_below_threshold  { 
      my $self = shift;
      if (ref $self->{'_newhits_not_below_threshold'} ) {
!         my $factory = $self->hit_factory || return @{$self->{'_newhits_not_below_threshold'}};
!         for (0..$#{$self->{'_newhits_not_below_threshold'}}) {
!             ref(${$self->{'_newhits_not_below_threshold'}}[$_]) eq 'HASH' || next;
!             ${$self->{'_newhits_not_below_threshold'}}[$_] = $factory->create_object(%{${$self->{'_newhits_not_below_threshold'}}[$_]});
!         }
!         return @{$self->{'_newhits_not_below_threshold'}};
      }
!     return;
  }
  
***************
*** 507,515 ****
  sub newhits_unclassified  { 
      my $self = shift;
-     my @hits = ();
      if (ref $self->{'_newhits_unclassified'} ) {
!         @hits = @{$self->{'_newhits_unclassified'}};
      }
!     return @hits;
  }
  
--- 537,549 ----
  sub newhits_unclassified  { 
      my $self = shift;
      if (ref $self->{'_newhits_unclassified'} ) {
!         my $factory = $self->hit_factory || return @{$self->{'_newhits_unclassified'}};
!         for (0..$#{$self->{'_newhits_unclassified'}}) {
!             ref(${$self->{'_newhits_unclassified'}}[$_]) eq 'HASH' || next;
!             ${$self->{'_newhits_unclassified'}}[$_] = $factory->create_object(%{${$self->{'_newhits_unclassified'}}[$_]});
!         }
!         return @{$self->{'_newhits_unclassified'}};
      }
!     return;
  }
  
***************
*** 542,550 ****
  sub oldhits_below_threshold  { 
      my $self = shift;
-     my @hits = ();
      if (ref $self->{'_oldhits_below_threshold'} ) {
!         @hits = @{$self->{'_oldhits_below_threshold'}};
      }
!     return @hits;
  }
  
--- 576,588 ----
  sub oldhits_below_threshold  { 
      my $self = shift;
      if (ref $self->{'_oldhits_below_threshold'} ) {
!         my $factory = $self->hit_factory || return @{$self->{'_oldhits_below_threshold'}};
!         for (0..$#{$self->{'_oldhits_below_threshold'}}) {
!             ref(${$self->{'_oldhits_below_threshold'}}[$_]) eq 'HASH' || next;
!             ${$self->{'_oldhits_below_threshold'}}[$_] = $factory->create_object(%{${$self->{'_oldhits_below_threshold'}}[$_]});
!         }
!         return @{$self->{'_oldhits_below_threshold'}};
      }
!     return;
  }
  
***************
*** 557,565 ****
  sub oldhits_newly_below_threshold  { 
      my $self = shift;
-     my @hits = ();
      if (ref $self->{'_oldhits_newly_below_threshold'} ) {
!         @hits = @{$self->{'_oldhits_newly_below_threshold'}};
      }
!     return @hits;
  }
  
--- 595,607 ----
  sub oldhits_newly_below_threshold  { 
      my $self = shift;
      if (ref $self->{'_oldhits_newly_below_threshold'} ) {
!         my $factory = $self->hit_factory || return @{$self->{'_oldhits_newly_below_threshold'}};
!         for (0..$#{$self->{'_oldhits_newly_below_threshold'}}) {
!             ref(${$self->{'_oldhits_newly_below_threshold'}}[$_]) eq 'HASH' || next;
!             ${$self->{'_oldhits_newly_below_threshold'}}[$_] = $factory->create_object(%{${$self->{'_oldhits_newly_below_threshold'}}[$_]});
!         }
!         return @{$self->{'_oldhits_newly_below_threshold'}};
      }
!     return;
  }
  
***************
*** 572,580 ****
  sub oldhits_not_below_threshold  { 
      my $self = shift;
-     my @hits = ();
      if (ref $self->{'_oldhits_not_below_threshold'} ) {
!         @hits = @{$self->{'_oldhits_not_below_threshold'}};
      }
!     return @hits;
  }
  
--- 614,626 ----
  sub oldhits_not_below_threshold  { 
      my $self = shift;
      if (ref $self->{'_oldhits_not_below_threshold'} ) {
!         my $factory = $self->hit_factory || return @{$self->{'_oldhits_not_below_threshold'}};
!         for (0..$#{$self->{'_oldhits_not_below_threshold'}}) {
!             ref(${$self->{'_oldhits_not_below_threshold'}}[$_]) eq 'HASH' || next;
!             ${$self->{'_oldhits_not_below_threshold'}}[$_] = $factory->create_object(%{${$self->{'_oldhits_not_below_threshold'}}[$_]});
!         }
!         return @{$self->{'_oldhits_not_below_threshold'}};
      }
!     return;
  }
  



More information about the Bioperl-guts-l mailing list