comparison variant_effect_predictor/Bio/EnsEMBL/DBSQL/SplicingEventFeatureAdaptor.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::SlicingEventFeatureAdaptor - Database adaptor for the retrieval and
24 storage of SplicingEventFeature 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", "SplicingEventFeature" );
37
38
39 =head1 DESCRIPTION
40
41 This is a database aware adaptor for the retrieval and storage of SlicingEventFeatures
42 objects.
43
44 =head1 METHODS
45
46 =cut
47 package Bio::EnsEMBL::DBSQL::SplicingEventFeatureAdaptor;
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::SplicingEventFeature;
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_event_feature_id, $splicing_event_id, $exon_id, $transcript_id, $feature_order, $transcript_association, $type, $start, $end);
67
68 $splicing_event_id = $splicing_event->dbID;
69
70 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";
71
72 my $sth = $self->prepare($sql);
73
74 $sth->execute();
75 $sth->bind_columns(\$splicing_event_feature_id, \$exon_id, \$transcript_id, \$feature_order, \$transcript_association, \$type, \$start, \$end);
76
77 my @features;
78
79 while($sth->fetch()){
80 push( @features,
81 $self->_create_feature_fast( 'Bio::EnsEMBL::SplicingEventFeature', {
82 'start' => $start,
83 'end' => $end,
84 'adaptor' => $self,
85 'dbID' => $splicing_event_feature_id,
86 'exon_id' => $exon_id,
87 'transcript_id' => $transcript_id,
88 'slice' => $splicing_event->slice,
89 'type' => $type,
90 'feature_order' => $feature_order,
91 'transcript_association' => $transcript_association
92 } ) );
93
94 }
95 $sth->finish;
96 return \@features;
97
98 }
99
100
101
102
103 # _tables
104 # Arg [1] : none
105 # Description: PROTECTED implementation of superclass abstract method.
106 # Returns the names, aliases of the tables to use for queries.
107 # Returntype : list of listrefs of strings
108 # Exceptions : none
109 # Caller : internal
110 # Status : At Risk
111
112 sub _tables {
113 my $self = shift;
114
115 return ([ 'splicing_event_feature', 'sef' ]);
116 }
117
118 # _columns
119 # Arg [1] : none
120 # Example : none
121 # Description: PROTECTED implementation of superclass abstract method.
122 # Returns a list of columns to use for queries.
123 # Returntype : list of strings
124 # Exceptions : none
125 # Caller : internal
126 # Status : At Risk
127
128 sub _columns {
129 my $self = shift;
130
131 # my $created_date = $self->db->dbc->from_date_to_seconds("gsi.created_date");
132 # my $modified_date = $self->db->dbc->from_date_to_seconds("gsi.modified_date");
133
134 return ( 'sef.splicing_event_id','sef.exon_id', 'sef.feature_order', 'sef.transcript_association', 'sef.type', 'sef.start', 'sef.end' );
135
136 }
137
138 sub list_dbIDs {
139 my ($self,$ordered) = @_;
140
141 return $self->_list_dbIDs("splicing_event_feature", undef, $ordered);
142 }
143
144
145 1;
146
147