2 # bioperl module for Bio::Structure::Model
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::Model - Bioperl structure Object, describes a Model
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. Internal methods are usually preceded with a _
66 # Let the code begin...
68 package Bio
::Structure
::Model
;
71 use Bio
::Structure
::Entry
;
72 use Bio
::Structure
::Chain
;
73 use base
qw(Bio::Root::Root);
79 Usage : $struc = Bio::Structure::Model->new(
83 Function: Returns a new Bio::Structure::Model object from basic
84 constructors. Probably most called from Bio::Structure::IO.
85 Returns : a new Bio::Structure::Model object
92 my ($class, @args) = @_;
93 my $self = $class->SUPER::new
(@args);
95 my($id, $chain, $residue ) =
96 $self->_rearrange([qw(
103 $id && $self->id($id);
105 $chain && $self->throw("you have to add chain via an Entry object\n");
107 $residue && $self->throw("you have to add residues via an Entry object\n");
118 Function: will eventually allow parent/child navigation not via an Entry object
125 my ($self,$value) = @_;
127 $self->throw("go via an Entry object\n");
135 Function: will eventually allow parent/child navigation not via an Entry object
142 my ($self,$value) = @_;
144 $self->throw("go via an Entry object for now\n");
151 Function: will eventually allow parent/child navigation not via an Entry object
160 $self->throw("Model::entry go via an Entry object please\n");
167 Usage : $model->id("model 5")
168 Function: Gets/sets the ID for this model
175 my ($self, $value) = @_;;
176 if (defined $value) {
177 $self->{'id'} = $value;
179 return $self->{'id'};
186 Function: will eventually allow parent/child navigation not via an Entry object
193 my ($self, @args) = @_;
195 $self->throw("need to go via Entry object or learn symbolic refs\n");
203 Function: will eventually allow parent/child navigation not via an Entry object
210 my ($self, @args) = @_;
212 $self->throw("go via entry->add_residue(chain, residue)\n");
220 # no specific DESTROY for now
224 # from here on only private methods
227 =head2 _remove_chains()
229 Title : _remove_chains
231 Function: Removes the chains attached to a Model. Tells the chains they
232 don't belong to this Model any more
241 $self->throw("use Entry methods pleae\n");
245 =head2 _remove_entry()
247 Title : _remove_entry
249 Function: Removes the Entry this Model is atttached to.
258 $self->throw("use a method based on an Entry object\n");
262 =head2 _create_default_chain()
264 Title : _create_default_chain
266 Function: Creates a default Chain for this Model. Typical situation
267 in an X-ray structure where there is only one chain
273 sub _create_default_chain
{
276 my $chain = Bio
::Structure
::Chain
->new(-id
=> "default");
280 =head2 _grandparent()
284 Function: get/set a symbolic reference to our grandparent
291 my($self,$symref) = @_;
294 $self->throw("Thou shall only pass strings in here, no references $symref\n");
296 if (defined $symref) {
297 $self->{'grandparent'} = $symref;
299 return $self->{'grandparent'};