Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/RepeatConsensus.pm @ 0:1f6dce3d34e0
Uploaded
author | mahtabm |
---|---|
date | Thu, 11 Apr 2013 02:01:53 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1f6dce3d34e0 |
---|---|
1 =head1 LICENSE | |
2 | |
3 Copyright (c) 1999-2012 The European Bioinformatics Institute and | |
4 Genome Research Limited. All rights reserved. | |
5 | |
6 This software is distributed under a modified Apache license. | |
7 For license details, please see | |
8 | |
9 http://www.ensembl.org/info/about/code_licence.html | |
10 | |
11 =head1 CONTACT | |
12 | |
13 Please email comments or questions to the public Ensembl | |
14 developers list at <dev@ensembl.org>. | |
15 | |
16 Questions may also be sent to the Ensembl help desk at | |
17 <helpdesk@ensembl.org>. | |
18 | |
19 =cut | |
20 | |
21 package Bio::EnsEMBL::RepeatConsensus; | |
22 | |
23 use strict; | |
24 | |
25 use Bio::EnsEMBL::Storable; | |
26 use Bio::EnsEMBL::Utils::Argument qw(rearrange); | |
27 use Scalar::Util qw(weaken isweak); | |
28 | |
29 use vars qw(@ISA); | |
30 @ISA = qw(Bio::EnsEMBL::Storable); | |
31 | |
32 | |
33 =head2 new | |
34 | |
35 Arg [NAME] : string (optional) | |
36 The name of this repeat consensus | |
37 Arg [LENGTH]: int (optional) | |
38 The length of the repeat consensus sequence | |
39 Arg [REPEAT_CLASS]: string (optional) | |
40 The type of repeat consensus | |
41 Arg [REPEAT_CONSENSUS]: string (optional) | |
42 The sequence of this repeat consensus | |
43 Arg [REPEAT_TYPE]: string | |
44 Its like class only more general | |
45 Arg [...]: Named arguments to superclass constructor | |
46 (see Bio::EnsEMBL::Storable) | |
47 Example : $rc = Bio::EnsEMBL::RepeatConsensus->new | |
48 (-REPEAT_CONSENSUS => 'AATG' | |
49 -NAME => '(AATG)n', | |
50 -REPEAT_CLASS => 'Simple_repeat', | |
51 -LENGTH => '4', | |
52 -DBID => 1023, | |
53 -ADAPTOR => $rc_adaptor); | |
54 Description: Creates a new Bio::EnsEMBL::RepeatConsensus object | |
55 Returntype : Bio::EnsEMBL::RepeatConsensus | |
56 Exceptions : none | |
57 Caller : RepeatFeatureAdaptors | |
58 Status : Stable | |
59 | |
60 =cut | |
61 | |
62 sub new { | |
63 my $caller = shift; | |
64 | |
65 my $class = ref($caller) || $caller; | |
66 | |
67 my $self = $class->SUPER::new(@_); | |
68 | |
69 my ($name, $length, $repeat_class, $repeat_consensus, $repeat_type ) = | |
70 rearrange(['NAME', 'LENGTH', 'REPEAT_CLASS', 'REPEAT_CONSENSUS', 'REPEAT_TYPE'], @_); | |
71 | |
72 $self->{'name'} = $name; | |
73 $self->{'length'} = $length; | |
74 $self->{'repeat_class'} = $repeat_class; | |
75 $self->{'repeat_consensus'} = $repeat_consensus; | |
76 $self->{'repeat_type'} = $repeat_type; | |
77 | |
78 return $self; | |
79 } | |
80 | |
81 | |
82 =head2 new_fast | |
83 | |
84 Arg [1] : hashref to bless as a new RepeatConsensus | |
85 | |
86 Description: Creates a new Bio::EnsEMBL::RepeatConsensus object | |
87 Returntype : Bio::EnsEMBL::RepeatConsensus | |
88 Exceptions : none | |
89 Caller : internal | |
90 Status : Stable | |
91 | |
92 =cut | |
93 | |
94 sub new_fast { | |
95 my $class = shift; | |
96 my $hashref = shift; | |
97 my $self = bless $hashref, $class; | |
98 weaken($self->{adaptor}) if ( ! isweak($self->{adaptor}) ); | |
99 return $self; | |
100 } | |
101 | |
102 | |
103 =head2 name | |
104 | |
105 Arg [1] : string $name (optional) | |
106 Example : $name = $repeat_consensus->name() | |
107 Description: Getter/Setter for the name of this repeat_consensus | |
108 Returntype : string | |
109 Exceptions : none | |
110 Caller : general | |
111 Status : Stable | |
112 | |
113 =cut | |
114 | |
115 sub name { | |
116 my $self = shift; | |
117 $self->{'name'} = shift if(@_); | |
118 return $self->{'name'}; | |
119 } | |
120 | |
121 | |
122 =head2 length | |
123 | |
124 Arg [1] : int $length (optional) | |
125 Example : $length = $repeat_consensus->length() | |
126 Description: Getter/Setter for the length of this repeat_consensus | |
127 Returntype : int | |
128 Exceptions : none | |
129 Caller : general | |
130 Status : Stable | |
131 | |
132 =cut | |
133 | |
134 sub length { | |
135 my $self = shift; | |
136 $self->{'length'} = shift if(@_); | |
137 return $self->{'length'}; | |
138 } | |
139 | |
140 | |
141 =head2 repeat_class | |
142 | |
143 Arg [1] : string $class (optional) | |
144 The class of | |
145 Example : $class = $repeat_consensus->repeat_class() | |
146 Description: Getter/Setter for the class of this repeat_consensus | |
147 Returntype : string | |
148 Exceptions : none | |
149 Caller : general | |
150 Status : Stable | |
151 | |
152 =cut | |
153 | |
154 sub repeat_class { | |
155 my $self = shift; | |
156 $self->{'repeat_class'} = shift if(@_); | |
157 return $self->{'repeat_class'}; | |
158 } | |
159 | |
160 =head2 repeat_type | |
161 | |
162 Arg [1] : string $type (optional) | |
163 The type of the consensus | |
164 Example : $type = $repeat_consensus->repeat_type() | |
165 Description: Getter/Setter for the type of this repeat_consensus | |
166 Returntype : string | |
167 Exceptions : none | |
168 Caller : general | |
169 | |
170 =cut | |
171 | |
172 sub repeat_type { | |
173 my $self = shift; | |
174 $self->{'repeat_type'} = shift if(@_); | |
175 return $self->{'repeat_type'}; | |
176 } | |
177 | |
178 | |
179 =head2 desc | |
180 | |
181 Arg [1] : none | |
182 Example : $desc = $repeat_consensus->desc() | |
183 Description: Getter for the description of this repeat consensus as extracted | |
184 from the repeat_class. This method is probably useless. | |
185 Returntype : string | |
186 Exceptions : none | |
187 Caller : general | |
188 Status : Medium risk | |
189 | |
190 =cut | |
191 | |
192 sub desc { | |
193 my $self = shift; | |
194 my $class = $self->repeat_class or return; | |
195 return "class=$class"; | |
196 } | |
197 | |
198 | |
199 | |
200 =head2 repeat_consensus | |
201 | |
202 Arg [1] : string $consensus_seq (optional) | |
203 The sequence of this repeat consensus | |
204 Example : $consensus = $repeat_consensus->repeat_consensus(); | |
205 Description: Getter/Setter for the sequence of this repeat_consensus. | |
206 Returntype : string | |
207 Exceptions : none | |
208 Caller : general | |
209 | |
210 =cut | |
211 | |
212 sub repeat_consensus { | |
213 my $self = shift; | |
214 $self->{'repeat_consensus'} = shift if(@_); | |
215 return $self->{'repeat_consensus'}; | |
216 } | |
217 | |
218 | |
219 | |
220 =head2 seq | |
221 | |
222 Arg [1] : none | |
223 Example : none | |
224 Description: Returns the repeat consensus. This method is useless - Use | |
225 repeat_consensus() instead. | |
226 Returntype : string | |
227 Exceptions : none | |
228 Caller : general | |
229 Status : Stable | |
230 | |
231 =cut | |
232 | |
233 sub seq { | |
234 my( $self ) = @_; | |
235 return $self->repeat_consensus; | |
236 } | |
237 | |
238 1; | |
239 | |
240 __END__ | |
241 | |
242 =head1 NAME - Bio::EnsEMBL::RepeatConsensus | |
243 | |
244 =head1 DESCRIPTION | |
245 | |
246 This object represents an entry in the | |
247 repeat_consensus table. | |
248 | |
249 It can contain the consensus sequence for a | |
250 repeat such as a particular Alu, or "cag" for a | |
251 simple triplet repeat. | |
252 | |
253 =head1 AUTHOR | |
254 | |
255 James Gilbert B<email> jgrg@sanger.ac.uk | |
256 |