| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Bio::FastParsers::Hmmer::Model; | 
| 2 |  |  |  |  |  |  | # ABSTRACT: Internal class for HMMER parser | 
| 3 |  |  |  |  |  |  | # CONTRIBUTOR: Arnaud DI FRANCO <arnaud.difranco@gmail.com> | 
| 4 |  |  |  |  |  |  | $Bio::FastParsers::Hmmer::Model::VERSION = '0.213510'; | 
| 5 | 7 |  |  | 7 |  | 54 | use Moose; | 
|  | 7 |  |  |  |  | 20 |  | 
|  | 7 |  |  |  |  | 64 |  | 
| 6 | 7 |  |  | 7 |  | 52715 | use namespace::autoclean; | 
|  | 7 |  |  |  |  | 21 |  | 
|  | 7 |  |  |  |  | 83 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 7 |  |  | 7 |  | 784 | use autodie; | 
|  | 7 |  |  |  |  | 21 |  | 
|  | 7 |  |  |  |  | 74 |  | 
| 9 |  |  |  |  |  |  |  | 
| 10 | 7 |  |  | 7 |  | 40998 | use Carp; | 
|  | 7 |  |  |  |  | 20 |  | 
|  | 7 |  |  |  |  | 691 |  | 
| 11 | 7 |  |  | 7 |  | 53 | use Path::Class; | 
|  | 7 |  |  |  |  | 18 |  | 
|  | 7 |  |  |  |  | 442 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 7 |  |  | 7 |  | 5223 | use Smart::Comments; | 
|  | 7 |  |  |  |  | 156610 |  | 
|  | 7 |  |  |  |  | 52 |  | 
| 14 | 7 |  |  | 7 |  | 12081 | use List::AllUtils qw(firstidx); | 
|  | 7 |  |  |  |  | 20 |  | 
|  | 7 |  |  |  |  | 579 |  | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | extends 'Bio::FastParsers::Base'; | 
| 17 |  |  |  |  |  |  |  | 
| 18 | 7 |  |  | 7 |  | 56 | use Bio::FastParsers::Types; | 
|  | 7 |  |  |  |  | 23 |  | 
|  | 7 |  |  |  |  | 2166 |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | has $_ => ( | 
| 22 |  |  |  |  |  |  | is       => 'ro', | 
| 23 |  |  |  |  |  |  | isa      => 'Num', | 
| 24 |  |  |  |  |  |  | required => 1, | 
| 25 |  |  |  |  |  |  | ) for qw(cksum effn nseq leng); | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | has maxl => ( | 
| 28 |  |  |  |  |  |  | is      => 'ro', | 
| 29 |  |  |  |  |  |  | isa     => 'Num', | 
| 30 |  |  |  |  |  |  | ); | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | has $_ => ( | 
| 33 |  |  |  |  |  |  | is       => 'ro', | 
| 34 |  |  |  |  |  |  | isa      => 'Maybe[Str]', | 
| 35 |  |  |  |  |  |  | required => 1, | 
| 36 |  |  |  |  |  |  | ) for qw(alph cons cs map mm name rf); | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | around BUILDARGS => sub { | 
| 40 |  |  |  |  |  |  | my %args = @_; | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | # parse file and automatically create args | 
| 43 |  |  |  |  |  |  | my $profile_file = file( $args{'file'} ); | 
| 44 |  |  |  |  |  |  | my @profile_content = $profile_file->slurp( chomp => 1 ); | 
| 45 |  |  |  |  |  |  |  | 
| 46 |  |  |  |  |  |  | my $hmmstart_index = firstidx { | 
| 47 |  |  |  |  |  |  | substr($_, 0, 4) eq q{HMM } | 
| 48 |  |  |  |  |  |  | } @profile_content; | 
| 49 |  |  |  |  |  |  |  | 
| 50 |  |  |  |  |  |  | for my $idx ( 1..$hmmstart_index-1 ) { | 
| 51 |  |  |  |  |  |  | my ($key, $value) = split /\s+/xms, $profile_content[$idx]; | 
| 52 |  |  |  |  |  |  | $args{ lc $key } = $value; | 
| 53 |  |  |  |  |  |  | } | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | return \%args; | 
| 56 |  |  |  |  |  |  | }; | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | __PACKAGE__->meta->make_immutable; | 
| 59 |  |  |  |  |  |  | 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 |