Archive Ensembl HomeArchive Ensembl Home
SplicingTranscriptPairAdaptor.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::SlicingTranscriptPairAdaptor - Database adaptor for the retrieval and
00024 storage of SplicingTranscriptPair 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", "SplicingTranscriptPair" );
00037 
00038 
00039 =head1 DESCRIPTION
00040 
00041 This is a database aware adaptor for the retrieval and storage of SplicingTranscriptPairs
00042 objects.
00043 
00044 =head1 METHODS
00045 
00046 =cut
00047 package Bio::EnsEMBL::DBSQL::SplicingTranscriptPairAdaptor;
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::SplicingTranscriptPair;
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_transcript_pair_id, $transcript_id_1, $transcript_id_2);
00067 
00068   my $splicing_event_id = $splicing_event->dbID;
00069   
00070   my $sql = "select splicing_transcript_pair_id, transcript_id_1, transcript_id_2 from splicing_transcript_pair where splicing_event_id = $splicing_event_id";
00071 
00072   my $sth = $self->prepare($sql);
00073 
00074   $sth->execute();
00075   $sth->bind_columns(\$splicing_transcript_pair_id, \$transcript_id_1, \$transcript_id_2);
00076 
00077   my @pairs;
00078 
00079   while($sth->fetch()){
00080     push( @pairs,
00081           $self->_create_feature_fast( 'Bio::EnsEMBL::SplicingTranscriptPair', {
00082                                     'adaptor'   => $self,
00083                                     'dbID'      => $splicing_transcript_pair_id,
00084                                     'transcript_id_1'   => $transcript_id_1,
00085                                     'transcript_id_2'   => $transcript_id_2,
00086                     'start'             => $splicing_event->start,
00087                                     'end'               => $splicing_event->end
00088                                   } ) );
00089     
00090   }
00091   $sth->finish;
00092   return \@pairs;
00093 
00094 }
00095 
00096 
00097 
00098 
00099 # _tables
00100 #  Arg [1]    : none
00101 #  Description: PROTECTED implementation of superclass abstract method.
00102 #               Returns the names, aliases of the tables to use for queries.
00103 #  Returntype : list of listrefs of strings
00104 #  Exceptions : none
00105 #  Caller     : internal
00106 #  Status     : At Risk
00107 
00108 sub _tables {
00109   my $self = shift;
00110 
00111   return ([ 'splicing_transcript_pair', 'stp' ]);
00112 }
00113 
00114 # _columns
00115 #  Arg [1]    : none
00116 #  Example    : none
00117 #  Description: PROTECTED implementation of superclass abstract method.
00118 #               Returns a list of columns to use for queries.
00119 #  Returntype : list of strings
00120 #  Exceptions : none
00121 #  Caller     : internal
00122 #  Status     : At Risk
00123 
00124 sub _columns {
00125   my $self = shift;
00126 
00127 #  my $created_date = $self->db->dbc->from_date_to_seconds("gsi.created_date");
00128 #  my $modified_date = $self->db->dbc->from_date_to_seconds("gsi.modified_date");
00129 
00130   return ( 'stp.splicing_transcript_pair_id','stp.transcript_id_1', 'stp.transcript_id_2');
00131 
00132 }
00133 
00134 sub list_dbIDs {
00135   my ($self,$ordered) = @_;
00136 
00137   return $self->_list_dbIDs("splicing_transcript_pair", undef, $ordered);
00138 }
00139 
00140 
00141 1;
00142 
00143