| 1 | package Bio::FastParsers::Blast::Xml::Hit; | ||
| 2 | # ABSTRACT: NCBI BLAST DTD-derived internal class | ||
| 3 | 7 | $Bio::FastParsers::Blast::Xml::Hit::VERSION = '0.221230'; | |
| 4 | 7 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 7 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # AUTOGENERATED CODE! DO NOT MODIFY THIS FILE! | ||
| 8 | |||
| 9 | 7 | ▶ | use XML::Bare qw(forcearray); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 7 | ▶ | use aliased 'Bio::FastParsers::Blast::Xml::Hsp'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | |||
| 14 | # private attributes | ||
| 15 | |||
| 16 | 7 | has '_root' => ( | |
| 17 | is => 'ro', | ||
| 18 | isa => 'HashRef', | ||
| 19 | required => 1, | ||
| 20 | ); | ||
| 21 | |||
| 22 | 7 | has '_parent' => ( | |
| 23 | is => 'ro', | ||
| 24 | isa => 'Maybe[Object]', | ||
| 25 | required => 1, | ||
| 26 | weak_ref => 1, | ||
| 27 | ); | ||
| 28 | |||
| 29 | |||
| 30 | # public array(s) of composed objects | ||
| 31 | |||
| 32 | |||
| 33 | 7 | has 'hsps' => ( | |
| 34 | traits => ['Array'], | ||
| 35 | is => 'ro', | ||
| 36 | isa => 'ArrayRef[Bio::FastParsers::Blast::Xml::Hsp]', | ||
| 37 | init_arg => undef, | ||
| 38 | lazy => 1, | ||
| 39 | builder => '_build_hsps', | ||
| 40 | handles => { | ||
| 41 | count_hsps => 'count', | ||
| 42 | all_hsps => 'elements', | ||
| 43 | get_hsp => 'get', | ||
| 44 | next_hsp => 'shift', | ||
| 45 | }, | ||
| 46 | ); | ||
| 47 | |||
| 48 | ## no critic (ProhibitUnusedPrivateSubroutines) | ||
| 49 | |||
| 50 | 43 | ▶ | sub _build_hsps { |
|
Subroutine
_build_hsps: called CC=1 SCAR=0.0
| |||
| 51 | 43 | my $self = shift; | |
| 52 | 651 | return [ map { Hsp->new( _root => $_, _parent => $self ) } @{ | |
| 53 | 43 | forcearray $self->_root->{'Hit_hsps'}->{'Hsp'} | |
| 54 | } ]; | ||
| 55 | } | ||
| 56 | |||
| 57 | ## use critic | ||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | # public composed object(s) | ||
| 62 | |||
| 63 | |||
| 64 | # public methods | ||
| 65 | |||
| 66 | |||
| 67 | 0 | ▶ | sub accession { |
|
Subroutine
accession: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 68 | 0 | return shift->_root->{'Hit_accession'}->{'value'} | |
| 69 | } | ||
| 70 | |||
| 71 | |||
| 72 | 0 | ▶ | sub def { |
|
Subroutine
def: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 73 | 0 | return shift->_root->{'Hit_def'}->{'value'} | |
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | 0 | ▶ | sub id { |
|
Subroutine
id: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 78 | 0 | return shift->_root->{'Hit_id'}->{'value'} | |
| 79 | } | ||
| 80 | |||
| 81 | |||
| 82 | 2 | ▶ | sub len { |
|
Subroutine
len: called CC=1 SCAR=0.0
Pod
documented
| |||
| 83 | 2 | return shift->_root->{'Hit_len'}->{'value'} | |
| 84 | } | ||
| 85 | |||
| 86 | |||
| 87 | 0 | ▶ | sub num { |
|
Subroutine
num: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 88 | 0 | return shift->_root->{'Hit_num'}->{'value'} | |
| 89 | } | ||
| 90 | |||
| 91 | |||
| 92 | # public aliases | ||
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | 2 | ▶ | sub query_len { |
|
Subroutine
query_len: called CC=1 SCAR=0.0
Pod
documented
| |||
| 97 | return shift->_parent->query_len | ||
| 98 | 2 | } | |
| 99 | |||
| 100 | |||
| 101 | 7 | __PACKAGE__->meta->make_immutable; | |
| 102 | 7 | 1; | |
| 103 | |||
| 104 | __END__ | ||