NAME

Bio::Grep::Backends::Hypa - HyPa back-end

SYNOPSIS

  use Bio::Grep::Backends::Hypa;
 
  use Bio::Root::Exception;
  use Error qw(:try);
 
  # construct the Hypa back-end 
  my $sbe = Bio::Grep::Backends::Hypa->new();
 
  $sbe->settings->tmppath('tmp');
  $sbe->settings->datapath('data');
  
  # generate a Hypa suffix array. you have to do this only once.
  $sbe->generate_database_out_of_fastafile('ATH1.cdna', 'AGI Transcripts (- introns, + UTRs)');
 
  my %local_dbs_description = $sbe->get_databases();
  my @local_dbs = sort keys %local_dbs_description;
 
  # take first available database in our test
  $sbe->settings->database($local_dbs[0]);
 
  my $seq = 'UGAACAGAAAGCUCAUGAGCC'; 
 
  # search for the reverse complement and allow 4 mismatches
  # display 5 bases upstream and downstream of the match
  $sbe->settings->query($seq);
  $sbe->settings->reverse_complement(1);
  $sbe->settings->mismatches(4);
  $sbe->settings->upstream(5);
  $sbe->settings->downstream(5);
  
  # hypa does not generate alignments, but EMBOSS will automatically calculate some for
  # you. If things should be fast, turn this off        
  # $sbe->settings->no_alignments(1);
 
  # with the features hash, you can check if the back-end supports
  # a special feature. Allow wobble pairs (GU counts 0 or 0.5)  
  if (defined($sbe->features->{GUMISMATCHES})) {
          $sbe->settings->gumismatches(0.5);            
  } else {
     print "\nBack-end does not support wobble pairs\n";
  }     
 
  $sbe->search();
 
  # output all informations we have!
  while ( my $res = $sbe->next_res ) {
     print $res->sequence->id . "\n";
     print $res->mark_subject_uppercase() . "\n";
     print $res->alignment_string() . "\n\n";
  }
   

DESCRIPTION

Bio::Grep::Backends::Hypa searches for a query in a Hypa suffix array.

NOTE 1: Hypa can not calculate alignments. But because we have the exact position of the match, the alignment calculation shouldn't be too slow (In agrep, we align query and sequence, here query and approximate match).

NOTE 2: -online is available. But it is not recommended.

METHODS

See Bio::Grep::Backends::BackendI for other methods.

Bio::Grep::Backends::Hypa->new()

This function constructs a Hypa back-end object

   my $sbe = Bio::Grep::Backends::Hypa->new();
$sbe->available_sort_modes()

Returns all available sort modes as hash. keys are sort modes, values a short description.

   $sbe->sort('ga');

Available sortmodes in Hypa:

                ga  : 'ascending order of dG'
                gd  : 'descending order of dG'

Note that 'ga' and 'gd' require that search results have dG set. Bio::Grep::RNA ships with filters for free energy calculation. Also note that these two sort options require that we load all results in memory.

BUGS AND LIMITATIONS

Hypa currently does not return the correct downstream and upstream regions if the requested region is larger then available (if hit is near 5' or 3' end).

Hypa does not generate alignments so we use EMBOSS for that. This is slow and produces a lot of IO.

Please report any bugs or feature requests to bug-bio-grep@rt.cpan.org, or through the web interface at http://rt.cpan.org.

SEE ALSO

Bio::Grep::Backends::BackendI Bio::Grep::Container::SearchSettings Bio::SeqIO

AUTHOR

Markus Riester, <mriester@gmx.de>

LICENCE AND COPYRIGHT

Based on Weigel::Seach v0.13

Copyright (C) 2005-2006 by Max Planck Institute for Developmental Biology, Tuebingen.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.