A key motivation for Bio::Tools::SeqPattern is to have a way to generate a reverse complement of a nucleotide sequence pattern. This makes possible simultaneous pattern matching on both sense and anti-sense strands of a query sequence.

In principle, one could do such a search more inefficiently by testing against both sense and anti-sense versions of a sequence. It is entirely equivalent to test a regexp containing both sense and anti-sense versions of the *pattern* against one copy of the sequence. The latter approach is much more efficient since:

1) You need only one copy of the sequence.
2) Only one regexp is executed.
3) Regexp patterns are typically much smaller than sequences.

Patterns can be quite complex and it is often difficult to generate the reverse complement pattern. The Bioperl SeqPattern.pm addresses this problem, providing a convenient set of tools for working with biological sequence regular expressions.

Not all patterns have been tested. If you discover a pattern that is not handled properly by Bio::Tools::SeqPattern.pm, please send me some email (sac@bioperl.org). Thanks.

Ultimately, this module should be able to build SeqPattern.pm objects using a variety of pattern formats such as ProSite, Blocks, Prints, GCG, etc. Currently, this module only supports patterns using a grep-like syntax.

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.

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.

Title : revcom
Usage : revcom([1]);
Purpose : Forms a pattern capable of recognizing the reverse complement
: version of a nucleotide sequence pattern.
Example : $pattern_object->revcom();
: $pattern_object->revcom(1); ## returns expanded rev complement pattern.
Returns : Object reference for a new Bio::Tools::SeqPattern containing
: the revcom of the current pattern as its sequence.
Argument : (1) boolean (optional) (default= false)
: true : expand the pattern before rev-complementing.
: false: don't expand pattern before or after rev-complementing.
Throws : Exception if called for amino acid sequence pattern.
Comments : This method permits the simultaneous searching of both
: sense and anti-sense versions of a nucleotide pattern
: by means of a grep-type of functionality in which any
: number of patterns may be or-ed into the recognition
: pattern.
: Overrides Bio::Seq::revcom() and calls it first thing.
: The order of _fixpat() calls is critical.

Title : backtranslate
Usage : backtranslate();
Purpose : Produce a degenerate oligonucleotide whose translation would produce
: the original protein motif.
Example : $pattern_object->backtranslate();
Returns : Object reference for a new Bio::Tools::SeqPattern containing
: the reverse translation of the current pattern as its sequence.
Throws : Exception if called for nucleotide sequence pattern.

All data members are prefixed with an underscore to signify that they are private. Always use accessor methods. If the accessor doesn't exist or is inadequate, create or modify an accessor (and let me know, too!).