[Bioperl-guts-l] bioperl-live/Bio/Tools EUtilities.pm,1.1,1.2

Christopher John Fields cjfields at dev.open-bio.org
Sun Jun 24 23:43:31 EDT 2007


Update of /home/repository/bioperl/bioperl-live/Bio/Tools
In directory dev.open-bio.org:/tmp/cvs-serv11600

Modified Files:
	EUtilities.pm 
Log Message:
Cleaning up API, need to clean up POD and make callbacks more consistent

Index: EUtilities.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Tools/EUtilities.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** EUtilities.pm	23 Jun 2007 04:43:04 -0000	1.1
--- EUtilities.pm	25 Jun 2007 03:43:29 -0000	1.2
***************
*** 35,49 ****
      @ids = $parser->get_ids(); # returns array or array ref of IDs
  
!   # esearch, egquery
    
      $term = $parser->get_term(); # returns array or array ref of IDs
    
!   # elink, egquery
    
      $db = $parser->get_database(); # returns database
    
!   # Other methods are focused into four subclasses:
!   
!   # Bio::Tools::EUtilities::Query (esearch, egquery, espell data)
    # eutil data centered on use of search terms
      
--- 35,47 ----
      @ids = $parser->get_ids(); # returns array or array ref of IDs
  
!   # egquery, espell
    
      $term = $parser->get_term(); # returns array or array ref of IDs
    
!   # elink, einfo
    
      $db = $parser->get_database(); # returns database
    
!   # Query-related methods (esearch, egquery, espell data)
    # eutil data centered on use of search terms
      
***************
*** 57,61 ****
      }
    
!   # Bio::Tools::EUtilities::Info (einfo data)
    # database-related information
    
--- 55,59 ----
      }
    
!   # Info-related methods (einfo data)
    # database-related information
    
***************
*** 65,72 ****
      my $ct = $parser->get_record_count;
    
!     while (my $field = $parser->next_InfoField) {...}
!     while (my $field = $parser->next_InfoLink) {...}
    
!   # Bio::Tools::EUtilities::History (epost data)
    # data which enables one to retrieve and query against user-stored information on the NCBI server
    
--- 63,70 ----
      my $ct = $parser->get_record_count;
    
!     while (my $field = $parser->next_FieldInfo) {...}
!     while (my $field = $parser->next_LinkInfo) {...}
    
!   # History methods (epost data, some data returned from elink)
    # data which enables one to retrieve and query against user-stored information on the NCBI server
    
***************
*** 148,152 ****
  use warnings;
  
! use base qw(Bio::Root::Root);
  
  use XML::Simple;
--- 146,150 ----
  use warnings;
  
! use base qw(Bio::Root::Root Bio::Tools::EUtilities::HistoryI);
  
  use XML::Simple;
***************
*** 323,326 ****
--- 321,326 ----
   Returns  : value eval'ing to TRUE or FALSE
   Args     : none (set within parser)
+  Note     : mainly internal method (set in case user wants to check
+             whether particular data was parsed out.
  
  =cut
***************
*** 330,333 ****
--- 330,343 ----
  }
  
+ =head2 data_parsed
+ 
+  Title    : parse_data
+  Usage    : $parser->parse_data
+  Function : direct call to parse data; normally implicitly called
+  Returns  : none
+  Args     : none
+ 
+ =cut
+ 
  {
  my %EUTIL_DATA = (
***************
*** 377,380 ****
--- 387,391 ----
          chomp($err_warn);
          $self->warn("NCBI $eutil Errors/Warnings:\n".$err_warn)
+         # don't return as some data may still be usefule
      }
      delete $self->{'_response'} unless $self->cache_response;
***************
*** 384,387 ****
--- 395,1121 ----
  }
  
+ =head1 Bio::Tools::EUtilities::EUtilDataI methods
+ 
+ =head2 eutil
+ 
+  Title    : eutil
+  Usage    : $eutil->$foo->eutil
+  Function : Get/Set eutil
+  Returns  : string
+  Args     : string (eutil)
+  Throws   : on invalid eutil
+  
+ =cut
+ 
+ =head2 datatype
+ 
+  Title    : datatype
+  Usage    : $type = $foo->datatype;
+  Function : Get/Set data object type
+  Returns  : string
+  Args     : string
+ 
+ =cut
+ 
+ =head1 Bio::Tools::EUtilities::HistoryI methods
+ 
+ These are defined in the HistoryI interface
+ 
+ =head2 history
+ 
+  Title    : history
+  Usage    : my ($webenv, $qk) = $hist->history
+  Function : returns two-element list of webenv() and query_key()
+  Returns  : array
+  Args     : none
+ 
+ =cut
+ 
+ =head2 get_webenv
+ 
+  Title    : get_webenv
+  Usage    : my $webenv = $hist->get_webenv
+  Function : returns web environment key needed to retrieve results from
+             NCBI server
+  Returns  : string (encoded key)
+  Args     : none
+ 
+ =cut
+ 
+ =head2 get_query_key
+ 
+  Title    : get_query_key
+  Usage    : my $qk = $hist->get_query_key
+  Function : returns query key (integer) for the history number for this session
+  Returns  : integer
+  Args     : none
+ 
+ =cut
+ 
+ =head2 has_history
+ 
+  Title    : has_history
+  Usage    : if ($hist->has_history) {...}
+  Function : returns TRUE if full history (webenv, query_key) is present 
+  Returns  : BOOLEAN, value eval'ing to TRUE or FALUE
+  Args     : none
+ 
+ =cut
+ 
+ =head1 Methods used in multiple EUtilities
+ 
+ These will normally be implemented in the individual modules when needed.
+ 
+ =head2 get_ids
+ 
+  Title    : get_ids
+  Usage    : my @ids = $parser->get_ids
+  Function : returns array or array ref of requestes IDs
+  Returns  : array or array ref (based on wantarray)
+  Args     : [conditional] not required except when running elink queries against
+             multiple databases. In case of the latter, the database name is
+             optional (but recommended) when retrieving IDs as the ID list will
+             be globbed together. If a db name isn't provided a warning is issued
+             as a reminder.
+ 
+ =cut
+ 
+ sub get_ids {
+     my ($self, $request) = @_;
+     $self->parse_data unless $self->data_parsed;
+     my $eutil = $self->eutil;
+     if ($eutil eq 'esearch') {
+         return wantarray && $self->{'_id'} ? @{ $self->{'_id'} } : $self->{'_id'} ;
+     } elsif ($eutil eq 'elink')  {
+         my @ids;
+         if ($request) {
+             if (ref $request eq 'CODE') {
+                 push @ids, map {$_->get_ids }
+                     grep { $request->($_) } $self->get_LinkSets;
+             } else {
+                 push @ids, map {$_->get_ids }
+                     grep {$_->get_dbto eq $request} $self->get_LinkSets;
+             }
+         } else {
+             $self->warn('Multiple database present, IDs will be globbed together')
+                 if $self->get_linked_databases > 1;
+             push @ids, map {$_->get_ids } $self->get_LinkSets;
+         }
+         return wantarray ? @ids : \@ids;
+     } elsif ($eutil eq 'esummary') {
+         unless (exists $self->{'_id'}) {
+             push @{$self->{'_id'}}, map {$_->get_id } $self->get_DocSums;
+         }
+         return wantarray ? @{$self->{'_id'}} : $self->{'_id'};        
+     } 
+ }
+ 
+ =head2 get_database
+ 
+  Title    : get_database
+  Usage    : my $db = $info->get_database;
+  Function : returns database name (eutil-compatible)
+  Returns  : string
+  Args     : none
+  Note     : implemented for einfo and espell
+  
+ =cut
+ 
+ sub get_database {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     if ($self->eutil eq 'einfo') {
+         return $self->{'_dbname'};
+     } else {
+         return $self->{'_database'};
+     }
+ }
+ 
+ =head2 get_db (alias for get_database)
+ 
+ =cut
+ 
+ sub get_db {
+     return shift->get_database;
+ }
+ 
+ =head1 Bio::Tools::EUtilities::Query-related methods
+ 
+ =head2 get_count
+ 
+  Title    : get_count
+  Usage    : my $ct = $parser->get_count
+  Function : returns the count (hits for a search)
+  Returns  : integer
+  Args     : [CONDITIONAL] string with database name - used to retrieve
+             count from specific database when using egquery
+ 
+ =cut
+ 
+ sub get_count {
+     my ($self, $db) = @_;
+     $self->parse_data unless $self->data_parsed;
+     # egquery
+     if ($self->datatype eq 'multidbquery') {
+         if (!$db) {
+             $self->warn('Must specify database to get count from');
+             return;
+         }
+         my ($gq) = grep {$_->get_database eq $db} $self->get_GlobalQueries;
+         $gq && return $gq->get_count;
+         $self->warn("Unknown database $db");
+         return;
+     } else {
+         return $self->{'_count'};
+     }
+ }
+ 
+ =head2 get_queried_databases
+ 
+  Title    : get_queried_databases
+  Usage    : my @dbs = $parser->get_queried_databases
+  Function : returns list of databases searched with global query
+  Returns  : array of strings
+  Args     : none
+  Note     : predominately used for egquery; if used with other eutils will
+             return a list with the single database
+ 
+ =cut
+ 
+ sub get_queried_databases {
+     my ($self, $db) = @_;
+     $self->parse_data unless $self->data_parsed;
+     # egquery
+     my @dbs = ($self->datatype eq 'multidbquery') ?
+         map {$_->get_database} $self->get_GlobalQueries :
+         $self->get_database;
+     return @dbs;
+ }
+ 
+ =head2 get_term
+ 
+  Title   : get_term
+  Usage   : $st = $qd->get_term;
+  Function: retrieve the term for the global search
+  Returns : string
+  Args    : none
+ 
+ =cut
+ 
+ # egquery and espell
+ 
+ sub get_term {
+     my ($self, @args) = @_;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_term'};
+ }
+ 
+ =head2 get_translation_from
+ 
+  Title   : get_translation_from
+  Usage   : $string = $qd->get_translation_from();
+  Function: portion of the original query replaced with translated_to()
+  Returns : string
+  Args    : none
+ 
+ =cut
+ 
+ # esearch
+ 
+ sub get_translation_from {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_translation'}->{From};
+ }
+ 
+ =head2 get_translation_to
+ 
+  Title   : get_translation_to
+  Usage   : $string = $qd->get_translation_to();
+  Function: replaced string used in place of the original query term in translation_from()
+  Returns : string
+  Args    : none
+ 
+ =cut
+ 
+ sub get_translation_to {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_translation'}->{To};
+ }
+ 
+ =head2 get_retstart
+ 
+  Title   : get_retstart
+  Usage   : $start = $qd->get_retstart();
+  Function: retstart setting for the query (either set or NCBI default)
+  Returns : Integer
+  Args    : none
+ 
+ =cut
+ 
+ sub get_retstart {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;    
+     return $self->{'_retstart'};
+ }
+ 
+ =head2 get_retmax
+ 
+  Title   : get_retmax
+  Usage   : $max = $qd->get_retmax();
+  Function: retmax setting for the query (either set or NCBI default)
+  Returns : Integer
+  Args    : none
+ 
+ =cut
+ 
+ sub get_retmax {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;    
+     return $self->{'_retmax'};
+ }
+ 
+ =head2 get_query_translation
+ 
+  Title   : get_query_translation
+  Usage   : $string = $qd->get_query_translation();
+  Function: returns the translated query used for the search (if any)
+  Returns : string
+  Args    : none
+  Note    : this differs from the original term.
+ 
+ =cut
+ 
+ sub get_query_translation {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_querytranslation'};
+ }
+ 
+ =head2 get_corrected_query
+ 
+  Title    : get_corrected_query
+  Usage    : my $cor = $eutil->get_corrected_query;
+  Function : retrieves the corrected query when using espell
+  Returns  : string 
+  Args     : none
+ 
+ =cut
+ 
+ sub get_corrected_query {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_correctedquery'};
+ }
+ 
+ =head2 get_replaced_terms
+ 
+  Title    : get_replaced_terms
+  Usage    : my $term = $eutil->get_replaced_term
+  Function : returns array of strings replaced in the query
+  Returns  : string 
+  Args     : none
+ 
+ =cut
+ 
+ sub get_replaced_terms {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     if ($self->{'_spelledquery'} && $self->{'_spelledquery'}->{Replaced}) {
+         ref $self->{'_spelledquery'}->{Replaced} ?
+         return @{ $self->{'_spelledquery'}->{Replaced} } : return;
+     }
+ }
+ 
+ =head2 next_GlobalQuery
+ 
+  Title    : next_GlobalQuery
+  Usage    : while (my $query = $eutil->next_GlobalQuery) {...}
+  Function : iterates through the queries returned from an egquery search
+  Returns  : GlobalQuery object
+  Args     : none
+ 
+ =cut
+ 
+ sub next_GlobalQuery {
+     my $self = shift;
+     unless ($self->{'_globalqueries_it'}) {
+         my $qcount = $self->get_GlobalQueries;
+         my $current = 0;
+         $self->{"_globalqueries_it"} = sub {
+             return $self->{'_globalqueries'}->[$current++]
+         }
+     }    
+     $self->{'_globalqueries_it'}->();
+ }
+ 
+ =head2 get_GlobalQueries
+ 
+  Title    : get_GlobalQueries
+  Usage    : @queries = $eutil->get_GlobalQueries
+  Function : returns list of GlobalQuery objects
+  Returns  : array of GlobalQuery objects
+  Args     : none
+ 
+ =cut
+ 
+ sub get_GlobalQueries {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     ref $self->{'_globalqueries'} ? return @{ $self->{'_globalqueries'} } : return ();
+ }
+ 
+ =head2 next_DocSum
+ 
+  Title    : next_DocSum
+  Usage    : while (my $ds = $esum->next_DocSum) {...}
+  Function : iterate through DocSum instances
+  Returns  : single Bio::Tools::EUtilities::Summary::DocSum
+  Args     : none yet
+ 
+ =cut
+ 
+ # add an option (?) for lazy parsing via fh (which allows tempfile or piping)
+ # add data to Simple object in chunks, create DocSum, return
+ 
+ # maybe allow callback to only return interesting DocSums?
+ 
+ sub next_DocSum {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     unless ($self->{"_docsums_it"}) {
+         my @docsums = $self->get_DocSums;
+         $self->{"_docsums_it"} = sub {return shift @docsums}
+     }
+     $self->{'_docsums_it'}->();
+ }
+ 
+ =head2 get_DocSums
+ 
+  Title    : get_DocSums
+  Usage    : my @docsums = $esum->get_DocSums
+  Function : retrieve a list of DocSum instances
+  Returns  : array of Bio::Tools::EUtilities::Summary::DocSum
+  Args     : none
+ 
+ =cut
+ 
+ sub get_DocSums {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     # always return a list for consistency...
+     return ref $self->{'_docsums'} ? @{ $self->{'_docsums'} } : return ();
+ }
+ 
+ =head1 Bio::Tools::EUtilities::Info-related methods
+ 
+ =head2 get_available_databases
+ 
+  Title    : get_available_databases
+  Usage    : my @dbs = $info->get_available_databases
+  Function : returns list of available eutil-compatible database names
+  Returns  : Array of strings 
+  Args     : none
+ 
+ =cut
+ 
+ sub get_available_databases {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     ($self->{'_available_databases'}) ?
+         return @{($self->{'_available_databases'})} :
+         return ();
+ }
+ 
+ =head2 get_record_count
+ 
+  Title    : get_record_count
+  Usage    : my $ct = $eutil->get_record_count;
+  Function : returns database record count
+  Returns  : integer
+  Args     : none
+ 
+ =cut
+ 
+ sub get_record_count {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_count'}
+ }
+ 
+ =head2 get_last_update
+ 
+  Title    : get_last_update
+  Usage    : my $time = $info->get_last_update;
+  Function : returns string containing time/date stamp for last database update
+  Returns  : integer
+  Args     : none
+ 
+ =cut
+ 
+ sub get_last_update {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return $self->{'_lastupdate'}
+ }
+ 
+ =head2 get_menu_name
+ 
+  Title    : get_menu_name
+  Usage    : my $nm = $info->get_menu_name;
+  Function : returns string of database menu name
+  Returns  : string
+  Args     : none
+  
+ =cut
+ 
+ sub get_menu_name {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;    
+     exists $self->{'_menuname'} ? return $self->{'_menuname'} :
+     exists $self->{'_menu'} ? return $self->{'_menu'} :
+     return;
+ }
+ 
+ =head2 get_description
+ 
+  Title    : get_description
+  Usage    : my $desc = $info->get_description;
+  Function : returns database description
+  Returns  : string
+  Args     : none
+ 
+ =cut
+ 
+ sub get_description {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;        
+     return $self->{'_description'};
+ }
+ 
+ =head2 next_FieldInfo
+ 
+  Title    : next_FieldInfo
+  Usage    : while (my $field = $info->next_FieldInfo) {...}
+  Function : iterate through FieldInfo objects
+  Returns  : Field object
+  Args     : none
+  Note     : uses callback() for filtering if defined for 'fields'
+  
+ =cut
+ 
+ sub next_FieldInfo {
+     my ($self, $cb) = @_;
+     unless ($self->{'_fieldinfo_it'}) {
+         $self->throw("Callback must be a code reference")
+             if $cb && ref $cb ne 'CODE';
+         my $fieldcount = $self->get_FieldInfo;
+         my $current = 0;
+         $self->{"_fieldinfo_it"} = sub {
+             while ($current < $fieldcount) {
+                 if ($cb) {
+                     $cb->($self->{'_fieldinfo'}->[$current++]) ?
+                     return $self->{'_fieldinfo'}->[$current] :
+                     next;
+                 } else {
+                     return $self->{'_fieldinfo'}->[$current++]
+                 }
+             }
+         }
+     }    
+     $self->{'_fieldinfo_it'}->(); 
+ }
+ 
+ =head2 get_FieldInfo
+ 
+  Title    : get_FieldInfo
+  Usage    : my @fields = $info->get_FieldInfo;
+  Function : returns list of FieldInfo objects
+  Returns  : array (FieldInfo objects)
+  Args     : none
+ 
+ =cut
+ 
+ sub get_FieldInfo {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;        
+     return ref $self->{'_fieldinfo'} ? @{ $self->{'_fieldinfo'} } : return 0;
+ }
+ 
+ *get_FieldInfos = \&get_FieldInfo;
+ 
+ =head2 next_LinkInfo
+ 
+  Title    : next_LinkInfo
+  Usage    : while (my $link = $info->next_LinkInfo) {...}
+  Function : iterate through LinkInfo objects
+  Returns  : LinkInfo object
+  Args     : [OPTIONAL] callback; checks object and returns TRUE if wanted
+  Note     : uses callback() for filtering if defined for 'links'
+  
+ =cut
+ 
+ sub next_LinkInfo {
+     my $self = shift;
+     unless ($self->{'_linkinfo_it'}) {
+         my $cb;
+         $self->throw("Callback must be a code reference")
+             if $cb && ref $cb ne 'CODE';
+         my $linkcount = $self->get_LinkInfo;
+         my $current = 0;
+         $self->{"_linkinfo_it"} = sub {
+             while ($current < $linkcount) {
+                 if ($cb) {
+                     $cb->($self->{'_linkinfo'}->[$current++]) ?
+                     return $self->{'_linkinfo'}->[$current] :
+                     next;
+                 } else {
+                     return $self->{'_linkinfo'}->[$current++]
+                 }
+             }
+         }
+     }    
+     $self->{'_linkinfo_it'}->();    
+ }
+ 
+ =head2 get_LinkInfo
+ 
+  Title    : get_LinkInfo
+  Usage    : my @links = $info->get_LinkInfo;
+  Function : returns list of LinkInfo objects
+  Returns  : array (LinkInfo objects)
+  Args     : none
+ 
+ =cut
+ 
+ sub get_LinkInfo {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;        
+     return ref $self->{'_linkinfo'} ? @{ $self->{'_linkinfo'} } : return 0;
+ }
+ 
+ *get_LinkInfos = \&get_LinkInfo;
+ 
+ =head1 Bio::Tools::EUtilities::Link-related methods
+ 
+ =head2 next_LinkSet
+ 
+  Title    : next_LinkSet
+  Usage    : 
+  Function : 
+  Returns  : 
+  Args     : 
+ 
+ =cut
+ 
+ sub next_LinkSet {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     unless ($self->{"_linksets_it"}) {
+         my @ls = $self->get_LinkSets;
+         $self->{"_linksets_it"} = sub {return shift @ls}
+     }
+     $self->{'_linksets_it'}->();
+ }
+ 
+ =head2 get_LinkSets
+ 
+  Title    : get_LinkSets
+  Usage    : 
+  Function : 
+  Returns  : 
+  Args     : 
+ 
+ =cut
+ 
+ # add support for retrieval of data if lazy parsing is enacted
+ 
+ sub get_LinkSets {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     return ref $self->{'_linksets'} ? @{ $self->{'_linksets'} } : return;
+ }
+ 
+ =head2 get_linked_databases
+ 
+  Title    : get_linked_databases
+  Usage    : my @dbs = $eutil->get_linked_databases
+  Function : returns list of databases linked to in linksets
+  Returns  : array of databases
+  Args     : none
+ 
+ =cut
+ 
+ sub get_linked_databases {
+     my $self = shift;
+     $self->parse_data unless $self->data_parsed;
+     unless (exists $self->{'_db'}) {
+         my %temp;
+         # make sure unique db is returned
+         # do the linksets have a db? (URLs, db checks do not)
+         
+         push @{$self->{'_db'}}, map {$_->get_dbto}
+             grep { $_->get_dbto ? !$temp{$_->get_dbto}++: 0 } $self->get_LinkSets;
+     }
+     return @{$self->{'_db'}};
+ }
+ 
+ =head1 ObeIterator-related m
+ 
+ =cut
+ 
+ =head2 rewind
+ 
+  Title    : rewind
+  Usage    : $esum->rewind()
+             $esum->rewind('recursive')
+  Function : retrieve a list of DocSum instances
+  Returns  : array of Bio::Tools::EUtilities::Summary::DocSum
+  Args     : [optional] Scalar; string ('all') to reset all iterators, or string 
+             describing the specific main object iterator to reset. The following
+             are recognized (case-insensitive):
+             
+             'all' - rewind all objects and also recursively resets nested object interators
+                     (such as LinkSets and DocSums).
+             'globalqueries'
+             'fieldinfo' or 'fieldinfos'
+             'linkinfo' or 'linkinfos'
+             'linksets'
+             'docsums'
+             
+ 
+ =cut
+ 
+ {
+     my %VALID_ITERATORS = (
+         'globalqueries' => 'globalqueries',
+         'fieldinfo' =>  'fieldinfo',
+         'fieldinfos' => 'fieldinfo',
+         'linkinfo' =>  'linkinfo',
+         'linkinfos' => 'linkinfo',
+         'linksets' => 'linksets',
+         'docsums' => 'docsums',
+         );
+ 
+     
+ sub rewind {
+     my ($self, $arg) = ($_[0], lc $_[1]);
+     $arg ||= 'all';
+     if (exists $VALID_ITERATORS{$arg}) {
+         delete $self->{'_'.$arg.'_it'};
+     } elsif ($arg eq 'all') {
+         my $eutil = $self->eutil;
+         for my $it (values %VALID_ITERATORS){
+             delete $self->{'_'.$it.'_it'} if
+                 exists $self->{'_'.$it.'_it'};
+             map {$_->rewind('all')} $self->get_LinkSets;
+             map {$_->rewind('all')} $self->get_DocSums;
+         }
+     }
+ }
+ 
+ }
+ 
  =head2 Private methods
  



More information about the Bioperl-guts-l mailing list