Provided by: libbio-perl-perl_1.7.6-3_all bug


       Bio::Tools::AmpliconSearch - Find amplicons in a template using degenerate PCR primers


          use Bio::PrimarySeq;
          use Bio::Tools::AmpliconSearch;

          my $template = Bio::PrimarySeq->new(
             -seq => 'aaaaaCCCCaaaaaaaaaaTTTTTTaaaaaCCACaaaaaTTTTTTaaaaaaaaaa',
          my $fwd_primer = Bio::PrimarySeq->new(
             -seq => 'CCNC',
          my $rev_primer = Bio::PrimarySeq->new(
             -seq => 'AAAAA',

          my $search = Bio::Tools::AmpliconSearch->new(
             -template   => $template,
             -fwd_primer => $fwd_primer,
             -rev_primer => $rev_primer,

          while (my $amplicon = $search->next_amplicon) {
             print "Found amplicon at position ".$amplicon->start.'..'.$amplicon->end.":\n";
             print $amplicon->seq->seq."\n\n";

          # Now change the template (but you could change the primers instead) and look
          # for amplicons again

          $template = Bio::PrimarySeq->new(
             -seq => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',

          while (my $amplicon = $search->next_amplicon) {
             print "Found amplicon at position ".$amplicon->start.'..'.$amplicon->end.":\n";
             print $amplicon->seq->seq."\n\n";


       Perform an in silico PCR reaction, i.e. search for amplicons in a given template sequence
       using the specified degenerate primer.

       The template sequence is a sequence object, e.g. Bio::Seq, and the primers can be a
       sequence or a Bio::SeqFeature::Primer object and contain ambiguous residues as defined in
       the IUPAC conventions. The primer sequences are converted into regular expressions using
       Bio::Tools::IUPAC and the matching regions of the template sequence, i.e. the amplicons,
       are returned as Bio::Seq::PrimedSeq objects.

       AmpliconSearch will look for amplicons on both strands (forward and reverse- complement)
       of the specified template sequence. If the reverse primer is not provided, an amplicon
       will be returned and span a match of the forward primer to the end of the template.
       Similarly, when no forward primer is given, match from the beginning of the template
       sequence. When several amplicons overlap, only the shortest one to more accurately
       represent the biases of PCR. Future improvements may include modelling the effects of the
       number of PCR cycles or temperature on the PCR products.


       Future improvements may include:

       ·   Allowing a small number of primer mismatches

       ·   Reporting all amplicons, including overlapping ones

       ·   Putting a limit on the length of amplicons, in accordance with the processivity of the
           polymerase used


   Mailing Lists
       User feedback is an integral part of the evolution of this and other Bioperl modules. Send
       your comments and suggestions preferably to one of the Bioperl mailing lists.  Your
       participation is much appreciated.
                  - General discussion  - About the mailing lists

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

       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 the bugs and their
       resolution.  Bug reports can be submitted via the web:


       Florent Angly <>


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

        Title    : new
        Usage    : my $search = Bio::Tools::AmpliconSearch->new( );
        Function : Initialize an amplicon search
        Args     : -template       Sequence object for the template sequence. This object
                                   will be converted to Bio::Seq if needed in since features
                                   (amplicons and primers) will be added to this object.
                   -fwd_primer     A sequence object representing the forward primer
                   -rev_primer     A sequence object representing the reverse primer
                   -primer_file    Read primers from a sequence file. It replaces
                                   -fwd_primer and -rev_primer (optional)
                   -attach_primers Whether or not to attach primers to Amplicon objects. Default: 0 (off)
        Returns  : A Bio::Tools::AmpliconSearch object

        Title    : template
        Usage    : my $template = $search->template;
        Function : Get/set the template sequence. Setting a new template resets any
                   search in progress.
        Args     : Optional Bio::Seq object
        Returns  : A Bio::Seq object

        Title    : fwd_primer
        Usage    : my $primer = $search->fwd_primer;
        Function : Get/set the forward primer. Setting a new forward primer resets any
                   search in progress.
        Args     : Optional sequence object or primer object or '' to match beginning
                   of sequence.
        Returns  : A sequence object or primer object or undef

        Title    : rev_primer
        Usage    : my $primer = $search->rev_primer;
        Function : Get/set the reverse primer. Setting a new reverse primer resets any
                   search in progress.
        Args     : Optional sequence object or primer object or '' to match end of
        Returns  : A sequence object or primer object or undef

        Title    : primer_file
        Usage    : my ($fwd, $rev) = $search->primer_file;
        Function : Get/set a sequence file to read the primer from. The first sequence
                   must be the forward primer, and the second is the optional reverse
                   primer. After reading the file, the primers are set using fwd_primer()
                   and rev_primer() and returned.
        Args     : Sequence file
        Returns  : Array containing forward and reverse primers as sequence objects.

        Title    : attach_primers
        Usage    : my $attached = $search->attach_primers;
        Function : Get/set whether or not to attach primer objects to the amplicon
        Args     : Optional integer (1 for yes, 0 for no)
        Returns  : Integer (1 for yes, 0 for no)

        Title    : next_amplicon
        Usage    : my $amplicon = $search->next_amplicon;
        Function : Get the next amplicon
        Args     : None
        Returns  : A Bio::SeqFeature::Amplicon object

        Title    : annotate_template
        Usage    : my $template = $search->annotate_template;
        Function : Search for all amplicons and attach them to the template.
                   This is equivalent to running:
                      while (my $amplicon = $self->next_amplicon) {
                         # do something
                      my $annotated = $self->template;
        Args     : None
        Returns  : A Bio::Seq object with attached Bio::SeqFeature::Amplicons (and
                   Bio::SeqFeature::Primers if you set -attach_primers to 1).