Archive Ensembl HomeArchive Ensembl Home
SplicingEventFeatureAdaptor.pm
Go to the documentation of this file.
00001 =head1 LICENSE
00002 
00003   Copyright (c) 1999-2012 The European Bioinformatics Institute and
00004   Genome Research Limited.  All rights reserved.
00005 
00006   This software is distributed under a modified Apache license.
00007   For license details, please see
00008 
00009     http://www.ensembl.org/info/about/code_licence.html
00010 
00011 =head1 CONTACT
00012 
00013   Please email comments or questions to the public Ensembl
00014   developers list at <dev@ensembl.org>.
00015 
00016   Questions may also be sent to the Ensembl help desk at
00017   <helpdesk@ensembl.org>.
00018 
00019 =cut
00020 
00021 =head1 NAME
00022 
00023 Bio::EnsEMBL::DBSQL::SlicingEventFeatureAdaptor - Database adaptor for the retrieval and
00024 storage of SplicingEventFeature objects
00025 
00026 =head1 SYNOPSIS
00027 
00028   use Bio::EnsEMBL::Registry;
00029 
00030   Bio::EnsEMBL::Registry->load_registry_from_db(
00031     -host => 'ensembldb.ensembl.org',
00032     -user => 'anonymous',
00033   );
00034 
00035   $se_adaptor =
00036     Bio::EnsEMBL::Registry->get_adaptor( "human", "core", "SplicingEventFeature" );
00037 
00038 
00039 =head1 DESCRIPTION
00040 
00041 This is a database aware adaptor for the retrieval and storage of SlicingEventFeatures
00042 objects.
00043 
00044 =head1 METHODS
00045 
00046 =cut
00047 package Bio::EnsEMBL::DBSQL::SplicingEventFeatureAdaptor;
00048 
00049 use strict;
00050 
00051 use Bio::EnsEMBL::Utils::Exception qw( deprecate throw warning );
00052 use Bio::EnsEMBL::DBSQL::SliceAdaptor;
00053 use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;
00054 use Bio::EnsEMBL::DBSQL::DBAdaptor;
00055 use Bio::EnsEMBL::SplicingEventFeature;
00056 
00057 use vars '@ISA';
00058 @ISA = qw(Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor);
00059 
00060 
00061 
00062 sub fetch_all_by_SplicingEvent{
00063   my ($self, $splicing_event) = @_;
00064   
00065 
00066   my ($splicing_event_feature_id, $splicing_event_id, $exon_id, $transcript_id, $feature_order, $transcript_association, $type, $start, $end);
00067 
00068   $splicing_event_id = $splicing_event->dbID;
00069   
00070   my $sql = "select splicing_event_feature_id, exon_id, transcript_id, feature_order, transcript_association, type, start, end from splicing_event_feature where splicing_event_id = $splicing_event_id";
00071 
00072   my $sth = $self->prepare($sql);
00073 
00074   $sth->execute();
00075   $sth->bind_columns(\$splicing_event_feature_id, \$exon_id, \$transcript_id, \$feature_order, \$transcript_association, \$type, \$start, \$end);
00076 
00077   my @features;
00078 
00079   while($sth->fetch()){
00080     push( @features,
00081           $self->_create_feature_fast( 'Bio::EnsEMBL::SplicingEventFeature', {
00082                                     'start'     => $start,
00083                                     'end'       => $end,
00084                                     'adaptor'   => $self,
00085                                     'dbID'      => $splicing_event_feature_id,
00086                                     'exon_id'   => $exon_id,
00087                                     'transcript_id' => $transcript_id,
00088                                     'slice'     => $splicing_event->slice,
00089                                     'type'      => $type,
00090                     'feature_order'            => $feature_order,
00091                                     'transcript_association'   => $transcript_association 
00092                                   } ) );
00093     
00094   }
00095   $sth->finish;
00096   return \@features;
00097 
00098 }
00099 
00100 
00101 
00102 
00103 # _tables
00104 #  Arg [1]    : none
00105 #  Description: PROTECTED implementation of superclass abstract method.
00106 #               Returns the names, aliases of the tables to use for queries.
00107 #  Returntype : list of listrefs of strings
00108 #  Exceptions : none
00109 #  Caller     : internal
00110 #  Status     : At Risk
00111 
00112 sub _tables {
00113   my $self = shift;
00114 
00115   return ([ 'splicing_event_feature', 'sef' ]);
00116 }
00117 
00118 # _columns
00119 #  Arg [1]    : none
00120 #  Example    : none
00121 #  Description: PROTECTED implementation of superclass abstract method.
00122 #               Returns a list of columns to use for queries.
00123 #  Returntype : list of strings
00124 #  Exceptions : none
00125 #  Caller     : internal
00126 #  Status     : At Risk
00127 
00128 sub _columns {
00129   my $self = shift;
00130 
00131 #  my $created_date = $self->db->dbc->from_date_to_seconds("gsi.created_date");
00132 #  my $modified_date = $self->db->dbc->from_date_to_seconds("gsi.modified_date");
00133 
00134   return ( 'sef.splicing_event_id','sef.exon_id', 'sef.feature_order', 'sef.transcript_association', 'sef.type', 'sef.start', 'sef.end' );
00135 
00136 }
00137 
00138 sub list_dbIDs {
00139   my ($self,$ordered) = @_;
00140 
00141   return $self->_list_dbIDs("splicing_event_feature", undef, $ordered);
00142 }
00143 
00144 
00145 1;
00146 
00147