Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/Variation/MotifFeatureVariation.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::Variation::MotifFeatureVariation; | |
22 | |
23 use strict; | |
24 use warnings; | |
25 | |
26 use Bio::EnsEMBL::Variation::MotifFeatureVariationAllele; | |
27 use Bio::EnsEMBL::Variation::Utils::VariationEffect qw(overlap); | |
28 | |
29 use base qw(Bio::EnsEMBL::Variation::RegulationVariation); | |
30 | |
31 sub new { | |
32 my $class = shift; | |
33 | |
34 my %args = @_; | |
35 | |
36 # swap a '-motif_feature' argument for a '-feature' one for the superclass | |
37 | |
38 for my $arg (keys %args) { | |
39 if (lc($arg) eq '-motif_feature') { | |
40 $args{'-feature'} = delete $args{$arg}; | |
41 } | |
42 } | |
43 | |
44 # call the superclass constructor | |
45 my $self = $class->SUPER::new(%args) || return undef; | |
46 | |
47 # rebless the alleles from vfoas to mfvas | |
48 map { bless $_, 'Bio::EnsEMBL::Variation::MotifFeatureVariationAllele' } | |
49 @{ $self->get_all_MotifFeatureVariationAlleles }; | |
50 | |
51 return $self; | |
52 } | |
53 | |
54 sub motif_feature_stable_id { | |
55 my $self = shift; | |
56 return $self->SUPER::feature_stable_id(@_); | |
57 } | |
58 | |
59 sub motif_feature { | |
60 my ($self, $mf) = @_; | |
61 return $self->SUPER::feature($mf, 'MotifFeature'); | |
62 } | |
63 | |
64 sub add_MotifFeatureVariationAllele { | |
65 my $self = shift; | |
66 return $self->SUPER::add_VariationFeatureOverlapAllele(@_); | |
67 } | |
68 | |
69 sub get_reference_MotifFeatureVariationAllele { | |
70 my $self = shift; | |
71 return $self->SUPER::get_reference_VariationFeatureOverlapAllele(@_); | |
72 } | |
73 | |
74 sub get_all_alternate_MotifFeatureVariationAlleles { | |
75 my $self = shift; | |
76 return $self->SUPER::get_all_alternate_VariationFeatureOverlapAlleles(@_); | |
77 } | |
78 | |
79 sub get_all_MotifFeatureVariationAlleles { | |
80 my $self = shift; | |
81 return $self->SUPER::get_all_VariationFeatureOverlapAlleles(@_); | |
82 } | |
83 | |
84 sub _motif_feature_seq { | |
85 my $self = shift; | |
86 | |
87 my $mf = $self->motif_feature; | |
88 | |
89 my $mf_seq = $mf->{_variation_effect_feature_cache}->{seq} ||= $mf->seq; | |
90 | |
91 return $mf_seq; | |
92 } | |
93 | |
94 1; |