line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Palantir::Explorer::GeneFasta; |
2
|
|
|
|
|
|
|
# ABSTRACT: Explorer internal class for handling GeneFasta objects |
3
|
|
|
|
|
|
|
$Bio::Palantir::Explorer::GeneFasta::VERSION = '0.200700'; |
4
|
1
|
|
|
1
|
|
564
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
5
|
1
|
|
|
1
|
|
5795
|
use namespace::autoclean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
72
|
use Data::UUID; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
8
|
1
|
|
|
1
|
|
7
|
use List::AllUtils qw(each_array); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
40
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
11
|
use aliased 'Bio::Palantir::Refiner::DomainPlus'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
11
|
|
|
|
|
|
|
with 'Bio::Palantir::Roles::Fillable'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# public attributes |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has 'from_seq' => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => 'Bool', |
19
|
|
|
|
|
|
|
init_arg => undef, |
20
|
|
|
|
|
|
|
default => 1, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'uui' => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
isa => 'Str', |
26
|
|
|
|
|
|
|
init_arg => undef, |
27
|
|
|
|
|
|
|
default => sub { |
28
|
|
|
|
|
|
|
my $self = shift; |
29
|
|
|
|
|
|
|
my $ug = Data::UUID->new; |
30
|
|
|
|
|
|
|
my $uui = $ug->create_str(); |
31
|
|
|
|
|
|
|
return $uui; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has $_ => ( |
36
|
|
|
|
|
|
|
is => 'ro', |
37
|
|
|
|
|
|
|
isa => 'Str', |
38
|
|
|
|
|
|
|
) for qw(protein_sequence name); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has $_ => ( |
41
|
|
|
|
|
|
|
is => 'ro', |
42
|
|
|
|
|
|
|
isa => 'Num', |
43
|
|
|
|
|
|
|
) for qw(gene_begin gene_end rank size); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has 'coordinates' => ( |
46
|
|
|
|
|
|
|
is => 'ro', |
47
|
|
|
|
|
|
|
isa => 'ArrayRef', |
48
|
|
|
|
|
|
|
); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# private attributes |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# public array(s) of composed objects |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
has 'domains' => ( |
58
|
|
|
|
|
|
|
traits => ['Array'], |
59
|
|
|
|
|
|
|
is => 'ro', |
60
|
|
|
|
|
|
|
isa => 'ArrayRef[Bio::Palantir::Refiner::DomainPlus]', |
61
|
|
|
|
|
|
|
init_arg => undef, |
62
|
|
|
|
|
|
|
default => sub { [] }, |
63
|
|
|
|
|
|
|
writer => '_set_domains', |
64
|
|
|
|
|
|
|
handles => { |
65
|
|
|
|
|
|
|
count_domains => 'count', |
66
|
|
|
|
|
|
|
all_domains => 'elements', |
67
|
|
|
|
|
|
|
get_domain => 'get', |
68
|
|
|
|
|
|
|
next_domain => 'shift', |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
## no critic (ProhibitUnusedPrivateSubroutines) |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
## use critic |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub BUILD { |
79
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
my ($seq) = $self->protein_sequence; |
82
|
0
|
|
|
|
|
|
my $gene_pos = 0; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
my @domains = $self->detect_domains($seq, $gene_pos, undef, 1); |
85
|
|
|
|
|
|
|
|
86
|
0
|
0
|
|
|
|
|
unless (@domains) { |
87
|
0
|
|
|
|
|
|
return; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
$self->_set_domains(\@domains); |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
return; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# public methods |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# private methods |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
102
|
|
|
|
|
|
|
1; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
__END__ |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=pod |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 NAME |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Bio::Palantir::Explorer::GeneFasta - Explorer internal class for handling GeneFasta objects |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 VERSION |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
version 0.200700 |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 SYNOPSIS |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# TODO |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 DESCRIPTION |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
# TODO |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 domains |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
ArrayRef of L<Bio::Palantir::Refiner::DomainPlus> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 METHODS |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 count_domains |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Returns the number of Domains of the Gene. |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
# $gene is a Bio::Palantir::Explorer::GeneFasta |
137
|
|
|
|
|
|
|
my $count = $gene->count_domains; |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
This method does not accept any arguments. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head2 all_domains |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Returns all the Domains of the Gene (not an array reference). |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# $gene is a Bio::Palantir::Explorer::GeneFasta |
146
|
|
|
|
|
|
|
my @domains = $gene->all_domains; |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
This method does not accept any arguments. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 get_domain |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# $gene is a Bio::Palantir::Explorer::GeneFasta |
153
|
|
|
|
|
|
|
my $domain = $gene->get_domain($index); |
154
|
|
|
|
|
|
|
croak "Domain $index not found!" unless defined $domain; |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
This method accepts just one argument (and not an array slice). |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head2 next_domain |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Shifts the first Domain of the array off and returns it, shortening the |
161
|
|
|
|
|
|
|
array by 1 and moving everything down. If there are no more Domains in |
162
|
|
|
|
|
|
|
the array, returns C<undef>. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
# $gene is a Bio::Palantir::Explorer::GeneFasta |
165
|
|
|
|
|
|
|
while (my $domain = $gene->next_domain) { |
166
|
|
|
|
|
|
|
# process $domain |
167
|
|
|
|
|
|
|
# ... |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
This method does not accept any arguments. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 AUTHOR |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Loic MEUNIER <lmeunier@uliege.be> |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
This software is copyright (c) 2019 by University of Liege / Unit of Eukaryotic Phylogenomics / Loic MEUNIER and Denis BAURAIN. |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
181
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=cut |