line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# bioperl module for Bio::Structure::Model |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Kris Boulez |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Kris Boulez |
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::Structure::Model - Bioperl structure Object, describes a Model |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#add synopsis here |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This object stores a Bio::Structure::Chain |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 FEEDBACK |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 Mailing Lists |
29
|
|
|
|
|
|
|
|
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. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
35
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 Support |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
I |
42
|
|
|
|
|
|
|
|
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. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 Reporting Bugs |
49
|
|
|
|
|
|
|
|
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: |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 AUTHOR - Kris Boulez |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Email kris.boulez@algonomics.com |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 APPENDIX |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Let the code begin... |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package Bio::Structure::Model; |
69
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
59
|
|
70
|
|
|
|
|
|
|
|
71
|
2
|
|
|
2
|
|
7
|
use Bio::Structure::Entry; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
32
|
|
72
|
2
|
|
|
2
|
|
472
|
use Bio::Structure::Chain; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
45
|
|
73
|
2
|
|
|
2
|
|
7
|
use base qw(Bio::Root::Root); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
768
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 new() |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Title : new() |
79
|
|
|
|
|
|
|
Usage : $struc = Bio::Structure::Model->new( |
80
|
|
|
|
|
|
|
-id => 'human_id', |
81
|
|
|
|
|
|
|
); |
82
|
|
|
|
|
|
|
|
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 |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub new { |
92
|
6
|
|
|
6
|
1
|
11
|
my ($class, @args) = @_; |
93
|
6
|
|
|
|
|
22
|
my $self = $class->SUPER::new(@args); |
94
|
|
|
|
|
|
|
|
95
|
6
|
|
|
|
|
22
|
my($id, $chain, $residue ) = |
96
|
|
|
|
|
|
|
$self->_rearrange([qw( |
97
|
|
|
|
|
|
|
ID |
98
|
|
|
|
|
|
|
CHAIN |
99
|
|
|
|
|
|
|
RESIDUE |
100
|
|
|
|
|
|
|
)], |
101
|
|
|
|
|
|
|
@args); |
102
|
|
|
|
|
|
|
|
103
|
6
|
100
|
|
|
|
28
|
$id && $self->id($id); |
104
|
|
|
|
|
|
|
|
105
|
6
|
50
|
|
|
|
11
|
$chain && $self->throw("you have to add chain via an Entry object\n"); |
106
|
|
|
|
|
|
|
|
107
|
6
|
50
|
|
|
|
10
|
$residue && $self->throw("you have to add residues via an Entry object\n"); |
108
|
|
|
|
|
|
|
|
109
|
6
|
|
|
|
|
12
|
return $self; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 chain() |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Title : chain |
117
|
|
|
|
|
|
|
Usage : |
118
|
|
|
|
|
|
|
Function: will eventually allow parent/child navigation not via an Entry object |
119
|
|
|
|
|
|
|
Returns : |
120
|
|
|
|
|
|
|
Args : |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub chain { |
125
|
0
|
|
|
0
|
1
|
0
|
my ($self,$value) = @_; |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
0
|
$self->throw("go via an Entry object\n"); |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 add_chain() |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Title : add_chain |
134
|
|
|
|
|
|
|
Usage : |
135
|
|
|
|
|
|
|
Function: will eventually allow parent/child navigation not via an Entry object |
136
|
|
|
|
|
|
|
Returns : |
137
|
|
|
|
|
|
|
Args : |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub add_chain { |
142
|
0
|
|
|
0
|
1
|
0
|
my ($self,$value) = @_; |
143
|
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
0
|
$self->throw("go via an Entry object for now\n"); |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head2 entry() |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Title : entry |
150
|
|
|
|
|
|
|
Usage : |
151
|
|
|
|
|
|
|
Function: will eventually allow parent/child navigation not via an Entry object |
152
|
|
|
|
|
|
|
Returns : |
153
|
|
|
|
|
|
|
Args : |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=cut |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub entry { |
158
|
0
|
|
|
0
|
1
|
0
|
my($self) = @_; |
159
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
0
|
$self->throw("Model::entry go via an Entry object please\n"); |
161
|
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head2 id() |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Title : id |
167
|
|
|
|
|
|
|
Usage : $model->id("model 5") |
168
|
|
|
|
|
|
|
Function: Gets/sets the ID for this model |
169
|
|
|
|
|
|
|
Returns : the ID |
170
|
|
|
|
|
|
|
Args : the ID |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=cut |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub id { |
175
|
4
|
|
|
4
|
1
|
7
|
my ($self, $value) = @_;; |
176
|
4
|
100
|
|
|
|
13
|
if (defined $value) { |
177
|
3
|
|
|
|
|
9
|
$self->{'id'} = $value; |
178
|
|
|
|
|
|
|
} |
179
|
4
|
|
|
|
|
13
|
return $self->{'id'}; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 residue() |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Title : residue |
185
|
|
|
|
|
|
|
Usage : |
186
|
|
|
|
|
|
|
Function: will eventually allow parent/child navigation not via an Entry object |
187
|
|
|
|
|
|
|
Returns : |
188
|
|
|
|
|
|
|
Args : |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub residue { |
193
|
0
|
|
|
0
|
1
|
0
|
my ($self, @args) = @_; |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
|
|
0
|
$self->throw("need to go via Entry object or learn symbolic refs\n"); |
196
|
|
|
|
|
|
|
} |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=head2 add_residue() |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
Title : add_residue |
202
|
|
|
|
|
|
|
Usage : |
203
|
|
|
|
|
|
|
Function: will eventually allow parent/child navigation not via an Entry object |
204
|
|
|
|
|
|
|
Returns : |
205
|
|
|
|
|
|
|
Args : |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=cut |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
sub add_residue { |
210
|
0
|
|
|
0
|
1
|
0
|
my ($self, @args) = @_; |
211
|
|
|
|
|
|
|
|
212
|
0
|
|
|
|
|
0
|
$self->throw("go via entry->add_residue(chain, residue)\n"); |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub DESTROY { |
218
|
6
|
|
|
6
|
|
416
|
my $self = shift; |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
# no specific DESTROY for now |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
# |
224
|
|
|
|
|
|
|
# from here on only private methods |
225
|
|
|
|
|
|
|
# |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
=head2 _remove_chains() |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
Title : _remove_chains |
230
|
|
|
|
|
|
|
Usage : |
231
|
|
|
|
|
|
|
Function: Removes the chains attached to a Model. Tells the chains they |
232
|
|
|
|
|
|
|
don't belong to this Model any more |
233
|
|
|
|
|
|
|
Returns : |
234
|
|
|
|
|
|
|
Args : |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=cut |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
sub _remove_chains { |
239
|
0
|
|
|
0
|
|
|
my ($self) = shift; |
240
|
|
|
|
|
|
|
|
241
|
0
|
|
|
|
|
|
$self->throw("use Entry methods pleae\n"); |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
=head2 _remove_entry() |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
Title : _remove_entry |
248
|
|
|
|
|
|
|
Usage : |
249
|
|
|
|
|
|
|
Function: Removes the Entry this Model is atttached to. |
250
|
|
|
|
|
|
|
Returns : |
251
|
|
|
|
|
|
|
Args : |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=cut |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
sub _remove_entry { |
256
|
0
|
|
|
0
|
|
|
my ($self) = shift; |
257
|
|
|
|
|
|
|
|
258
|
0
|
|
|
|
|
|
$self->throw("use a method based on an Entry object\n"); |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=head2 _create_default_chain() |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
Title : _create_default_chain |
265
|
|
|
|
|
|
|
Usage : |
266
|
|
|
|
|
|
|
Function: Creates a default Chain for this Model. Typical situation |
267
|
|
|
|
|
|
|
in an X-ray structure where there is only one chain |
268
|
|
|
|
|
|
|
Returns : |
269
|
|
|
|
|
|
|
Args : |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=cut |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub _create_default_chain { |
274
|
0
|
|
|
0
|
|
|
my ($self) = shift; |
275
|
|
|
|
|
|
|
|
276
|
0
|
|
|
|
|
|
my $chain = Bio::Structure::Chain->new(-id => "default"); |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
=head2 _grandparent() |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
Title : _grandparent |
283
|
|
|
|
|
|
|
Usage : |
284
|
|
|
|
|
|
|
Function: get/set a symbolic reference to our grandparent |
285
|
|
|
|
|
|
|
Returns : |
286
|
|
|
|
|
|
|
Args : |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=cut |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
sub _grandparent { |
291
|
0
|
|
|
0
|
|
|
my($self,$symref) = @_; |
292
|
|
|
|
|
|
|
|
293
|
0
|
0
|
|
|
|
|
if (ref($symref)) { |
294
|
0
|
|
|
|
|
|
$self->throw("Thou shall only pass strings in here, no references $symref\n"); |
295
|
|
|
|
|
|
|
} |
296
|
0
|
0
|
|
|
|
|
if (defined $symref) { |
297
|
0
|
|
|
|
|
|
$self->{'grandparent'} = $symref; |
298
|
|
|
|
|
|
|
} |
299
|
0
|
|
|
|
|
|
return $self->{'grandparent'}; |
300
|
|
|
|
|
|
|
} |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
1; |