File Coverage

blib/lib/Bio/FastParsers/Blast/Table/Hsp.pm
Criterion Covered Total %
statement 6 7 85.7
branch n/a
condition n/a
subroutine 2 3 66.6
pod 1 1 100.0
total 9 11 81.8


line stmt bran cond sub pod time code
1             # ABSTRACT: Internal class for tabular BLAST parser
2             $Bio::FastParsers::Blast::Table::Hsp::VERSION = '0.221230';
3             use Moose;
4 7     7   3535 use namespace::autoclean;
  7         17  
  7         49  
5 7     7   43557  
  7         15  
  7         55  
6              
7             # public attributes
8              
9             has $_ => (
10             is => 'ro',
11             isa => 'Str',
12             required => 1,
13             ) for qw(query_id hit_id);
14              
15             has $_ => (
16             is => 'ro',
17             isa => 'Num',
18             required => 1,
19             ) for qw(
20             percent_identity hsp_length mismatches gaps
21             query_from query_to
22             hit_from hit_to
23             query_strand
24             hit_strand
25             query_start query_end
26             hit_start hit_end
27             );
28              
29             has $_ => (
30             is => 'ro',
31             isa => 'Maybe[Num]',
32             required => 1,
33             ) for qw(
34             evalue bit_score
35             );
36              
37              
38              
39             return shift->evalue
40             }
41              
42 0     0 1    
43             __PACKAGE__->meta->make_immutable;
44             1;
45              
46              
47             =pod
48              
49             =head1 NAME
50              
51             Bio::FastParsers::Blast::Table::Hsp - Internal class for tabular BLAST parser
52              
53             =head1 VERSION
54              
55             version 0.221230
56              
57             =head1 SYNOPSIS
58              
59             # see Bio::FastParsers::Blast::Table
60              
61             =head1 DESCRIPTION
62              
63             This class implements a single line of a tabular BLAST report. Such a line
64             does not correspond to a hit but to a High-Scoring-Pair (HSP). All its methods
65             are accessors. Beyond the standard fields found in the BLAST tabular output
66             (e.g., C<hit_id>, C<evalue>), additional methods are available for easier
67             handling of reverse strand coordinates (e.g., C<query_start>, C<hit_strand>).
68              
69             =head1 METHODS
70              
71             =head2 query_id
72              
73             Returns the id of the query sequence.
74              
75             This method does not accept any arguments.
76              
77             =head2 hit_id
78              
79             Returns the id of the hit (or subject) sequence.
80              
81             This method does not accept any arguments.
82              
83             =head2 percent_identity
84              
85             Returns the identity (in percents) of the HSP.
86              
87             This method does not accept any arguments.
88              
89             =head2 hsp_length
90              
91             Returns the length (in nt or aa) of the HSP.
92              
93             This method does not accept any arguments.
94              
95             =head2 mismatches
96              
97             Returns the number of mismatches of the HSP.
98              
99             This method does not accept any arguments.
100              
101             =head2 gaps
102              
103             Returns the number of gaps (or gap openings) of the HSP.
104              
105             This method does not accept any arguments.
106              
107             =head2 query_from
108              
109             Returns the HSP start in query coordinates. The value of C<query_from> is
110             higher than the value of C<query_to> on reverse strands.
111              
112             This method does not accept any arguments.
113              
114             =head2 query_to
115              
116             Returns the HSP end in query coordinates. The value of C<query_to> is lower
117             than the value of C<query_from> on reverse strands.
118              
119             This method does not accept any arguments.
120              
121             =head2 hit_from
122              
123             Returns the HSP start in hit (or subject) coordinates. The value of
124             C<hit_from> is higher than the value of C<hit_to> on reverse strands.
125              
126             This method does not accept any arguments.
127              
128             =head2 hit_to
129              
130             Returns the HSP end in hit (or subject) coordinates. The value of C<hit_to> is
131             lower than the value of C<hit_from> on reverse strands.
132              
133             This method does not accept any arguments.
134              
135             =head2 evalue
136              
137             Returns the E-value (or expect) of the HSP.
138              
139             This method does not accept any arguments.
140              
141             =head2 bit_score
142              
143             Returns the score (in bits) of the HSP.
144              
145             This method does not accept any arguments.
146              
147             =head2 query_strand
148              
149             Returns the strand (+1/-1) of the query in the HSP.
150              
151             This method does not accept any arguments.
152              
153             =head2 hit_strand
154              
155             Returns the strand (+1/-1) of the hit in the HSP.
156              
157             This method does not accept any arguments.
158              
159             =head2 query_start
160              
161             Returns the HSP start in query coordinates. The value of C<query_start> is
162             guaranteed to be lower than the value of C<query_end>.
163              
164             This method does not accept any arguments.
165              
166             =head2 query_end
167              
168             Returns the HSP end in query coordinates. The value of C<query_end> is
169             guaranteed to be higher than the value of C<query_start>.
170              
171             This method does not accept any arguments.
172              
173             =head2 hit_start
174              
175             Returns the HSP start in hit (or subject) coordinates. The value of
176             C<hit_start> is guaranteed to be lower than the value of C<hit_end>.
177              
178             This method does not accept any arguments.
179              
180             =head2 hit_end
181              
182             Returns the HSP end in hit (or subject) coordinates. The value of C<hit_end>
183             is guaranteed to be higher than the value of C<hit_start>.
184              
185             This method does not accept any arguments.
186              
187             =head1 ALIASES
188              
189             =head2 expect
190              
191             Alias for C<evalue> method. For API consistency.
192              
193             =head1 AUTHOR
194              
195             Denis BAURAIN <denis.baurain@uliege.be>
196              
197             =head1 COPYRIGHT AND LICENSE
198              
199             This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN.
200              
201             This is free software; you can redistribute it and/or modify it under
202             the same terms as the Perl 5 programming language system itself.
203              
204             =cut