| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# |
|
2
|
|
|
|
|
|
|
# bioperl module for Bio::LiveSeq::ChainI |
|
3
|
|
|
|
|
|
|
# |
|
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
|
5
|
|
|
|
|
|
|
# |
|
6
|
|
|
|
|
|
|
# Cared for by Joseph Insana |
|
7
|
|
|
|
|
|
|
# |
|
8
|
|
|
|
|
|
|
# Copyright Joseph Insana |
|
9
|
|
|
|
|
|
|
# |
|
10
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
|
11
|
|
|
|
|
|
|
# |
|
12
|
|
|
|
|
|
|
# POD documentation - main docs before the code |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Bio::LiveSeq::ChainI - Double linked chain data structure |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#documentation needed |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This class generates and manipulates generic double linked list, chain, |
|
25
|
|
|
|
|
|
|
that can be used to manage biological sequences. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
The advantages over strings or plain arrays is the ease of tracking |
|
28
|
|
|
|
|
|
|
changes (mutations) in the elements (sequence). The other side of the |
|
29
|
|
|
|
|
|
|
coin is that these structures need consideraly more memory, but that |
|
30
|
|
|
|
|
|
|
is cheap and constantly inceasing resource in computers. |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 FEEDBACK |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 Mailing Lists |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
User feedback is an integral part of the evolution of this and other |
|
37
|
|
|
|
|
|
|
Bioperl modules. Send your comments and suggestions preferably to one |
|
38
|
|
|
|
|
|
|
of the Bioperl mailing lists. Your participation is much appreciated. |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
|
41
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 Support |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
I |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
rather than to the module maintainer directly. Many experienced and |
|
50
|
|
|
|
|
|
|
reponsive experts will be able look at the problem and quickly |
|
51
|
|
|
|
|
|
|
address it. Please include a thorough description of the problem |
|
52
|
|
|
|
|
|
|
with code and data examples if at all possible. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 Reporting Bugs |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Report bugs to the Bioperl bug tracking system to help us keep track |
|
57
|
|
|
|
|
|
|
the bugs and their resolution. Bug reports can be submitted via the |
|
58
|
|
|
|
|
|
|
web: |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR - Joseph A.L. Insana |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Email: Insana@ebi.ac.uk, jinsana@gmx.net |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 APPENDIX |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
The rest of the documentation details each of the object |
|
69
|
|
|
|
|
|
|
methods. Internal methods are usually preceded with a _ |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Let the code begin... |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
package Bio::LiveSeq::ChainI; |
|
76
|
|
|
|
|
|
|
|
|
77
|
2
|
|
|
2
|
|
8
|
use Carp qw(croak); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
78
|
|
|
78
|
2
|
|
|
2
|
|
7
|
use strict; # this will be moved before when strict enforced in Chain.pm |
|
|
2
|
|
|
|
|
1
|
|
|
|
2
|
|
|
|
|
30
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
2
|
|
|
2
|
|
769
|
use Bio::LiveSeq::Chain; # package where all the subroutines are defined |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
1523
|
|
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 new |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Title : new |
|
86
|
|
|
|
|
|
|
Usage : $chain = Bio::LiveSeq::ChainI->new(-string => "thequickbrownfoxjumpsoverthelazydog", |
|
87
|
|
|
|
|
|
|
-offset => 3 ); |
|
88
|
|
|
|
|
|
|
OR $chain = Bio::LiveSeq::ChainI->new(-array => \@array, |
|
89
|
|
|
|
|
|
|
-offset => 3 ); |
|
90
|
|
|
|
|
|
|
Function: generates a new Bio::LiveSeq:ChainI |
|
91
|
|
|
|
|
|
|
Returns : a new Chain |
|
92
|
|
|
|
|
|
|
Args : string |
|
93
|
|
|
|
|
|
|
OR arrayreference |
|
94
|
|
|
|
|
|
|
AND optional offset to create element labels |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub new { |
|
99
|
0
|
|
|
0
|
1
|
0
|
my ($thing, %args) = @_; |
|
100
|
0
|
|
0
|
|
|
0
|
my $class = ref($thing) || $thing; |
|
101
|
0
|
|
|
|
|
0
|
my $obj; |
|
102
|
|
|
|
|
|
|
|
|
103
|
0
|
0
|
|
|
|
0
|
if ($args{-string}) { |
|
|
|
0
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
0
|
$obj = $thing->string2chain($args{-string}, $args{-offset}); |
|
105
|
|
|
|
|
|
|
} elsif ($args{-array}) { |
|
106
|
0
|
|
|
|
|
0
|
$obj = $thing->array2chain($args{-array}, $args{-offset}); |
|
107
|
|
|
|
|
|
|
} else { |
|
108
|
0
|
|
|
|
|
0
|
croak "$class not initialized properly"; |
|
109
|
|
|
|
|
|
|
} |
|
110
|
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
0
|
$obj = bless $obj, $class; |
|
112
|
0
|
|
|
|
|
0
|
return $obj; |
|
113
|
|
|
|
|
|
|
} |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
# added as of 1.9 |
|
116
|
|
|
|
|
|
|
sub string2chain { |
|
117
|
6
|
|
|
6
|
0
|
9
|
shift @_; # so that it doesn't pass the object reference |
|
118
|
6
|
|
|
|
|
24
|
return Bio::LiveSeq::Chain::string2chain(@_); |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
sub array2chain { |
|
121
|
0
|
|
|
0
|
0
|
0
|
shift @_; # so that it doesn't pass the object reference |
|
122
|
0
|
|
|
|
|
0
|
return Bio::LiveSeq::Chain::array2chain(@_); |
|
123
|
|
|
|
|
|
|
} |
|
124
|
|
|
|
|
|
|
# |
|
125
|
|
|
|
|
|
|
sub chain2string { |
|
126
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
sub down_chain2string { |
|
129
|
601
|
|
|
601
|
0
|
924
|
return Bio::LiveSeq::Chain::down_chain2string(@_); |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
sub up_chain2string { |
|
132
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_chain2string(@_); |
|
133
|
|
|
|
|
|
|
} |
|
134
|
|
|
|
|
|
|
sub chain2string_verbose { |
|
135
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
sub down_chain2string_verbose { |
|
138
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::down_chain2string_verbose(@_); |
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
sub up_chain2string_verbose { |
|
141
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_chain2string_verbose(@_); |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
sub invert_chain { |
|
144
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::invert_chain(@_); |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
sub mutate_element { |
|
147
|
0
|
|
|
0
|
0
|
0
|
croak "Old method name, please update code to: set_value_at_label"; |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# new as of version 2.33 of Chain.pm |
|
151
|
|
|
|
|
|
|
sub down_labels { |
|
152
|
822
|
|
|
822
|
0
|
1276
|
return Bio::LiveSeq::Chain::down_labels(@_); |
|
153
|
|
|
|
|
|
|
} |
|
154
|
|
|
|
|
|
|
sub up_labels { |
|
155
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_labels(@_); |
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub start { |
|
159
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::start(@_); |
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
sub end { |
|
162
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::end(@_); |
|
163
|
|
|
|
|
|
|
} |
|
164
|
|
|
|
|
|
|
sub label_exists { |
|
165
|
3594
|
|
|
3594
|
0
|
3795
|
return Bio::LiveSeq::Chain::label_exists(@_); |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub get_value_at_pos { |
|
169
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
170
|
|
|
|
|
|
|
} |
|
171
|
|
|
|
|
|
|
sub down_get_value_at_pos { |
|
172
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::down_get_value_at_pos(@_); |
|
173
|
|
|
|
|
|
|
} |
|
174
|
|
|
|
|
|
|
sub up_get_value_at_pos { |
|
175
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_get_value_at_pos(@_); |
|
176
|
|
|
|
|
|
|
} |
|
177
|
|
|
|
|
|
|
sub set_value_at_pos { |
|
178
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
179
|
|
|
|
|
|
|
} |
|
180
|
|
|
|
|
|
|
sub down_set_value_at_pos { |
|
181
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::down_set_value_at_pos(@_); |
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
sub up_set_value_at_pos { |
|
184
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_set_value_at_pos(@_); |
|
185
|
|
|
|
|
|
|
} |
|
186
|
|
|
|
|
|
|
sub get_value_at_label { |
|
187
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::get_value_at_label(@_); |
|
188
|
|
|
|
|
|
|
} |
|
189
|
|
|
|
|
|
|
sub set_value_at_label { |
|
190
|
5
|
|
|
5
|
0
|
21
|
return Bio::LiveSeq::Chain::set_value_at_label(@_); |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
sub get_label_at_pos { |
|
193
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
194
|
|
|
|
|
|
|
} |
|
195
|
|
|
|
|
|
|
sub up_get_label_at_pos { |
|
196
|
10
|
|
|
10
|
0
|
32
|
return Bio::LiveSeq::Chain::up_get_label_at_pos(@_); |
|
197
|
|
|
|
|
|
|
} |
|
198
|
|
|
|
|
|
|
sub down_get_label_at_pos { |
|
199
|
9
|
|
|
9
|
0
|
32
|
return Bio::LiveSeq::Chain::down_get_label_at_pos(@_); |
|
200
|
|
|
|
|
|
|
} |
|
201
|
|
|
|
|
|
|
sub get_pos_of_label { |
|
202
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
sub up_get_pos_of_label { |
|
205
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_get_pos_of_label(@_); |
|
206
|
|
|
|
|
|
|
} |
|
207
|
|
|
|
|
|
|
sub down_get_pos_of_label { |
|
208
|
10
|
|
|
10
|
0
|
28
|
return Bio::LiveSeq::Chain::down_get_pos_of_label(@_); |
|
209
|
|
|
|
|
|
|
} |
|
210
|
|
|
|
|
|
|
# |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
sub preinsert_string { |
|
213
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::praeinsert_string(@_); |
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
sub preinsert_array { |
|
216
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::praeinsert_array(@_); |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
sub praeinsert_string { |
|
219
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::praeinsert_string(@_); |
|
220
|
|
|
|
|
|
|
} |
|
221
|
|
|
|
|
|
|
sub postinsert_string { |
|
222
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::postinsert_string(@_); |
|
223
|
|
|
|
|
|
|
} |
|
224
|
|
|
|
|
|
|
sub praeinsert_array { |
|
225
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::praeinsert_array(@_); |
|
226
|
|
|
|
|
|
|
} |
|
227
|
|
|
|
|
|
|
sub postinsert_array { |
|
228
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::postinsert_array(@_); |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
sub down_element{ |
|
231
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::down_element(@_); |
|
232
|
|
|
|
|
|
|
} |
|
233
|
|
|
|
|
|
|
sub up_element { |
|
234
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::up_element(@_); |
|
235
|
|
|
|
|
|
|
} |
|
236
|
|
|
|
|
|
|
sub is_downstream { |
|
237
|
129
|
|
|
129
|
0
|
268
|
return Bio::LiveSeq::Chain::is_downstream(@_); |
|
238
|
|
|
|
|
|
|
} |
|
239
|
|
|
|
|
|
|
sub is_upstream { |
|
240
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::is_upstream(@_); |
|
241
|
|
|
|
|
|
|
} |
|
242
|
|
|
|
|
|
|
sub check_chain { |
|
243
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::check_chain(@_); |
|
244
|
|
|
|
|
|
|
} |
|
245
|
|
|
|
|
|
|
sub chain_length { |
|
246
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::chain_length(@_); |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
sub splice_chain { |
|
249
|
0
|
|
|
0
|
0
|
0
|
return Bio::LiveSeq::Chain::splice_chain(@_); |
|
250
|
|
|
|
|
|
|
} |
|
251
|
|
|
|
|
|
|
sub pos_of_element { |
|
252
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous and old method name. use: down_pos_of_label"; |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
sub up_pos_of_element { |
|
255
|
0
|
|
|
0
|
0
|
0
|
croak "old method name. use: down_pos_of_label"; |
|
256
|
0
|
|
|
|
|
0
|
return Bio::LiveSeq::Chain::up_pos_of_element(@_); |
|
257
|
|
|
|
|
|
|
} |
|
258
|
|
|
|
|
|
|
sub down_pos_of_element { |
|
259
|
0
|
|
|
0
|
0
|
0
|
croak "old method name. use: up_pos_of_label"; |
|
260
|
0
|
|
|
|
|
0
|
return Bio::LiveSeq::Chain::down_pos_of_element(@_); |
|
261
|
|
|
|
|
|
|
} |
|
262
|
|
|
|
|
|
|
sub subchain_length { |
|
263
|
0
|
|
|
0
|
0
|
0
|
croak "ambiguous method call. Explicit down_ or up_"; |
|
264
|
|
|
|
|
|
|
} |
|
265
|
|
|
|
|
|
|
sub down_subchain_length { |
|
266
|
216
|
|
|
216
|
0
|
415
|
return Bio::LiveSeq::Chain::down_subchain_length(@_); |
|
267
|
|
|
|
|
|
|
} |
|
268
|
|
|
|
|
|
|
sub up_subchain_length { |
|
269
|
0
|
|
|
0
|
0
|
|
return Bio::LiveSeq::Chain::up_subchain_length(@_); |
|
270
|
|
|
|
|
|
|
} |
|
271
|
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# these have to be deleted and changed names to conform to terminology |
|
273
|
|
|
|
|
|
|
sub elements { |
|
274
|
0
|
|
|
0
|
0
|
|
return Bio::LiveSeq::Chain::down_elements(@_); |
|
275
|
|
|
|
|
|
|
} |
|
276
|
|
|
|
|
|
|
sub up_elements { |
|
277
|
0
|
|
|
0
|
0
|
|
return Bio::LiveSeq::Chain::up_elements(@_); |
|
278
|
|
|
|
|
|
|
} |
|
279
|
|
|
|
|
|
|
sub down_elements { |
|
280
|
0
|
|
|
0
|
0
|
|
return Bio::LiveSeq::Chain::down_elements(@_); |
|
281
|
|
|
|
|
|
|
} |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
1; |