line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Coordinate::Result; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:BIOPERLML'; |
3
|
|
|
|
|
|
|
$Bio::Coordinate::Result::VERSION = '1.007001'; |
4
|
3
|
|
|
3
|
|
13
|
use utf8; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
13
|
|
5
|
3
|
|
|
3
|
|
79
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
55
|
|
6
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
73
|
|
7
|
3
|
|
|
3
|
|
11
|
use parent qw(Bio::Location::Split Bio::Coordinate::ResultI); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
17
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Results from coordinate transformation. |
10
|
|
|
|
|
|
|
# AUTHOR: Heikki Lehvaslaiho |
11
|
|
|
|
|
|
|
# OWNER: Heikki Lehvaslaiho |
12
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub add_sub_Location { |
17
|
200
|
|
|
200
|
1
|
202
|
my ($self,$value) = @_; |
18
|
200
|
50
|
|
|
|
354
|
if( ! $value ) { |
19
|
0
|
|
|
|
|
0
|
$self->warn("provding an empty value for location\n"); |
20
|
0
|
|
|
|
|
0
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
200
|
50
|
|
|
|
559
|
$self->throw("Is not a Bio::LocationI but [$value]") |
23
|
|
|
|
|
|
|
unless $value->isa('Bio::LocationI'); |
24
|
|
|
|
|
|
|
|
25
|
200
|
100
|
|
|
|
600
|
$self->{'_match'} = $value |
26
|
|
|
|
|
|
|
if $value->isa('Bio::Coordinate::Result::Match'); |
27
|
|
|
|
|
|
|
|
28
|
200
|
100
|
|
|
|
568
|
$self->{'_gap'} = $value |
29
|
|
|
|
|
|
|
if $value->isa('Bio::Coordinate::Result::Gap'); |
30
|
|
|
|
|
|
|
|
31
|
200
|
|
|
|
|
390
|
$self->SUPER::add_sub_Location($value); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub add_result { |
37
|
36
|
|
|
36
|
1
|
35
|
my ($self,$value) = @_; |
38
|
|
|
|
|
|
|
|
39
|
36
|
50
|
|
|
|
112
|
$self->throw("Is not a Bio::Coordinate::Result but [$value]") |
40
|
|
|
|
|
|
|
unless $value->isa('Bio::Coordinate::Result'); |
41
|
|
|
|
|
|
|
|
42
|
36
|
|
|
|
|
64
|
map { $self->add_sub_Location($_) } $value->each_Location; |
|
65
|
|
|
|
|
1006
|
|
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub seq_id { |
47
|
160
|
|
|
160
|
1
|
39095
|
my ($self, $seqid) = @_; |
48
|
|
|
|
|
|
|
|
49
|
160
|
|
|
|
|
358
|
my @ls = $self->each_Location; |
50
|
160
|
100
|
|
|
|
2910
|
if (@ls) { |
51
|
81
|
|
|
|
|
198
|
return $ls[0]->seq_id; |
52
|
|
|
|
|
|
|
} else { |
53
|
79
|
|
|
|
|
147
|
return; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub each_gap { |
59
|
35
|
|
|
35
|
1
|
1248
|
my ($self) = @_; |
60
|
|
|
|
|
|
|
|
61
|
35
|
|
|
|
|
32
|
my @gaps; |
62
|
35
|
|
|
|
|
88
|
foreach my $gap ($self->each_Location) { |
63
|
56
|
100
|
|
|
|
991
|
push @gaps, $gap if $gap->isa('Bio::Coordinate::Result::Gap'); |
64
|
|
|
|
|
|
|
} |
65
|
35
|
|
|
|
|
118
|
return @gaps; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub each_match { |
71
|
131
|
|
|
131
|
1
|
223
|
my ($self) = @_; |
72
|
|
|
|
|
|
|
|
73
|
131
|
|
|
|
|
111
|
my @matches; |
74
|
131
|
|
|
|
|
252
|
foreach my $match ($self->each_Location) { |
75
|
257
|
100
|
|
|
|
3343
|
push @matches, $match if $match->isa('Bio::Coordinate::Result::Match'); |
76
|
|
|
|
|
|
|
} |
77
|
131
|
|
|
|
|
420
|
return @matches; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub match { |
82
|
104
|
|
|
104
|
1
|
19027
|
my ($self) = @_; |
83
|
|
|
|
|
|
|
|
84
|
104
|
50
|
66
|
|
|
174
|
$self->warn("More than one match in results") |
85
|
|
|
|
|
|
|
if $self->each_match > 1 and $self->verbose > 0; |
86
|
104
|
50
|
|
|
|
353
|
unless (defined $self->{'_match'} ) { |
87
|
0
|
|
|
|
|
0
|
my @m = $self->each_match; |
88
|
0
|
|
|
|
|
0
|
$self->{'_match'} = $m[-1]; |
89
|
|
|
|
|
|
|
} |
90
|
104
|
|
|
|
|
379
|
return $self->{'_match'}; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub gap { |
95
|
24
|
|
|
24
|
1
|
8547
|
my ($self) = @_; |
96
|
|
|
|
|
|
|
|
97
|
24
|
50
|
33
|
|
|
47
|
$self->warn("More than one gap in results") |
98
|
|
|
|
|
|
|
if $self->each_gap > 1 and $self->verbose > 0; |
99
|
24
|
50
|
|
|
|
56
|
unless (defined $self->{'_gap'} ) { |
100
|
0
|
|
|
|
|
0
|
my @m = $self->each_gap; |
101
|
0
|
|
|
|
|
0
|
$self->{'_gap'} = $m[-1]; |
102
|
|
|
|
|
|
|
} |
103
|
24
|
|
|
|
|
103
|
return $self->{'_gap'}; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub purge_gaps { |
108
|
16
|
|
|
16
|
1
|
195
|
my ($self) = @_; |
109
|
16
|
|
|
|
|
14
|
my @matches; |
110
|
16
|
|
|
|
|
22
|
my $count = 0; |
111
|
|
|
|
|
|
|
|
112
|
16
|
|
|
|
|
31
|
foreach my $loc ($self->each_Location) { |
113
|
46
|
100
|
|
|
|
395
|
if ($loc->isa('Bio::Coordinate::Result::Match')) { |
114
|
28
|
|
|
|
|
34
|
push @matches, $loc; |
115
|
|
|
|
|
|
|
} else { |
116
|
18
|
|
|
|
|
19
|
$count++ |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
} |
119
|
16
|
|
|
|
|
16
|
@{$self->{'_sublocations'}} = (); |
|
16
|
|
|
|
|
36
|
|
120
|
16
|
|
|
|
|
97
|
delete $self->{'_gap'} ; |
121
|
16
|
|
|
|
|
58
|
push @{$self->{'_sublocations'}}, @matches; |
|
16
|
|
|
|
|
24
|
|
122
|
16
|
|
|
|
|
30
|
return $count; |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
1; |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
__END__ |