2 # bioperl module for Bio::Structure::Chain
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Kris Boulez <kris.boulez@algonomics.com>
8 # Copyright Kris Boulez
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Structure::Chain - Bioperl structure Object, describes a chain
24 This object stores a Bio::Structure::Chain
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to one
32 of the Bioperl mailing lists. Your participation is much appreciated.
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 Please direct usage questions or support issues to the mailing list:
41 I<bioperl-l@bioperl.org>
43 rather than to the module maintainer directly. Many experienced and
44 reponsive experts will be able look at the problem and quickly
45 address it. Please include a thorough description of the problem
46 with code and data examples if at all possible.
50 Report bugs to the Bioperl bug tracking system to help us keep track
51 the bugs and their resolution. Bug reports can be submitted via the web:
53 https://github.com/bioperl/bioperl-live/issues
55 =head1 AUTHOR - Kris Boulez
57 Email kris.boulez@algonomics.com
61 The rest of the documentation details each of the object methods.
62 Internal methods are usually preceded with a _
67 # Let the code begin...
69 package Bio
::Structure
::Chain
;
72 use Bio
::Structure
::Entry
;
73 use Bio
::Structure
::Model
;
74 use base
qw(Bio::Root::Root);
80 Usage : $struc = Bio::Structure::Chain->new(
82 -accession_number => 'AL000012',
85 Function: Returns a new Bio::Structure::Chain object from basic
86 constructors. Usually called from Bio::Structure::IO.
87 Returns : a new Bio::Structure::Chain object
92 my ($class, @args) = @_;
93 my $self = $class->SUPER::new
(@args);
96 $self->_rearrange([qw(
102 $id && $self->id($id);
103 $self->{'residue'} = [];
104 # the 'smallest' item that can be added to a chain is a residue.
105 $residue && $self->throw("use a method based on an Entry object for now");
115 Function: nothing useful until I get symbolic references to do what I want
122 my ($self,$value) = @_;
124 $self->throw("use a method on an Entry object to do what you want");
132 Function: nothing useful until I get symbolic references to do what I want
139 my($self,$value) = @_;
141 $self->throw("you want entry->add_residue(chain, residue)\n");
148 Function: nothing useful until I get symbolic references to do what I want
155 my($self, $value) = @_;
157 $self->throw("go via a Entry object please\n");
164 Usage : $chain->id("chain B")
165 Function: Gets/sets the ID for this chain
172 my ($self, $value) = @_;;
173 if (defined $value) {
174 $self->{'id'} = $value;
176 return $self->{'id'};
183 # no specific destruction for now
188 # from here on only private methods
191 =head2 _remove_residues()
193 Title : _remove_residues
201 sub _remove_residues
{
204 $self->throw("nothing usefull in here, go see Entry\n");
208 =head2 _remove_model()
210 Title : _remove_model
212 Function: Removes the Model this Chain is atttached to.
221 $self->throw("go see an Entry object, nothing here\n");
225 =head2 _grandparent()
229 Function: get/set a symbolic reference to our grandparent
236 my($self,$symref) = @_;
239 $self->throw("Thou shall only pass strings in here, no references $symref\n");
241 if (defined $symref) {
242 $self->{'grandparent'} = $symref;
244 return $self->{'grandparent'};