2 # bioperl module for Bio::LiveSeq::ChainI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Joseph Insana <insana@ebi.ac.uk> <jinsana@gmx.net>
8 # Copyright Joseph Insana
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::LiveSeq::ChainI - Double linked chain data structure
24 This class generates and manipulates generic double linked list, chain,
25 that can be used to manage biological sequences.
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.
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.
40 bioperl-l@bioperl.org - General discussion
41 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
45 Please direct usage questions or support issues to the mailing list:
47 I<bioperl-l@bioperl.org>
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.
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
60 https://github.com/bioperl/bioperl-live/issues
62 =head1 AUTHOR - Joseph A.L. Insana
64 Email: Insana@ebi.ac.uk, jinsana@gmx.net
68 The rest of the documentation details each of the object
69 methods. Internal methods are usually preceded with a _
73 # Let the code begin...
75 package Bio
::LiveSeq
::ChainI
;
78 use strict
; # this will be moved before when strict enforced in Chain.pm
80 use Bio
::LiveSeq
::Chain
; # package where all the subroutines are defined
86 Usage : $chain = Bio::LiveSeq::ChainI->new(-string => "thequickbrownfoxjumpsoverthelazydog",
88 OR $chain = Bio::LiveSeq::ChainI->new(-array => \@array,
90 Function: generates a new Bio::LiveSeq:ChainI
94 AND optional offset to create element labels
99 my ($thing, %args) = @_;
100 my $class = ref($thing) || $thing;
103 if ($args{-string
}) {
104 $obj = $thing->string2chain($args{-string
}, $args{-offset
});
105 } elsif ($args{-array
}) {
106 $obj = $thing->array2chain($args{-array
}, $args{-offset
});
108 croak
"$class not initialized properly";
111 $obj = bless $obj, $class;
117 shift @_; # so that it doesn't pass the object reference
118 return Bio
::LiveSeq
::Chain
::string2chain
(@_);
121 shift @_; # so that it doesn't pass the object reference
122 return Bio
::LiveSeq
::Chain
::array2chain
(@_);
126 croak
"ambiguous method call. Explicit down_ or up_";
128 sub down_chain2string
{
129 return Bio
::LiveSeq
::Chain
::down_chain2string
(@_);
131 sub up_chain2string
{
132 return Bio
::LiveSeq
::Chain
::up_chain2string
(@_);
134 sub chain2string_verbose
{
135 croak
"ambiguous method call. Explicit down_ or up_";
137 sub down_chain2string_verbose
{
138 return Bio
::LiveSeq
::Chain
::down_chain2string_verbose
(@_);
140 sub up_chain2string_verbose
{
141 return Bio
::LiveSeq
::Chain
::up_chain2string_verbose
(@_);
144 return Bio
::LiveSeq
::Chain
::invert_chain
(@_);
147 croak
"Old method name, please update code to: set_value_at_label";
150 # new as of version 2.33 of Chain.pm
152 return Bio
::LiveSeq
::Chain
::down_labels
(@_);
155 return Bio
::LiveSeq
::Chain
::up_labels
(@_);
159 return Bio
::LiveSeq
::Chain
::start
(@_);
162 return Bio
::LiveSeq
::Chain
::end
(@_);
165 return Bio
::LiveSeq
::Chain
::label_exists
(@_);
168 sub get_value_at_pos
{
169 croak
"ambiguous method call. Explicit down_ or up_";
171 sub down_get_value_at_pos
{
172 return Bio
::LiveSeq
::Chain
::down_get_value_at_pos
(@_);
174 sub up_get_value_at_pos
{
175 return Bio
::LiveSeq
::Chain
::up_get_value_at_pos
(@_);
177 sub set_value_at_pos
{
178 croak
"ambiguous method call. Explicit down_ or up_";
180 sub down_set_value_at_pos
{
181 return Bio
::LiveSeq
::Chain
::down_set_value_at_pos
(@_);
183 sub up_set_value_at_pos
{
184 return Bio
::LiveSeq
::Chain
::up_set_value_at_pos
(@_);
186 sub get_value_at_label
{
187 return Bio
::LiveSeq
::Chain
::get_value_at_label
(@_);
189 sub set_value_at_label
{
190 return Bio
::LiveSeq
::Chain
::set_value_at_label
(@_);
192 sub get_label_at_pos
{
193 croak
"ambiguous method call. Explicit down_ or up_";
195 sub up_get_label_at_pos
{
196 return Bio
::LiveSeq
::Chain
::up_get_label_at_pos
(@_);
198 sub down_get_label_at_pos
{
199 return Bio
::LiveSeq
::Chain
::down_get_label_at_pos
(@_);
201 sub get_pos_of_label
{
202 croak
"ambiguous method call. Explicit down_ or up_";
204 sub up_get_pos_of_label
{
205 return Bio
::LiveSeq
::Chain
::up_get_pos_of_label
(@_);
207 sub down_get_pos_of_label
{
208 return Bio
::LiveSeq
::Chain
::down_get_pos_of_label
(@_);
212 sub preinsert_string
{
213 return Bio
::LiveSeq
::Chain
::praeinsert_string
(@_);
215 sub preinsert_array
{
216 return Bio
::LiveSeq
::Chain
::praeinsert_array
(@_);
218 sub praeinsert_string
{
219 return Bio
::LiveSeq
::Chain
::praeinsert_string
(@_);
221 sub postinsert_string
{
222 return Bio
::LiveSeq
::Chain
::postinsert_string
(@_);
224 sub praeinsert_array
{
225 return Bio
::LiveSeq
::Chain
::praeinsert_array
(@_);
227 sub postinsert_array
{
228 return Bio
::LiveSeq
::Chain
::postinsert_array
(@_);
231 return Bio
::LiveSeq
::Chain
::down_element
(@_);
234 return Bio
::LiveSeq
::Chain
::up_element
(@_);
237 return Bio
::LiveSeq
::Chain
::is_downstream
(@_);
240 return Bio
::LiveSeq
::Chain
::is_upstream
(@_);
243 return Bio
::LiveSeq
::Chain
::check_chain
(@_);
246 return Bio
::LiveSeq
::Chain
::chain_length
(@_);
249 return Bio
::LiveSeq
::Chain
::splice_chain
(@_);
252 croak
"ambiguous and old method name. use: down_pos_of_label";
254 sub up_pos_of_element
{
255 croak
"old method name. use: down_pos_of_label";
256 return Bio
::LiveSeq
::Chain
::up_pos_of_element
(@_);
258 sub down_pos_of_element
{
259 croak
"old method name. use: up_pos_of_label";
260 return Bio
::LiveSeq
::Chain
::down_pos_of_element
(@_);
262 sub subchain_length
{
263 croak
"ambiguous method call. Explicit down_ or up_";
265 sub down_subchain_length
{
266 return Bio
::LiveSeq
::Chain
::down_subchain_length
(@_);
268 sub up_subchain_length
{
269 return Bio
::LiveSeq
::Chain
::up_subchain_length
(@_);
272 # these have to be deleted and changed names to conform to terminology
274 return Bio
::LiveSeq
::Chain
::down_elements
(@_);
277 return Bio
::LiveSeq
::Chain
::up_elements
(@_);
280 return Bio
::LiveSeq
::Chain
::down_elements
(@_);