Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/SplicingEvent.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 | |
| 2 =head1 LICENSE | |
| 3 | |
| 4 Copyright (c) 1999-2012 The European Bioinformatics Institute and | |
| 5 Genome Research Limited. All rights reserved. | |
| 6 | |
| 7 This software is distributed under a modified Apache license. | |
| 8 For license details, please see | |
| 9 | |
| 10 http://www.ensembl.org/info/about/code_licence.html | |
| 11 | |
| 12 =head1 CONTACT | |
| 13 | |
| 14 Please email comments or questions to the public Ensembl | |
| 15 developers list at <dev@ensembl.org>. | |
| 16 | |
| 17 Questions may also be sent to the Ensembl help desk at | |
| 18 <helpdesk@ensembl.org>. | |
| 19 | |
| 20 =cut | |
| 21 | |
| 22 =head1 NAME | |
| 23 | |
| 24 Bio::EnsEMBL::SlicingEvent - Object representing an alternative splicing event | |
| 25 | |
| 26 =head1 SYNOPSIS | |
| 27 | |
| 28 my $ase = | |
| 29 Bio::EnsEMBL::SplicingEvent->new( -START => 123, | |
| 30 -END => 1045, | |
| 31 -STRAND => 1, | |
| 32 -GENE_ID => $gene->dbID, | |
| 33 -SLICE => $slice ); | |
| 34 | |
| 35 # set some additional attributes | |
| 36 $ase->name('ENSG00000000003-CNE-3'); | |
| 37 $ase->type('CNE'); | |
| 38 | |
| 39 =head1 DESCRIPTION | |
| 40 | |
| 41 A representation of an Alternative Splicing Event within the Ensembl system. | |
| 42 | |
| 43 =head1 METHODS | |
| 44 | |
| 45 =cut | |
| 46 | |
| 47 package Bio::EnsEMBL::SplicingEvent; | |
| 48 | |
| 49 use strict; | |
| 50 | |
| 51 use POSIX; | |
| 52 use Bio::EnsEMBL::Feature; | |
| 53 use Bio::EnsEMBL::Utils::Argument qw(rearrange); | |
| 54 use Bio::EnsEMBL::Utils::Exception qw(throw warning deprecate); | |
| 55 | |
| 56 use vars qw(@ISA); | |
| 57 @ISA = qw(Bio::EnsEMBL::Feature); | |
| 58 | |
| 59 ## Add to gene get_all_splicing_events | |
| 60 | |
| 61 sub gene_id { | |
| 62 my ( $self, $value ) = @_; | |
| 63 | |
| 64 if ( defined($value) ) { | |
| 65 $self->{'gene_id'} = $value; | |
| 66 } | |
| 67 | |
| 68 return $self->{'gene_id'}; | |
| 69 } | |
| 70 | |
| 71 sub name { | |
| 72 my ( $self, $value ) = @_; | |
| 73 | |
| 74 if ( defined($value) ) { | |
| 75 $self->{'name'} = $value; | |
| 76 } | |
| 77 | |
| 78 return $self->{'name'}; | |
| 79 } | |
| 80 | |
| 81 sub type { | |
| 82 my ( $self, $value ) = @_; | |
| 83 | |
| 84 if ( defined($value) ) { | |
| 85 $self->{'type'} = $value; | |
| 86 } | |
| 87 | |
| 88 return $self->{'type'}; | |
| 89 } | |
| 90 | |
| 91 sub add_Feature { | |
| 92 my ( $self, $feature ) = @_; | |
| 93 | |
| 94 if ( !ref($feature) | |
| 95 || !$feature->isa("Bio::EnsEMBL::SplicingEventFeature") ) | |
| 96 { | |
| 97 throw("$feature is not a Bio::EnsEMBL::SplicingEventFeature!"); | |
| 98 } | |
| 99 | |
| 100 $self->{'_feature_array'} ||= []; | |
| 101 | |
| 102 push( @{ $self->{'_feature_array'} }, $feature ); | |
| 103 } | |
| 104 | |
| 105 sub get_all_Features { | |
| 106 my ($self) = @_; | |
| 107 | |
| 108 if ( !exists( $self->{'_feature_array'} ) ) { | |
| 109 if ( defined( $self->adaptor() ) ) { | |
| 110 my $fta = | |
| 111 $self->adaptor()->db()->get_SplicingEventFeatureAdaptor(); | |
| 112 my $features = $fta->fetch_all_by_SplicingEvent($self); | |
| 113 $self->{'_feature_array'} = $features; | |
| 114 } | |
| 115 } | |
| 116 | |
| 117 return $self->{'_feature_array'}; | |
| 118 } | |
| 119 | |
| 120 sub add_Pair { | |
| 121 my ( $self, $feature ) = @_; | |
| 122 | |
| 123 if ( !ref($feature) | |
| 124 || !$feature->isa("Bio::EnsEMBL::SplicingEventPair") ) | |
| 125 { | |
| 126 throw("$feature is not a Bio::EnsEMBL::SplicingEventPair!"); | |
| 127 } | |
| 128 | |
| 129 $self->{'_pair_array'} ||= []; | |
| 130 | |
| 131 push( @{ $self->{'_pair_array'} }, $feature ); | |
| 132 } | |
| 133 | |
| 134 sub get_all_Pairs { | |
| 135 my ($self) = @_; | |
| 136 | |
| 137 if ( !exists( $self->{'_pair_array'} ) ) { | |
| 138 if ( defined( $self->adaptor() ) ) { | |
| 139 my $pa = | |
| 140 $self->adaptor()->db()->get_SplicingTranscriptPairAdaptor(); | |
| 141 my $pairs = $pa->fetch_all_by_SplicingEvent($self); | |
| 142 $self->{'_pair_array'} = $pairs; | |
| 143 } | |
| 144 } | |
| 145 | |
| 146 return $self->{'_pair_array'}; | |
| 147 } | |
| 148 | |
| 149 1; |
