FastParsers/Hmmer/Model.pm

filter: Statementstmt 100% 41 / 41 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 51 / 51 CC 2 SCAR 1.7
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« FastParsers/Hmmer/DomTable/Hit.pm ↑ Summary FastParsers/Types.pm »
1 package Bio::FastParsers::Hmmer::Model;
2 # ABSTRACT: Internal class for HMMER parser
3 # CONTRIBUTOR: Arnaud DI FRANCO <arnaud.difranco@gmail.com>
4 7 $Bio::FastParsers::Hmmer::Model::VERSION = '0.213510';
5 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 7 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 7 ▶use Path::Class;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 7 ▶use Smart::Comments;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 7 ▶use List::AllUtils qw(firstidx);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 7 extends 'Bio::FastParsers::Base';
17  
18 7 ▶use Bio::FastParsers::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 has $_ => (
22 is => 'ro',
23 isa => 'Num',
24 required => 1,
25 7 ) for qw(cksum effn nseq leng);
26  
27 7 has maxl => (
28 is => 'ro',
29 isa => 'Num',
30 );
31  
32 has $_ => (
33 is => 'ro',
34 isa => 'Maybe[Str]',
35 required => 1,
36 7 ) for qw(alph cons cs map mm name rf);
37  
38  
39 around BUILDARGS => sub {
40 2 ▶ my %args = @_;
Subroutine __ANON__: called CC=2 SCAR=6.9
41  
42 # parse file and automatically create args
43 2 my $profile_file = file( $args{'file'} );
44 2 my @profile_content = $profile_file->slurp( chomp => 1 );
45  
46 my $hmmstart_index = firstidx {
47 35 ▶ substr($_, 0, 4) eq q{HMM }
Subroutine __ANON__: called CC=1 SCAR=0.0
48 2 } @profile_content;
49  
50 2 for my $idx ( 1..$hmmstart_index-1 ) {
51 31 my ($key, $value) = split /\s+/xms, $profile_content[$idx];
52 31 $args{ lc $key } = $value;
53 }
54  
55 2 return \%args;
56 7 };
57  
58 7 __PACKAGE__->meta->make_immutable;
59 7 1;
60  
61 __END__
62  
63 =pod
64  
65 =head1 NAME
66  
67 Bio::FastParsers::Hmmer::Model - Internal class for HMMER parser
68  
69 =head1 VERSION
70  
71 version 0.213510
72  
73 =head1 SYNOPSIS
74  
75 # TODO
76  
77 =head1 DESCRIPTION
78  
79 # TODO
80  
81 =head1 AUTHOR
82  
83 Denis BAURAIN <denis.baurain@uliege.be>
84  
85 =head1 CONTRIBUTOR
86  
87 =for stopwords Arnaud DI FRANCO
88  
89 Arnaud DI FRANCO <arnaud.difranco@gmail.com>
90  
91 =head1 COPYRIGHT AND LICENSE
92  
93 This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN.
94  
95 This is free software; you can redistribute it and/or modify it under
96 the same terms as the Perl 5 programming language system itself.
97  
98 =cut
« FastParsers/Hmmer/DomTable/Hit.pm ↑ Summary FastParsers/Types.pm »