0
|
1
|
|
2 #
|
|
3 # Ensembl module for Bio::EnsEMBL::Compara::SitewiseOmega
|
|
4 #
|
|
5 # Cared for by Albert Vilella <avilella@ebi.ac.uk>
|
|
6 #
|
|
7 # Copyright Albert Vilella
|
|
8 #
|
|
9 # You may distribute this module under the same terms as perl itself
|
|
10
|
|
11 # POD documentation - main docs before the code
|
|
12
|
|
13 =head1 NAME
|
|
14
|
|
15 Bio::EnsEMBL::Compara::SitewiseOmega - DESCRIPTION of Object
|
|
16
|
|
17 =head1 SYNOPSIS
|
|
18
|
|
19 Give standard usage here
|
|
20
|
|
21 =head1 DESCRIPTION
|
|
22
|
|
23 Describe the object here
|
|
24
|
|
25 =head1 AUTHOR - Albert Vilella
|
|
26
|
|
27 This modules is part of the Ensembl project http://www.ensembl.org
|
|
28
|
|
29 Email avilella@ebi.ac.uk
|
|
30
|
|
31 Describe contact details here
|
|
32
|
|
33 =head1 APPENDIX
|
|
34
|
|
35 The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
|
|
36
|
|
37 =cut
|
|
38
|
|
39
|
|
40 # Let the code begin...
|
|
41
|
|
42
|
|
43 package Bio::EnsEMBL::Compara::SitewiseOmega;
|
|
44
|
|
45 use strict;
|
|
46
|
|
47 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
|
|
48 use Bio::EnsEMBL::Utils::Exception qw(warning deprecate throw);
|
|
49
|
|
50 =head2 new_fast
|
|
51
|
|
52 Arg [1] : hash reference $hashref
|
|
53 Example : none
|
|
54 Description: This is an ultra fast constructor which requires knowledge of
|
|
55 the objects internals to be used.
|
|
56 Returntype :
|
|
57 Exceptions : none
|
|
58 Caller :
|
|
59
|
|
60 =cut
|
|
61
|
|
62 sub new_fast {
|
|
63 my ($class, $hashref) = @_;
|
|
64
|
|
65 return bless $hashref, $class;
|
|
66 }
|
|
67
|
|
68 =head2 member_position
|
|
69
|
|
70 Arg [1] : Bio::EnsEMBL::Member $member
|
|
71 Arg [2] : Bio::SimpleAlign $aln
|
|
72 Example : $sitewise_omega->member_position($member,$aln);
|
|
73 Description: Obtain the member position for a given sitewise_omega value
|
|
74 Returntype : integer
|
|
75 Exceptions : return undef if member not in the alignment or aln_position not in member
|
|
76 Caller : general
|
|
77 Status : At risk
|
|
78
|
|
79 =cut
|
|
80
|
|
81 sub member_position {
|
|
82 my ($self, $member, $aln) = @_;
|
|
83
|
|
84 throw("$member is not a Bio::EnsEMBL::Compara::Member object")
|
|
85 unless ($member->isa("Bio::EnsEMBL::Compara::Member"));
|
|
86
|
|
87 throw("$aln is not a Bio::SimpleAlign object")
|
|
88 unless ($aln->isa("Bio::SimpleAlign"));
|
|
89
|
|
90 my @seqs = $aln->each_seq_with_id($member->stable_id);
|
|
91 my $seq = $seqs[0];
|
|
92
|
|
93 my $seq_location;
|
|
94 eval { $seq_location = $seq->location_from_column($self->aln_position);};
|
|
95 return undef if ($@);
|
|
96 my $location_type;
|
|
97 eval { $location_type = $seq_location->location_type;};
|
|
98 return undef if ($@);
|
|
99 if ($seq_location->location_type eq 'EXACT') {
|
|
100 my $member_position = $seq_location->start;
|
|
101 return $member_position;
|
|
102 }
|
|
103
|
|
104 return undef;
|
|
105 }
|
|
106
|
|
107 =head2 adaptor
|
|
108
|
|
109 Arg [1] : Bio::EnsEMBL::DBSQL::SitewiseOmegaAdaptor $adaptor
|
|
110 Example : $sitewise_omega->adaptor($adaptor);
|
|
111 Description: Getter/Setter for the adaptor this object used for database
|
|
112 interaction
|
|
113 Returntype : Bio::EnsEMBL::DBSQL::SitewiseOmegaAdaptor object
|
|
114 Exceptions : thrown if the argument is not a
|
|
115 Bio::EnsEMBL::DBSQL::SitewiseOmegaAdaptor object
|
|
116 Caller : general
|
|
117 Status : At risk
|
|
118
|
|
119 =cut
|
|
120
|
|
121 sub adaptor {
|
|
122 my ( $self, $adaptor ) = @_;
|
|
123
|
|
124 if (defined($adaptor)) {
|
|
125 throw("$adaptor is not a Bio::EnsEMBL::Compara::DBSQL::SitewiseOmegaAdaptor object")
|
|
126 unless ($adaptor->isa("Bio::EnsEMBL::Compara::DBSQL::SitewiseOmegaAdaptor"));
|
|
127 $self->{'adaptor'} = $adaptor;
|
|
128 }
|
|
129
|
|
130 return $self->{'adaptor'};
|
|
131 }
|
|
132
|
|
133 =head2 aln_position
|
|
134
|
|
135 Arg [1] : (opt) integer
|
|
136 Example : $sitewise_dnds->aln_position(1);
|
|
137 Description: Getter/Setter for the alignment position
|
|
138 Returntype : integer. Return 1 if value not defined
|
|
139 Exceptions : none
|
|
140 Caller : general
|
|
141 Status : At risk
|
|
142
|
|
143 =cut
|
|
144
|
|
145 sub aln_position {
|
|
146 my ($self, $aln_position) = @_;
|
|
147
|
|
148 if(defined $aln_position) {
|
|
149 $self->{'aln_position'} = $aln_position;
|
|
150 }
|
|
151
|
|
152 $self->{'aln_position'}= undef unless(defined($self->{'aln_position'}));
|
|
153 return $self->{'aln_position'};
|
|
154 }
|
|
155
|
|
156
|
|
157 =head2 omega
|
|
158
|
|
159 Arg [1] : (opt) integer
|
|
160 Example : $sitewise_dnds->omega(1);
|
|
161 Description: Getter/Setter for the omega value
|
|
162 Returntype : integer. Return 1 if value not defined
|
|
163 Exceptions : none
|
|
164 Caller : general
|
|
165 Status : At risk
|
|
166
|
|
167 =cut
|
|
168
|
|
169 sub omega {
|
|
170 my ($self, $omega) = @_;
|
|
171
|
|
172 if(defined $omega) {
|
|
173 $self->{'omega'} = $omega;
|
|
174 }
|
|
175
|
|
176 $self->{'omega'}= undef unless(defined($self->{'omega'}));
|
|
177 return $self->{'omega'};
|
|
178 }
|
|
179
|
|
180
|
|
181 =head2 omega_lower
|
|
182
|
|
183 Arg [1] : (opt) float
|
|
184 Example : $sitewise_dnds->omega_lower(1);
|
|
185 Description: Getter/Setter for the omega_lower value
|
|
186 Returntype : float. Return 1 if value not defined
|
|
187 Exceptions : none
|
|
188 Caller : general
|
|
189 Status : At risk
|
|
190
|
|
191 =cut
|
|
192
|
|
193 sub omega_lower {
|
|
194 my ($self, $omega_lower) = @_;
|
|
195
|
|
196 if(defined $omega_lower) {
|
|
197 $self->{'omega_lower'} = $omega_lower;
|
|
198 }
|
|
199
|
|
200 $self->{'omega_lower'}= undef unless(defined($self->{'omega_lower'}));
|
|
201 return $self->{'omega_lower'};
|
|
202 }
|
|
203
|
|
204
|
|
205 =head2 omega_upper
|
|
206
|
|
207 Arg [1] : (opt) float
|
|
208 Example : $sitewise_dnds->omega_upper(1);
|
|
209 Description: Getter/Setter for the omega_upper value
|
|
210 Returntype : float. Return 1 if value not defined
|
|
211 Exceptions : none
|
|
212 Caller : general
|
|
213 Status : At risk
|
|
214
|
|
215 =cut
|
|
216
|
|
217 sub omega_upper {
|
|
218 my ($self, $omega_upper) = @_;
|
|
219
|
|
220 if(defined $omega_upper) {
|
|
221 $self->{'omega_upper'} = $omega_upper;
|
|
222 }
|
|
223
|
|
224 $self->{'omega_upper'}= undef unless(defined($self->{'omega_upper'}));
|
|
225 return $self->{'omega_upper'};
|
|
226 }
|
|
227
|
|
228
|
|
229 =head2 optimal
|
|
230
|
|
231 Arg [1] : (opt) float
|
|
232 Example : $sitewise_dnds->optimal(1);
|
|
233 Description: Getter/Setter for the optimal value
|
|
234 Returntype : float. Return 1 if value not defined
|
|
235 Exceptions : none
|
|
236 Caller : general
|
|
237 Status : At risk
|
|
238
|
|
239 =cut
|
|
240
|
|
241 sub optimal {
|
|
242 my ($self, $optimal) = @_;
|
|
243
|
|
244 if(defined $optimal) {
|
|
245 $self->{'optimal'} = $optimal;
|
|
246 }
|
|
247
|
|
248 $self->{'optimal'}= undef unless(defined($self->{'optimal'}));
|
|
249 return $self->{'optimal'};
|
|
250 }
|
|
251
|
|
252
|
|
253 =head2 threshold_on_branch_ds
|
|
254
|
|
255 Arg [1] : (opt) float
|
|
256 Example : $sitewise_dnds->threshold_on_branch_ds(1);
|
|
257 Description: Getter/Setter for the threshold_on_branch_ds value
|
|
258 Returntype : float. Return 1 if value not defined
|
|
259 Exceptions : none
|
|
260 Caller : general
|
|
261 Status : At risk
|
|
262
|
|
263 =cut
|
|
264
|
|
265 sub threshold_on_branch_ds {
|
|
266 my ($self, $threshold_on_branch_ds) = @_;
|
|
267
|
|
268 if(defined $threshold_on_branch_ds) {
|
|
269 $self->{'threshold_on_branch_ds'} = $threshold_on_branch_ds;
|
|
270 }
|
|
271
|
|
272 $self->{'threshold_on_branch_ds'}= undef unless(defined($self->{'threshold_on_branch_ds'}));
|
|
273 return $self->{'threshold_on_branch_ds'};
|
|
274 }
|
|
275
|
|
276 =head2 type
|
|
277
|
|
278 Arg [1] : (opt) integer
|
|
279 Example : $sitewise_dnds->type(1);
|
|
280 Description: Getter/Setter for the type value
|
|
281 Returntype : integer. Return 1 if value not defined
|
|
282 Exceptions : none
|
|
283 Caller : general
|
|
284 Status : At risk
|
|
285
|
|
286 =cut
|
|
287
|
|
288 sub type {
|
|
289 my ($self, $type) = @_;
|
|
290
|
|
291 if(defined $type) {
|
|
292 $self->{'type'} = $type;
|
|
293 }
|
|
294
|
|
295 $self->{'type'}= undef unless(defined($self->{'type'}));
|
|
296 return $self->{'type'};
|
|
297 }
|
|
298
|
|
299
|
|
300 =head2 node_id
|
|
301
|
|
302 Arg [1] : (opt) integer
|
|
303 Example : $sitewise_dnds->node_id(1);
|
|
304 Description: Getter/Setter for the node_id value
|
|
305 Returnnode_id : integer. Return 1 if value not defined
|
|
306 Exceptions : none
|
|
307 Caller : general
|
|
308 Status : At risk
|
|
309
|
|
310 =cut
|
|
311
|
|
312 sub node_id {
|
|
313 my ($self, $node_id) = @_;
|
|
314
|
|
315 if(defined $node_id) {
|
|
316 $self->{'node_id'} = $node_id;
|
|
317 }
|
|
318
|
|
319 $self->{'node_id'}= undef unless(defined($self->{'node_id'}));
|
|
320 return $self->{'node_id'};
|
|
321 }
|
|
322
|
|
323 =head2 tree_node_id
|
|
324
|
|
325 Arg [1] : (opt) integer
|
|
326 Example : $sitewise_dnds->tree_node_id(1);
|
|
327 Description: Getter/Setter for the tree_node_id value
|
|
328 Returntree_node_id : integer. Return 1 if value not defined
|
|
329 Exceptions : none
|
|
330 Caller : general
|
|
331 Status : At risk
|
|
332
|
|
333 =cut
|
|
334
|
|
335 sub tree_node_id {
|
|
336 my ($self, $tree_node_id) = @_;
|
|
337
|
|
338 if(defined $tree_node_id) {
|
|
339 $self->{'tree_node_id'} = $tree_node_id;
|
|
340 }
|
|
341
|
|
342 $self->{'tree_node_id'}= undef unless(defined($self->{'tree_node_id'}));
|
|
343 return $self->{'tree_node_id'};
|
|
344 }
|
|
345
|
|
346
|
|
347 sub dbID {
|
|
348 my ($self, $dbID) = @_;
|
|
349
|
|
350 if(defined $dbID) {
|
|
351 $self->{'_dbID'} = $dbID;
|
|
352 }
|
|
353
|
|
354 $self->{'_dbID'}= undef unless(defined($self->{'_dbID'}));
|
|
355 return $self->{'_dbID'};
|
|
356 }
|
|
357
|
|
358
|
|
359
|
|
360
|
|
361 1;
|