| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Bio::FastParsers::Hmmer::Standard; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Front-end class for standard HMMER parser |
|
3
|
|
|
|
|
|
|
# CONTRIBUTOR: Arnaud DI FRANCO <arnaud.difranco@gmail.com> |
|
4
|
|
|
|
|
|
|
$Bio::FastParsers::Hmmer::Standard::VERSION = '0.201110'; |
|
5
|
7
|
|
|
7
|
|
55
|
use Moose; |
|
|
7
|
|
|
|
|
17
|
|
|
|
7
|
|
|
|
|
134
|
|
|
6
|
7
|
|
|
7
|
|
50152
|
use namespace::autoclean; |
|
|
7
|
|
|
|
|
384
|
|
|
|
7
|
|
|
|
|
92
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# TODO: check if autodie is actually needed here |
|
9
|
7
|
|
|
7
|
|
777
|
use autodie; |
|
|
7
|
|
|
|
|
15
|
|
|
|
7
|
|
|
|
|
75
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
7
|
|
|
7
|
|
39279
|
use List::AllUtils qw(indexes firstidx mesh); |
|
|
7
|
|
|
|
|
14
|
|
|
|
7
|
|
|
|
|
661
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
extends 'Bio::FastParsers::Base'; |
|
14
|
|
|
|
|
|
|
|
|
15
|
7
|
|
|
7
|
|
48
|
use Bio::FastParsers::Constants qw(:files); |
|
|
7
|
|
|
|
|
14
|
|
|
|
7
|
|
|
|
|
1141
|
|
|
16
|
7
|
|
|
7
|
|
53
|
use aliased 'Bio::FastParsers::Hmmer::Standard::Iteration'; |
|
|
7
|
|
|
|
|
16
|
|
|
|
7
|
|
|
|
|
54
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# public attributes (inherited) |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# private attributes |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has '_iterations' => ( |
|
25
|
|
|
|
|
|
|
traits => ['Array'], |
|
26
|
|
|
|
|
|
|
is => 'ro', |
|
27
|
|
|
|
|
|
|
isa => 'ArrayRef[Bio::FastParsers::Hmmer::Standard::Iteration]', |
|
28
|
|
|
|
|
|
|
writer => '_set_iterations', |
|
29
|
|
|
|
|
|
|
handles => { |
|
30
|
|
|
|
|
|
|
next_iteration => 'shift', |
|
31
|
|
|
|
|
|
|
get_iteration => 'get', |
|
32
|
|
|
|
|
|
|
all_iterations => 'elements', |
|
33
|
|
|
|
|
|
|
count_iterations => 'count', |
|
34
|
|
|
|
|
|
|
}, |
|
35
|
|
|
|
|
|
|
); |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub BUILD { |
|
38
|
9
|
|
|
9
|
0
|
20
|
my $self = shift; |
|
39
|
|
|
|
|
|
|
|
|
40
|
9
|
|
|
|
|
664
|
my $content = $self->file->slurp; # includes autodie |
|
41
|
9
|
|
|
|
|
15128
|
my @iter_blocks = $content =~ m{ ( ^Query: .+? ^//$ ) }xmsg; |
|
42
|
9
|
|
|
|
|
35
|
my @iterations = map { Iteration->new($_) } @iter_blocks; |
|
|
10
|
|
|
|
|
484
|
|
|
43
|
9
|
|
|
|
|
377
|
$self->_set_iterations( \@iterations ); |
|
44
|
|
|
|
|
|
|
|
|
45
|
9
|
|
|
|
|
315
|
return; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# aliases |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub next_query { |
|
52
|
0
|
|
|
0
|
0
|
|
return shift->next_iteration; |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub get_query { ## no critic (RequireArgUnpacking) |
|
56
|
0
|
|
|
0
|
0
|
|
return shift->get_iteration(@_); |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub all_queries { |
|
60
|
0
|
|
|
0
|
0
|
|
return shift->all_iterations; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub count_queries { |
|
64
|
0
|
|
|
0
|
0
|
|
return shift->count_iterations; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# TODO: improve documentation of HMMER methods |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
70
|
|
|
|
|
|
|
1; |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=pod |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 NAME |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Bio::FastParsers::Hmmer::Standard - Front-end class for standard HMMER parser |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 VERSION |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
version 0.201110 |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
use aliased 'Bio::FastParsers::Hmmer::Standard'; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# open and parse hmmsearch output |
|
89
|
|
|
|
|
|
|
my $infile = 'test/hmmer.out'; |
|
90
|
|
|
|
|
|
|
my $parser = Standard->new(file => $infile); |
|
91
|
|
|
|
|
|
|
say $parser->next_hit->fullseq_eval; |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# TODO |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 file |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Path to HMMER report file in standard format (--notextw) to be parsed |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Denis BAURAIN <denis.baurain@uliege.be> |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 CONTRIBUTOR |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=for stopwords Arnaud DI FRANCO |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Arnaud DI FRANCO <arnaud.difranco@gmail.com> |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN. |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
118
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |