comparison variant_effect_predictor/Bio/EnsEMBL/DBSQL/SplicingTranscriptPairAdaptor.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 =head1 NAME
22
23 Bio::EnsEMBL::DBSQL::SlicingTranscriptPairAdaptor - Database adaptor for the retrieval and
24 storage of SplicingTranscriptPair objects
25
26 =head1 SYNOPSIS
27
28 use Bio::EnsEMBL::Registry;
29
30 Bio::EnsEMBL::Registry->load_registry_from_db(
31 -host => 'ensembldb.ensembl.org',
32 -user => 'anonymous',
33 );
34
35 $se_adaptor =
36 Bio::EnsEMBL::Registry->get_adaptor( "human", "core", "SplicingTranscriptPair" );
37
38
39 =head1 DESCRIPTION
40
41 This is a database aware adaptor for the retrieval and storage of SplicingTranscriptPairs
42 objects.
43
44 =head1 METHODS
45
46 =cut
47 package Bio::EnsEMBL::DBSQL::SplicingTranscriptPairAdaptor;
48
49 use strict;
50
51 use Bio::EnsEMBL::Utils::Exception qw( deprecate throw warning );
52 use Bio::EnsEMBL::DBSQL::SliceAdaptor;
53 use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;
54 use Bio::EnsEMBL::DBSQL::DBAdaptor;
55 use Bio::EnsEMBL::SplicingTranscriptPair;
56
57 use vars '@ISA';
58 @ISA = qw(Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor);
59
60
61
62 sub fetch_all_by_SplicingEvent{
63 my ($self, $splicing_event) = @_;
64
65
66 my ($splicing_transcript_pair_id, $transcript_id_1, $transcript_id_2);
67
68 my $splicing_event_id = $splicing_event->dbID;
69
70 my $sql = "select splicing_transcript_pair_id, transcript_id_1, transcript_id_2 from splicing_transcript_pair where splicing_event_id = $splicing_event_id";
71
72 my $sth = $self->prepare($sql);
73
74 $sth->execute();
75 $sth->bind_columns(\$splicing_transcript_pair_id, \$transcript_id_1, \$transcript_id_2);
76
77 my @pairs;
78
79 while($sth->fetch()){
80 push( @pairs,
81 $self->_create_feature_fast( 'Bio::EnsEMBL::SplicingTranscriptPair', {
82 'adaptor' => $self,
83 'dbID' => $splicing_transcript_pair_id,
84 'transcript_id_1' => $transcript_id_1,
85 'transcript_id_2' => $transcript_id_2,
86 'start' => $splicing_event->start,
87 'end' => $splicing_event->end
88 } ) );
89
90 }
91 $sth->finish;
92 return \@pairs;
93
94 }
95
96
97
98
99 # _tables
100 # Arg [1] : none
101 # Description: PROTECTED implementation of superclass abstract method.
102 # Returns the names, aliases of the tables to use for queries.
103 # Returntype : list of listrefs of strings
104 # Exceptions : none
105 # Caller : internal
106 # Status : At Risk
107
108 sub _tables {
109 my $self = shift;
110
111 return ([ 'splicing_transcript_pair', 'stp' ]);
112 }
113
114 # _columns
115 # Arg [1] : none
116 # Example : none
117 # Description: PROTECTED implementation of superclass abstract method.
118 # Returns a list of columns to use for queries.
119 # Returntype : list of strings
120 # Exceptions : none
121 # Caller : internal
122 # Status : At Risk
123
124 sub _columns {
125 my $self = shift;
126
127 # my $created_date = $self->db->dbc->from_date_to_seconds("gsi.created_date");
128 # my $modified_date = $self->db->dbc->from_date_to_seconds("gsi.modified_date");
129
130 return ( 'stp.splicing_transcript_pair_id','stp.transcript_id_1', 'stp.transcript_id_2');
131
132 }
133
134 sub list_dbIDs {
135 my ($self,$ordered) = @_;
136
137 return $self->_list_dbIDs("splicing_transcript_pair", undef, $ordered);
138 }
139
140
141 1;
142
143