Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/Variation/StructuralVariationAnnotation.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 # Ensembl module for Bio::EnsEMBL::Variation::StructuralVariationAnnotation | |
22 # | |
23 # Copyright (c) 2011 Ensembl | |
24 # | |
25 | |
26 | |
27 =head1 NAME | |
28 | |
29 Bio::EnsEMBL::Variation::StructuralVariationAnnotation - Annotations for a structural variant (sample and phenotype annotations). | |
30 | |
31 =head1 SYNOPSIS | |
32 | |
33 $study = $study_adaptor->fetch_by_name('nstd37'); | |
34 | |
35 $sva = Bio::EnsEMBL::Variation::StructuralVariationAnnotation->new | |
36 (-sample_name => 'ISCA_ID_5554', | |
37 -clinical_significance => 'Not tested', | |
38 -study => $study); | |
39 ... | |
40 | |
41 $sva->structural_variation->variation_name(),":", $sva->sample_name(); | |
42 | |
43 =head1 DESCRIPTION | |
44 | |
45 This is a class representing the annotation of a structural variant | |
46 from the ensembl-variation database. The actual structural variant information is | |
47 represented by an associated Bio::EnsEMBL::Variation::StructuralVariation object. | |
48 | |
49 =head1 METHODS | |
50 | |
51 =cut | |
52 | |
53 use strict; | |
54 use warnings; | |
55 | |
56 package Bio::EnsEMBL::Variation::StructuralVariationAnnotation; | |
57 | |
58 use Bio::EnsEMBL::Utils::Exception qw(throw warning); | |
59 use Bio::EnsEMBL::Utils::Argument qw(rearrange); | |
60 use Bio::EnsEMBL::Variation::BaseStructuralVariation; | |
61 use Bio::EnsEMBL::Storable; | |
62 use Bio::EnsEMBL::Utils::Exception qw(deprecate); | |
63 | |
64 use vars qw(@ISA); | |
65 | |
66 @ISA = qw(Bio::EnsEMBL::Storable); | |
67 | |
68 =head2 new | |
69 | |
70 Arg [-dbID] : | |
71 int - unique internal identifier for variation_annotation | |
72 | |
73 Arg [-ADAPTOR] : | |
74 Bio::EnsEMBL::Variation::DBSQL::StructuralVariationAnnotationAdaptor | |
75 Adaptor which provides database connectivity for this StructuralVariationAnnotation object | |
76 | |
77 Arg [-_PHENOTYPE_ID] : | |
78 int _ the internal id of the phenotype | |
79 | |
80 Arg [-PHENOTYPE_DESCRIPTION] : | |
81 string - description of the phenotype | |
82 | |
83 Arg [-SAMPLE_NAME] : | |
84 string - name of the associated sample | |
85 | |
86 Arg [-STRAIN_NAME] : | |
87 string - name of the associated strain | |
88 | |
89 Arg [-CLINICAL_SIGNIFICANCE] : | |
90 string - clinical annotation for this structural variant. | |
91 | |
92 Arg [-STUDY] : | |
93 object ref - the study object describing where the annotated variation comes from. | |
94 | |
95 Arg [_STRUCTURAL_VARIATION_ID] : | |
96 int _ the internal id of the structural variant object associated with this | |
97 identifier. TUsing this identifier the structural variant may be lazy-loaded from | |
98 the database on demand. | |
99 | |
100 Example : | |
101 $study = $study_adaptor->fetch_by_name('nstd37'); | |
102 | |
103 $sva = Bio::EnsEMBL::Variation::StructuralVariationAnnotation->new | |
104 (-sample_name => 'ISCA_ID_5554', | |
105 -strain_name => 'ISCA', | |
106 -clinical_significance => 'Not tested', | |
107 -study => $study); | |
108 | |
109 Description: Constructor. Instantiates a new StructuralVariationAnnotation object. | |
110 Returntype : Bio::EnsEMBL::Variation::StructuralVariationAnnotation | |
111 Exceptions : none | |
112 Caller : general | |
113 Status : At Risk | |
114 | |
115 =cut | |
116 | |
117 sub new { | |
118 my $caller = shift; | |
119 my $class = ref($caller) || $caller; | |
120 my $self = $class->SUPER::new(@_); | |
121 | |
122 my ($dbID,$adaptor,$phenotype_id,$phenotype_description,$structural_variation_id,$sample_name, | |
123 $strain_name,$clinical_significance,$study) = | |
124 rearrange([qw(dbID ADAPTOR _PHENOTYPE_ID PHENOTYPE_DESCRIPTION _STRUCTURAL_VARIATION_ID | |
125 SAMPLE_NAME STRAIN_NAME CLINICAL_SIGNIFICANCE STUDY)],@_); | |
126 | |
127 $self->{'dbID'} = $dbID; | |
128 $self->{'adaptor'} = $adaptor; | |
129 $self->{'_phenotype_id'} = $phenotype_id; | |
130 $self->{'phenotype_description'} = $phenotype_description; | |
131 $self->{'_structural_variation_id'} = $structural_variation_id; | |
132 $self->{'sample_name'} = $sample_name; | |
133 $self->{'strain_name'} = $strain_name; | |
134 $self->{'clinical_significance'} = $clinical_significance; | |
135 $self->{'study'} = $study; | |
136 return $self; | |
137 } | |
138 | |
139 | |
140 | |
141 sub new_fast { | |
142 my $class = shift; | |
143 my $hashref = shift; | |
144 return bless $hashref, $class; | |
145 } | |
146 | |
147 | |
148 =head2 structural_variation | |
149 | |
150 Arg [1] : (optional) Bio::EnsEMBL::Variation::StructuralVariation or | |
151 Bio::EnsEMBL::Variation::SupportingStructuralVariation $structural_variation | |
152 Example : $sv = $svf->structural_variation(); | |
153 Description: Getter/Setter for the structural variant associated with this feature. | |
154 If not set, and this StructuralVariationFeature has an associated adaptor | |
155 an attempt will be made to lazy-load the structural variation from the | |
156 database. | |
157 Returntype : Bio::EnsEMBL::Variation::StructuralVariation or Bio::EnsEMBL::Variation::SupportingStructuralVariation | |
158 Exceptions : throw on incorrect argument | |
159 Caller : general | |
160 Status : Stable | |
161 | |
162 =cut | |
163 | |
164 sub structural_variation { | |
165 my $self = shift; | |
166 | |
167 if(@_) { | |
168 if(!ref($_[0]) || (!$_[0]->isa('Bio::EnsEMBL::Variation::StructuralVariation') && | |
169 !$_[0]->isa('Bio::EnsEMBL::Variation::SupportingStructuralVariation') | |
170 )) { | |
171 throw("Bio::EnsEMBL::Variation::StructuralVariation or Bio::EnsEMBL::Variation::SupportingStructuralVariation argument expected"); | |
172 } | |
173 $self->{'_structural_variation_id'} = shift; | |
174 } | |
175 elsif(!defined($self->{'structural_variation'}) && $self->{'adaptor'} && | |
176 defined($self->{'_structural_variation_id'})) { | |
177 # lazy-load from database on demand | |
178 my $sva = $self->{'adaptor'}->db()->get_StructuralVariationAdaptor(); | |
179 $self->{'structural_variation'} = $sva->fetch_by_dbID($self->{'_structural_variation_id'}); | |
180 if (!defined($self->{'structural_variation'})) { | |
181 $sva = $self->{'adaptor'}->db()->get_SupportingStructuralVariationAdaptor(); | |
182 $self->{'structural_variation'} = $sva->fetch_by_dbID($self->{'_structural_variation_id'}); | |
183 } | |
184 } | |
185 | |
186 return $self->{'structural_variation'}; | |
187 } | |
188 | |
189 | |
190 =head2 study | |
191 | |
192 Arg [1] : Bio::EnsEMBL::Variation::Study (optional) | |
193 Example : $study = $sv->study() | |
194 Description: Getter/Setter for the study object | |
195 Returntype : Bio::EnsEMBL::Variation::Study | |
196 Exceptions : none | |
197 Caller : general | |
198 Status : At Risk | |
199 | |
200 =cut | |
201 | |
202 sub study { | |
203 my $self = shift; | |
204 return $self->{'study'} = shift if(@_); | |
205 return $self->{'study'}; | |
206 } | |
207 | |
208 | |
209 =head2 study_type | |
210 | |
211 Arg [1] : string study_type (optional) | |
212 The new value to set the study_type attribute to | |
213 Example : $study_type = $obj->study_type() | |
214 Description: Getter/Setter for the study_type attribute. | |
215 Returntype : string | |
216 Exceptions : none | |
217 Caller : general | |
218 Status : At Risk | |
219 | |
220 =cut | |
221 | |
222 sub study_type{ | |
223 my $self = shift; | |
224 return $self->{'study'}->type = shift if(@_); | |
225 return $self->{'study'}->type; | |
226 } | |
227 | |
228 | |
229 =head2 study_name | |
230 | |
231 Arg [1] : string $study_name (optional) | |
232 The new value to set the study_name attribute to | |
233 Example : $study = $sva->study_name() | |
234 Description: Getter/Setter for the study_name attribute | |
235 Returntype : string | |
236 Exceptions : none | |
237 Caller : general | |
238 Status : At Risk | |
239 | |
240 =cut | |
241 | |
242 sub study_name{ | |
243 my $self = shift; | |
244 return $self->{'study'}->name = shift if(@_); | |
245 return $self->{'study'}->name; | |
246 } | |
247 | |
248 | |
249 =head2 study_description | |
250 | |
251 Arg [1] : string $study_description (optional) | |
252 The new value to set the study_description attribute to | |
253 Example : $study_description = $obj->study_description() | |
254 Description: Getter/Setter for the study_description attribute | |
255 Returntype : string | |
256 Exceptions : none | |
257 Caller : general | |
258 Status : At Risk | |
259 | |
260 =cut | |
261 | |
262 sub study_description{ | |
263 my $self = shift; | |
264 return $self->{'study'}->description = shift if(@_); | |
265 return $self->{'study'}->description; | |
266 } | |
267 | |
268 | |
269 =head2 external_reference | |
270 | |
271 Arg [1] : string $newval (optional) | |
272 The new value to set the external reference attribute to | |
273 Example : $external_reference = $obj->external_reference() | |
274 Description: Getter/Setter for the external reference attribute. This is the | |
275 pubmed/id or project name associated with this study. | |
276 Returntype : string | |
277 Exceptions : none | |
278 Caller : general | |
279 Status : At Risk | |
280 | |
281 =cut | |
282 | |
283 sub external_reference{ | |
284 my $self = shift; | |
285 return $self->{'study'}->external_reference = shift if(@_); | |
286 return $self->{'study'}->external_reference; | |
287 } | |
288 | |
289 | |
290 =head2 study_url | |
291 | |
292 Arg [1] : string $newval (optional) | |
293 The new value to set the study_url attribute to | |
294 Example : $url = $obj->study_url() | |
295 Description: Getter/Setter for the study_url attribute. This is the link to the website where the data are stored. | |
296 Returntype : string | |
297 Exceptions : none | |
298 Caller : general | |
299 Status : At Risk | |
300 | |
301 =cut | |
302 | |
303 sub study_url{ | |
304 my $self = shift; | |
305 return $self->{'study'}->url = shift if(@_); | |
306 return $self->{'study'}->url; | |
307 } | |
308 | |
309 | |
310 =head2 sample_name | |
311 | |
312 Arg [1] : string sample_name (optional) | |
313 The new value to set the sample attribute to | |
314 Example : $sample_name = $obj->sample_name() | |
315 Description: Getter/Setter for the sample attribute. | |
316 Returntype : string | |
317 Exceptions : none | |
318 Caller : general | |
319 Status : At Risk | |
320 | |
321 =cut | |
322 | |
323 sub sample_name { | |
324 my $self = shift; | |
325 return $self->{'sample_name'} = shift if(@_); | |
326 return $self->{'sample_name'}; | |
327 } | |
328 | |
329 | |
330 =head2 strain_name | |
331 | |
332 Arg [1] : string strain_name (optional) | |
333 The new value to set the strain attribute to | |
334 Example : $strain_name = $obj->strain_name() | |
335 Description: Getter/Setter for the strain attribute. | |
336 Returntype : string | |
337 Exceptions : none | |
338 Caller : general | |
339 Status : At Risk | |
340 | |
341 =cut | |
342 | |
343 sub strain_name { | |
344 my $self = shift; | |
345 return $self->{'strain_name'} = shift if(@_); | |
346 return $self->{'strain_name'}; | |
347 } | |
348 | |
349 | |
350 =head2 phenotype_description | |
351 | |
352 Arg [1] : string phenotype_description (optional) | |
353 The new value to set the phenotype_description attribute to | |
354 Example : $phenotype_description = $obj->phenotype_description() | |
355 Description: Getter/Setter for the phenotype_description attribute. | |
356 Returntype : string | |
357 Exceptions : none | |
358 Caller : general | |
359 Status : At Risk | |
360 | |
361 =cut | |
362 | |
363 sub phenotype_description{ | |
364 my $self = shift; | |
365 return $self->{'phenotype_description'} = shift if(@_); | |
366 return $self->{'phenotype_description'}; | |
367 } | |
368 | |
369 | |
370 =head2 clinical_significance | |
371 | |
372 Arg [1] : string clinical_significance (optional) | |
373 The new value to set the clinical significance attribute to | |
374 Example : $clinical_significance = $obj->clinical_significance() | |
375 Description: Getter/Setter for the clinical significance attribute. | |
376 Returntype : string | |
377 Exceptions : none | |
378 Caller : general | |
379 Status : At Risk | |
380 | |
381 =cut | |
382 | |
383 sub clinical_significance { | |
384 my $self = shift; | |
385 return $self->{'clinical_significance'} = shift if(@_); | |
386 return $self->{'clinical_significance'}; | |
387 } | |
388 | |
389 1; |