EnsEMBL/RepeatConsensus.pm untested

filter: Statementstmt 0.0% 0 / 48 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 5 Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 8 totaltotal 0.0% 0 / 83 CC 6 SCAR 14.7
CC
6
Cov
0%
name
6.0
length
6.0
repeat_class
6.0
CRAP 4.4
1 =head1 LICENSE
2  
3 See the NOTICE file distributed with this work for additional information
4 regarding copyright ownership.
5  
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9  
10 http://www.apache.org/licenses/LICENSE-2.0
11  
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17  
18 =cut
19  
20  
21 =head1 CONTACT
22  
23 Please email comments or questions to the public Ensembl
24 developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
25  
26 Questions may also be sent to the Ensembl help desk at
27 <http://www.ensembl.org/Help/Contact>.
28  
29 =cut
30  
31 package Bio::EnsEMBL::RepeatConsensus;
32 $Bio::EnsEMBL::RepeatConsensus::VERSION = '114.0.0_50'; # TRIAL
33 $Bio::EnsEMBL::RepeatConsensus::VERSION = '114.0.050';
34 use strict;
35  
36 use Bio::EnsEMBL::Storable;
37 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
38  
39 use vars qw(@ISA);
40 @ISA = qw(Bio::EnsEMBL::Storable);
41  
42  
43 =head2 new
44  
45 Arg [NAME] : string (optional)
46 The name of this repeat consensus
47 Arg [LENGTH]: int (optional)
48 The length of the repeat consensus sequence
49 Arg [REPEAT_CLASS]: string (optional)
50 The type of repeat consensus
51 Arg [REPEAT_CONSENSUS]: string (optional)
52 The sequence of this repeat consensus
53 Arg [REPEAT_TYPE]: string
54 Its like class only more general
55 Arg [...]: Named arguments to superclass constructor
56 (see Bio::EnsEMBL::Storable)
57 Example : $rc = Bio::EnsEMBL::RepeatConsensus->new
58 (-REPEAT_CONSENSUS => 'AATG'
59 -NAME => '(AATG)n',
60 -REPEAT_CLASS => 'Simple_repeat',
61 -LENGTH => '4',
62 -DBID => 1023,
63 -ADAPTOR => $rc_adaptor);
64 Description: Creates a new Bio::EnsEMBL::RepeatConsensus object
65 Returntype : Bio::EnsEMBL::RepeatConsensus
66 Exceptions : none
67 Caller : RepeatFeatureAdaptors
68 Status : Stable
69  
70 =cut
71  
72 sub new {
73 my $caller = shift;
74  
75 my $class = ref($caller) || $caller;
76  
77 my $self = $class->SUPER::new(@_);
78  
79 my ($name, $length, $repeat_class, $repeat_consensus, $repeat_type ) =
80 rearrange(['NAME', 'LENGTH', 'REPEAT_CLASS', 'REPEAT_CONSENSUS', 'REPEAT_TYPE'], @_);
81  
82 $self->{'name'} = $name;
83 $self->{'length'} = $length;
84 $self->{'repeat_class'} = $repeat_class;
85 $self->{'repeat_consensus'} = $repeat_consensus;
86 $self->{'repeat_type'} = $repeat_type;
87  
88 return $self;
89 }
90  
91  
92 =head2 name
93  
94 Arg [1] : string $name (optional)
95 Example : $name = $repeat_consensus->name()
96 Description: Getter/Setter for the name of this repeat_consensus
97 Returntype : string
98 Exceptions : none
99 Caller : general
100 Status : Stable
101  
102 =cut
103  
104 sub name {
105 my $self = shift;
106 $self->{'name'} = shift if(@_);
107 return $self->{'name'};
108 }
109  
110  
111 =head2 length
112  
113 Arg [1] : int $length (optional)
114 Example : $length = $repeat_consensus->length()
115 Description: Getter/Setter for the length of this repeat_consensus
116 Returntype : int
117 Exceptions : none
118 Caller : general
119 Status : Stable
120  
121 =cut
122  
123 sub length {
124 my $self = shift;
125 $self->{'length'} = shift if(@_);
126 return $self->{'length'};
127 }
128  
129  
130 =head2 repeat_class
131  
132 Arg [1] : string $class (optional)
133 The class of
134 Example : $class = $repeat_consensus->repeat_class()
135 Description: Getter/Setter for the class of this repeat_consensus
136 Returntype : string
137 Exceptions : none
138 Caller : general
139 Status : Stable
140  
141 =cut
142  
143 sub repeat_class {
144 my $self = shift;
145 $self->{'repeat_class'} = shift if(@_);
146 return $self->{'repeat_class'};
147 }
148  
149 =head2 repeat_type
150  
151 Arg [1] : string $type (optional)
152 The type of the consensus
153 Example : $type = $repeat_consensus->repeat_type()
154 Description: Getter/Setter for the type of this repeat_consensus
155 Returntype : string
156 Exceptions : none
157 Caller : general
158  
159 =cut
160  
161 sub repeat_type {
162 my $self = shift;
163 $self->{'repeat_type'} = shift if(@_);
164 return $self->{'repeat_type'};
165 }
166  
167  
168 =head2 desc
169  
170 Arg [1] : none
171 Example : $desc = $repeat_consensus->desc()
172 Description: Getter for the description of this repeat consensus as extracted
173 from the repeat_class. This method is probably useless.
174 Returntype : string
175 Exceptions : none
176 Caller : general
177 Status : Medium risk
178  
179 =cut
180  
181 sub desc {
182 my $self = shift;
183 my $class = $self->repeat_class or return;
184 return "class=$class";
185 }
186  
187  
188  
189 =head2 repeat_consensus
190  
191 Arg [1] : string $consensus_seq (optional)
192 The sequence of this repeat consensus
193 Example : $consensus = $repeat_consensus->repeat_consensus();
194 Description: Getter/Setter for the sequence of this repeat_consensus.
195 Returntype : string
196 Exceptions : none
197 Caller : general
198  
199 =cut
200  
201 sub repeat_consensus {
202 my $self = shift;
203 $self->{'repeat_consensus'} = shift if(@_);
204 return $self->{'repeat_consensus'};
205 }
206  
207  
208  
209 =head2 seq
210  
211 Arg [1] : none
212 Example : none
213 Description: Returns the repeat consensus. This method is useless - Use
214 repeat_consensus() instead.
215 Returntype : string
216 Exceptions : none
217 Caller : general
218 Status : Stable
219  
220 =cut
221  
222 sub seq {
223 my( $self ) = @_;
224 return $self->repeat_consensus;
225 }
226  
227 1;
228  
229 __END__