---
name: "Bio::Search::Iteration::GenericIteration"
section: "3pm"
platform: "linux"
package: "libbio-perl-perl"
version: "1.7.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Bio::Search::Iteration::GenericIteration"
---

# Bio::Search::Iteration::GenericIteration(3pm)

A generic implementation of the Bio::Search::Iteration::IterationI interface.

## NAME

Bio::Search::Iteration::GenericIteration - A generic implementation of the Bio::Search::Iteration::IterationI interface.

## SYNOPSIS

```
    use Bio::Search::Iteration::GenericIteration;
    my $it = Bio::Search::GenericIteration->new(
                              -number => 1,
                              -converged => 0,
                              -newhits_unclassified => [@newhits_unclass],
                              -newhits_below => [@newhits_below_threshold],
                              -newhits_not_below => [@newhits_not_below_threshold],
                              -oldhits_below => [@oldhits_below_threshold],
                              -oldhits_newly_below => [@oldhits_newly_below_threshold],
                              -oldhits_not_below => [@oldhits_not_below_threshold],
                                        );
```

\# TODO: Describe how to configure a SearchIO stream so that it generates #       GenericIteration objects.

## DESCRIPTION

This module acts as a container for Bio::Search::Hit::HitI objects, allowing a Search::Result::ResultI object to partition its hits based on which iteration the hit occurred in (e.g., a PSI-BLAST round).

Unless you're writing a parser, you won't ever need to create a GenericIteration or any other IterationI-implementing object. If you use the SearchIO system, IterationI objects are created automatically from a SearchIO stream which returns Bio::Search::Result::ResultI objects and you get the IterationI objects via the ResultI API.

For documentation on what you can do with GenericIteration (and other IterationI objects), please see the API documentation in Bio::Search::Iteration::IterationI.

Bio::Search::Iteration::GenericIteration is similar in spirit to the deprecated Bio::Tools::BPlite::Iteration modules in bioperl releases prior to 1.6, except that Bio::Search::Iteration::GenericIteration is a pure container, without any parsing functionality as is in Bio::Tools::BPlite::Iteration.

## FEEDBACK

### Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list.  Your participation is much appreciated.

```
  bioperl-l@bioperl.org                  - General discussion
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
```

### Support

Please direct usage questions or support issues to the mailing list:

*bioperl-l@bioperl.org*

rather than to the module maintainer directly. Many experienced and  reponsive experts will be able look at the problem and quickly  address it. Please include a thorough description of the problem  with code and data examples if at all possible.

### Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web:

```
  https://github.com/bioperl/bioperl-live/issues
```

## AUTHOR - Steve Chervitz

Email sac@bioperl.org

## APPENDIX

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a \_

### new

```
 Title   : new
 Usage   : my $obj = Bio::Search::Iteration->new(%args);
 Function: Builds a new Bio::Search::Iteration object
 Returns : Bio::Search::Iteration::GenericIteration object
 Args    : -number => integer for the number of this iteration (required)
           -converged => boolean value whether or not the iteration converged
           -newhits_unclassified => array reference to hits that were not found
                       in a previous iteration for the iteration and have not been
                       classified with regard to the inclusion threshold
           # The following are only used for PSI-BLAST reports:
           -newhits_below => array reference to hits were not found in a
                        previous iteration and are below the inclusion threshold.
           -newhits_not_below => array reference to hits that were not found in a
                        previous iteration below threshold that and are not below
                        the inclusion threshold threshold.
           -oldhits_below => array reference to hits that were found
                        in a previous iteration below inclusion threshold and are
                        still below threshold in the current iteration.
           -oldhits_newly_below => array reference to hits that were found
                        in a previous iteration above threshold but are below
                        threshold in the current iteration.
           -oldhits_not_below => array reference to hits that were found in a
                        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
```

### number

See documentation in Bio::Search::Iteration::IterationI.

### converged

See documentation in Bio::Search::Iteration::IterationI.

### 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
```

### next\_hit

This iterates through all old hits as returned by oldhits  followed by all new hits as returned by newhits.

For more documentation see **Bio::Search::Iteration::IterationI::next\_hit()**.

### next\_hit\_new

See documentation in **Bio::Search::Iteration::IterationI::next\_hit\_new()**.

### next\_hit\_old

See documentation in **Bio::Search::Iteration::IterationI::next\_hit\_old()**.

### rewind

```
 Title   : rewind
 Usage   : $iteration->rewind;
 Function: Allow one to reset the Hit iterators to the beginning
           Since this is an in-memory implementation
 Returns : none
 Args    : none
```

### num\_hits

See documentation in **Bio::Search::Iteration::IterationI::num\_hits()**.

### num\_hits\_new

See documentation in **Bio::Search::Iteration::IterationI::num\_hits\_new()**.

### num\_hits\_old

See documentation in **Bio::Search::Iteration::IterationI::num\_hits\_old()**.

### add\_hit

See documentation in **Bio::Search::Iteration::IterationI::add\_hit()**.

### hits

See Documentation in InterfaceI.

### newhits

Returns a list containing all newhits in this order:

newhits\_below\_threshold newhits\_not\_below\_threshold newhits\_unclassified

See more documentation in InterfaceI.

### newhits\_below\_threshold

See documentation in **Bio::Search::Iteration::IterationI::newhits\_below\_threshold()**.

### newhits\_not\_below\_threshold

See documentation in **Bio::Search::Iteration::IterationI::newhits\_not\_below\_threshold()**.

### newhits\_unclassified

```
 Title   : newhits_unclassified
 Usage   : foreach( $iteration->hits_unclassified ) {...}
 Function: Gets all newhits that have not been partitioned into
           sets relative to the inclusion threshold.
 Returns : Array of Bio::Search::Hit::HitI objects.
 Args    : none
```

### oldhits

Returns a list containing all oldhits in this order:

oldhits\_below\_threshold oldhits\_newly\_below\_threshold oldhits\_not\_below\_threshold

See more documentation in InterfaceI.

### oldhits\_below\_threshold

See documentation in **Bio::Search::Iteration::IterationI::oldhits\_below\_threshold()**.

### oldhits\_newly\_below\_threshold

See documentation in **Bio::Search::Iteration::IterationI::oldhits\_newly\_below\_threshold()**.

### oldhits\_not\_below\_threshold

See documentation in **Bio::Search::Iteration::IterationI::oldhits\_not\_below\_threshold()**.

### hits\_below\_threshold

See documentation in **Bio::Search::Iteration::IterationI::hits\_below\_threshold()**.

### get\_hit

See documentation in **Bio::Search::Iteration::IterationI::get\_hit()**.

To free up the memory used by the **get\_hit()** functionality, call **free\_hit\_lookup()**.

This functionality might be useful at the Result level, too. **BlastResult::get\_hit()** would return a list of HitI objects for hits  that occur in multiple iterations.

### free\_hit\_lookup

```
 Purpose : Frees up the memory used by the get_hit() functionality.
           For the memory-conscious.
```
