NAME
Bio::Grep::SearchResult - Data structure for a back-end search hit
SYNOPSIS
# output the search results with nice alignments
while ( my $res = $sbe->next_res ) {
# $res->sequence is a Bio::Seq object with down-/upstream regions
# see Bio::Grep::SearchSettings
print $res->sequence->id . "\n";
# $res->subject is a Bio::Seq object without down-/upstream regions
print $res->subject->seq . "\n";
# print down-/upstream regions lower case, subject sequence uppercase
print $res->mark_subject_uppercase() . "\n";
# output alignment
print $res->alignment_string() . "\n";
# print coordinates: perldoc Bio::SimpleAlign, Bio::LocatableSeq
$print $res->alignment->get_seq_by_pos(1)->start . "\n\n";
}
DESCRIPTION
Bio::Grep::SearchResult is the data structure for one hit in the database.
METHODS
new(sequence, begin, end, alignment, sequence_id, remark)
;-
This function constructs a Bio::Grep::SearchResult object. Only called by the back-end parser.
sequence()
-
Get/set the sequence found in database. Bio::Seq object.
subject()
-
Get the sequence found in database as string without upstream and downstream regions. Bio::Seq object.
query()
-
Get the query as Bio::Seq object. Useful for multiple queries.
alignment()
-
Get/set the alignment of the match. See Bio::SimpleAlign for details. There are powerful modules for converting this module in many formats. See Bio::AlignIO for details.
sequence_id()
-
Getter/Setter for sequence ID in database. This is an internal ID of the back-end, not any ID of some annotation in the sequence name. The internal ID can be used in the back-end function get_sequences (Bio::Grep::Backend::BackendI).
begin()
-
Get/set the position of the beginning of the subject in the sequence. This allows retrieving upstream regions from the back-end. First position is 0.
my $seq = $res->sequence->seq; my $upstream = substr $seq, 0, $res->begin; my $subject = substr $seq, $res->begin, $res->end - $res->begin; my $downstream = substr $seq, $res->end;
Note that
$res->begin
differs from$sbe->settings->upstream
if the available upstream region is smaller than requested! end()
-
Get/set the position of the end of the subject in the sequence. This allows retrieving downstream regions from the back-end. See
begin()
. dG()
-
Get/set dG . See Bio::Grep::RNA::HybridizationI for details.
remark()
-
Get/set some additional informations like filter results to this hit.
evalue()
-
Get/set the evalue of this hit.
percent_identity()
-
Get/set the identity in percent of this hit.
OBJECT FORMATTER
Some predefined methods for printing objects.
mark_subject_uppercase()
-
This function returns the sequence in a string. the substring from
$self->begin
to$self->end
will be in uppercase, the rest in lowercase. alignment_string()
-
This function returns a string with the formated alignment. We use CLUSTALW Format without many blank lines and CLUSTAL header. In some back-ends like Agrep, this function will return an empty string if
no_alignments
is true.
SEE ALSO
Bio::SimpleAlign Bio::LocatableSeq Bio::AlignIO Bio::Seq Bio::SeqIO Bio::Grep::Backend::BackendI
AUTHOR
Markus Riester, <mriester@gmx.de>
LICENCE AND COPYRIGHT
Based on Weigel::Search 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.