line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# bioperl module for Bio::Structure::Residue |
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::Residue - Bioperl structure Object, describes a Residue |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#add synopsis here |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This object stores a Bio::Structure::Residue |
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
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
package Bio::Structure::Residue; |
70
|
2
|
|
|
2
|
|
1547
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
55
|
|
71
|
|
|
|
|
|
|
|
72
|
2
|
|
|
2
|
|
8
|
use Bio::Structure::Chain; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
34
|
|
73
|
2
|
|
|
2
|
|
272
|
use Bio::Structure::Atom; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
43
|
|
74
|
2
|
|
|
2
|
|
10
|
use base qw(Bio::Root::Root); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
700
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 new() |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Title : new() |
80
|
|
|
|
|
|
|
Usage : $residue = Bio::Structure::Residue->new( |
81
|
|
|
|
|
|
|
-id => 'human_id', |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Function: Returns a new Bio::Structure::Residue object from basic |
85
|
|
|
|
|
|
|
constructors. Probably most called from Bio::Structure::IO. |
86
|
|
|
|
|
|
|
Returns : a new Bio::Structure::Residue object |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub new { |
92
|
161
|
|
|
161
|
1
|
679
|
my ($class, @args) = @_; |
93
|
161
|
|
|
|
|
321
|
my $self = $class->SUPER::new(@args); |
94
|
|
|
|
|
|
|
|
95
|
161
|
|
|
|
|
396
|
my($id, $atom ) = |
96
|
|
|
|
|
|
|
$self->_rearrange([qw( |
97
|
|
|
|
|
|
|
ID |
98
|
|
|
|
|
|
|
ATOM |
99
|
|
|
|
|
|
|
)], |
100
|
|
|
|
|
|
|
@args); |
101
|
|
|
|
|
|
|
|
102
|
161
|
100
|
|
|
|
255
|
$id && $self->id($id); |
103
|
|
|
|
|
|
|
|
104
|
161
|
|
|
|
|
277
|
$self->{'atom'} = []; |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# the 'smallest' (and only) item that can be added to a residue is an atom |
107
|
|
|
|
|
|
|
|
108
|
161
|
50
|
|
|
|
217
|
$atom && $self->throw("add atoms via an Entry object entry->add_atom(residue,atom)\n"); |
109
|
|
|
|
|
|
|
|
110
|
161
|
|
|
|
|
233
|
return $self; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 atom() |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Title : atom |
118
|
|
|
|
|
|
|
Usage : |
119
|
|
|
|
|
|
|
Function: nothing useful until I get symbolic references to do what I want |
120
|
|
|
|
|
|
|
Returns : |
121
|
|
|
|
|
|
|
Args : |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=cut |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
sub atom { |
126
|
0
|
|
|
0
|
1
|
0
|
my ($self,$value) = @_; |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
0
|
$self->throw("no code down here, go see an Entry object nearby\n"); |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 add_atom() |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Title : add_atom |
135
|
|
|
|
|
|
|
Usage : |
136
|
|
|
|
|
|
|
Function: nothing useful until I get symbolic references to do what I want |
137
|
|
|
|
|
|
|
Returns : |
138
|
|
|
|
|
|
|
Args : |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub add_atom { |
143
|
0
|
|
|
0
|
1
|
0
|
my($self,$value) = @_; |
144
|
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
0
|
$self->throw("nothing here, use a method on an Entry object\n"); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head2 chain() |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Title : chain |
152
|
|
|
|
|
|
|
Usage : $chain = $residue->chain($chain) |
153
|
|
|
|
|
|
|
Function: Sets the Chain this Residue belongs to |
154
|
|
|
|
|
|
|
Returns : Returns the Chain this Residue belongs to |
155
|
|
|
|
|
|
|
Args : reference to a Chain |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=cut |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub chain { |
160
|
0
|
|
|
0
|
1
|
0
|
my($self, $value) = @_; |
161
|
|
|
|
|
|
|
|
162
|
0
|
|
|
|
|
0
|
$self->throw("use an Entry based method please\n"); |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=head2 id() |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
Title : id |
169
|
|
|
|
|
|
|
Usage : $residue->id("TRP-35") |
170
|
|
|
|
|
|
|
Function: Gets/sets the ID for this residue |
171
|
|
|
|
|
|
|
Returns : the ID |
172
|
|
|
|
|
|
|
Args : the ID |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=cut |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub id { |
177
|
220
|
|
|
220
|
1
|
284
|
my ($self, $value) = @_;; |
178
|
220
|
100
|
|
|
|
303
|
if (defined $value) { |
179
|
158
|
|
|
|
|
203
|
$self->{'id'} = $value; |
180
|
|
|
|
|
|
|
} |
181
|
220
|
|
|
|
|
367
|
return $self->{'id'}; |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head2 DESTROY() |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
Title : DESTROY |
188
|
|
|
|
|
|
|
Usage : |
189
|
|
|
|
|
|
|
Function: destructor ( get rid of circular references ) |
190
|
|
|
|
|
|
|
Returns : |
191
|
|
|
|
|
|
|
Args : |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=cut |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub DESTROY { |
196
|
161
|
|
|
161
|
|
328
|
my $self = shift; |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
# no specific destruction for now |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
# |
203
|
|
|
|
|
|
|
# from here on only private methods |
204
|
|
|
|
|
|
|
# |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head2 _remove_atoms() |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Title : _remove_atoms |
209
|
|
|
|
|
|
|
Usage : |
210
|
|
|
|
|
|
|
Function: Removes the atoms attached to a Residue. Tells the atoms they |
211
|
|
|
|
|
|
|
don't belong to this Residue any more |
212
|
|
|
|
|
|
|
Returns : |
213
|
|
|
|
|
|
|
Args : |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=cut |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub _remove_atoms { |
218
|
0
|
|
|
0
|
|
0
|
my ($self) = shift; |
219
|
|
|
|
|
|
|
|
220
|
0
|
|
|
|
|
0
|
$self->throw("no code here\n"); |
221
|
|
|
|
|
|
|
} |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=head2 _remove_chain() |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
Title : _remove_chain |
227
|
|
|
|
|
|
|
Usage : |
228
|
|
|
|
|
|
|
Function: Removes the Chain this Residue is atttached to. |
229
|
|
|
|
|
|
|
Returns : |
230
|
|
|
|
|
|
|
Args : |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=cut |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
sub _remove_chain { |
235
|
0
|
|
|
0
|
|
0
|
my ($self) = shift; |
236
|
|
|
|
|
|
|
|
237
|
0
|
|
|
|
|
0
|
$self->{'chain'} = undef; |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
=head2 _grandparent() |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
Title : _grandparent |
244
|
|
|
|
|
|
|
Usage : |
245
|
|
|
|
|
|
|
Function: get/set a symbolic reference to our grandparent |
246
|
|
|
|
|
|
|
Returns : |
247
|
|
|
|
|
|
|
Args : |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=cut |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
sub _grandparent { |
252
|
160
|
|
|
160
|
|
218
|
my($self,$symref) = @_; |
253
|
|
|
|
|
|
|
|
254
|
160
|
50
|
|
|
|
223
|
if (ref($symref)) { |
255
|
0
|
|
|
|
|
0
|
$self->throw("Thou shall only pass strings in here, no references $symref\n"); |
256
|
|
|
|
|
|
|
} |
257
|
160
|
50
|
|
|
|
198
|
if (defined $symref) { |
258
|
160
|
|
|
|
|
226
|
$self->{'grandparent'} = $symref; |
259
|
|
|
|
|
|
|
} |
260
|
160
|
|
|
|
|
245
|
return $self->{'grandparent'}; |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
1; |