Commit 156c9d33 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Quick makeover, since I just had a look at the SplicingEventAdaptor.

parent 385f415d
=head1 LICENSE =head1 LICENSE
Copyright (c) 1999-2010 The European Bioinformatics Institute and Copyright (c) 1999-2010 The European Bioinformatics Institute and
...@@ -24,13 +25,12 @@ Bio::EnsEMBL::SlicingEvent - Object representing an alternative splicing event ...@@ -24,13 +25,12 @@ Bio::EnsEMBL::SlicingEvent - Object representing an alternative splicing event
=head1 SYNOPSIS =head1 SYNOPSIS
my $ase = Bio::EnsEMBL::SplicingEvent->new( my $ase =
-START => 123, Bio::EnsEMBL::SplicingEvent->new( -START => 123,
-END => 1045, -END => 1045,
-STRAND => 1, -STRAND => 1,
-GENE_ID => $gene->dbID, -GENE_ID => $gene->dbID,
-SLICE => $slice -SLICE => $slice );
);
# set some additional attributes # set some additional attributes
$ase->name('ENSG00000000003-CNE-3'); $ase->name('ENSG00000000003-CNE-3');
...@@ -56,94 +56,94 @@ use Bio::EnsEMBL::Utils::Exception qw(throw warning deprecate); ...@@ -56,94 +56,94 @@ use Bio::EnsEMBL::Utils::Exception qw(throw warning deprecate);
use vars qw(@ISA); use vars qw(@ISA);
@ISA = qw(Bio::EnsEMBL::Feature); @ISA = qw(Bio::EnsEMBL::Feature);
## Add to gene get_all_splicing_events ## Add to gene get_all_splicing_events
sub gene_id {
my ( $self, $value ) = @_;
if ( defined($value) ) {
sub gene_id{ $self->{'gene_id'} = $value;
my $self = shift;
$self->{'gene_id'} = shift if (@_);
if (defined $self->{'gene_id'}) {
return $self->{'gene_id'};
} }
return undef; return $self->{'gene_id'};
} }
sub name{ sub name {
my $self = shift; my ( $self, $value ) = @_;
$self->{'name'} = shift if (@_);
if (defined $self->{'name'}) { if ( defined($value) ) {
return $self->{'name'}; $self->{'name'} = $value;
} }
return undef; return $self->{'name'};
} }
sub type{ sub type {
my $self = shift; my ( $self, $value ) = @_;
$self->{'type'} = shift if (@_);
if (defined $self->{'type'}) { if ( defined($value) ) {
return $self->{'type'}; $self->{'type'} = $value;
} }
return undef; return $self->{'type'};
} }
sub add_Feature{ sub add_Feature {
my ($self, $feat) = @_; my ( $self, $feature ) = @_;
if( !ref $feat || ! $feat->isa("Bio::EnsEMBL::SplicingEventFeature") ) { if ( !ref($feature)
throw("$feat is not a Bio::EnsEMBL::SplicingEventFeature!"); || !$feature->isa("Bio::EnsEMBL::SplicingEventFeature") )
} {
throw("$feature is not a Bio::EnsEMBL::SplicingEventFeature!");
}
$self->{'_feature_array'} ||= []; $self->{'_feature_array'} ||= [];
push(@{$self->{'_feature_array'}},$feat);
}
push( @{ $self->{'_feature_array'} }, $feature );
}
sub get_all_Features { sub get_all_Features {
my $self = shift; my ($self) = @_;
if( ! exists $self->{'_feature_array'} ) { if ( !exists( $self->{'_feature_array'} ) ) {
if( defined $self->adaptor() ) { if ( defined( $self->adaptor() ) ) {
my $fta = $self->adaptor()->db()->get_SplicingEventFeatureAdaptor(); my $fta =
my $features = $fta->fetch_all_by_SplicingEvent( $self ); $self->adaptor()->db()->get_SplicingEventFeatureAdaptor();
my $features = $fta->fetch_all_by_SplicingEvent($self);
$self->{'_feature_array'} = $features; $self->{'_feature_array'} = $features;
} }
} }
return $self->{'_feature_array'}; return $self->{'_feature_array'};
} }
sub add_Pair{ sub add_Pair {
my ($self, $feat) = @_; my ( $self, $feature ) = @_;
if( !ref $feat || ! $feat->isa("Bio::EnsEMBL::SplicingEventPair") ) { if ( !ref($feature)
throw("$feat is not a Bio::EnsEMBL::SplicingEventPair!"); || !$feature->isa("Bio::EnsEMBL::SplicingEventPair") )
} {
throw("$feature is not a Bio::EnsEMBL::SplicingEventPair!");
}
$self->{'_pair_array'} ||= []; $self->{'_pair_array'} ||= [];
push(@{$self->{'_pair_array'}},$feat);
}
push( @{ $self->{'_pair_array'} }, $feature );
}
sub get_all_Pairs { sub get_all_Pairs {
my $self = shift; my ($self) = @_;
if( ! exists $self->{'_pair_array'} ) { if ( !exists( $self->{'_pair_array'} ) ) {
if( defined $self->adaptor() ) { if ( defined( $self->adaptor() ) ) {
my $pa = $self->adaptor()->db()->get_SplicingTranscriptPairAdaptor(); my $pa =
my $pairs = $pa->fetch_all_by_SplicingEvent( $self ); $self->adaptor()->db()->get_SplicingTranscriptPairAdaptor();
my $pairs = $pa->fetch_all_by_SplicingEvent($self);
$self->{'_pair_array'} = $pairs; $self->{'_pair_array'} = $pairs;
} }
} }
return $self->{'_pair_array'}; return $self->{'_pair_array'};
} }
1; 1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment