0
|
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 =head1 NAME
|
|
20
|
|
21 Bio::EnsEMBL::Compara::SyntenyRegion - Synteny region
|
|
22
|
|
23 =head1 SYNOPSIS
|
|
24
|
|
25 print $this_synteny_region->dbID;
|
|
26
|
|
27 print $this_synteny_region->method_link_species_set_id;
|
|
28
|
|
29 my $these_dnafrag_regions = $this_synteny_region->get_all_DnaFragRegions();
|
|
30 foreach my $this_dnafrag_region (@$these_dnafrag_regions) {
|
|
31 print $this_dnafrag_region->genome_db->name, ": ", $this_dnafrag_region->slice->name, "\n";
|
|
32 }
|
|
33
|
|
34 =head1 DESCRIPTION
|
|
35
|
|
36 A Bio::EnsEMBL::Compara::SyntenyRegion object is a container of Bio::EnsEMBL::Compara::DnaFragRegion
|
|
37 objects. Each Bio::EnsEMBL::Compara::DnaFragRegion represent a genomic region which is in synteny
|
|
38 with the other regions represented in the Bio::EnsEMBL::Compara::SyntenyRegion object.
|
|
39
|
|
40 Also, the Bio::EnsEMBL::Compara::SyntenyRegion object implicitly contains a
|
|
41 Bio::EnsEMBL::Compara::MethodLinkSpeciesSet object which defines the type of synteny.
|
|
42
|
|
43 =head1 OBJECT ATTRIBUTES
|
|
44
|
|
45 =over
|
|
46
|
|
47 =item dbID
|
|
48
|
|
49 corresponds to synteny_region.synteny_region_id
|
|
50
|
|
51 =item adaptor
|
|
52
|
|
53 Bio::EnsEMBL::Compara::DBSQL::SyntenyRegionAdaptor object to access DB
|
|
54
|
|
55 =item method_link_species_set_id
|
|
56
|
|
57 corresponds to synteny_region.method_link_species_set_id
|
|
58
|
|
59 =back
|
|
60
|
|
61 =head1 APPENDIX
|
|
62
|
|
63 The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _
|
|
64
|
|
65 =cut
|
|
66
|
|
67
|
|
68 # Let the code begin...
|
|
69
|
|
70
|
|
71 package Bio::EnsEMBL::Compara::SyntenyRegion;
|
|
72
|
|
73 use strict;
|
|
74 use Bio::EnsEMBL::Utils::Argument;
|
|
75 use Bio::EnsEMBL::Utils::Exception;
|
|
76
|
|
77 #use Bio::EnsEMBL::Compara::NestedSet;
|
|
78 #our @ISA = qw(Bio::EnsEMBL::Compara::NestedSet);
|
|
79
|
|
80 =head2 new_fast
|
|
81
|
|
82 Arg [-DBID] : integer $dbID
|
|
83 Arg [-METHOD_LINK_SPECIES_SET_ID]
|
|
84 : integer $method_link_species_set_id
|
|
85 Arg [-ADAPTOR]
|
|
86 : Bio::EnsEMBL::Compara::DBSQL::SyntenyRegionAdaptor $adaptor
|
|
87 Example : none
|
|
88 Description : This is the default constructor
|
|
89 Returntype : Bio::EnsEMBL::Compara::SyntenyRegion object
|
|
90 Exceptions : none
|
|
91 Caller :
|
|
92 Status : Stable
|
|
93
|
|
94 =cut
|
|
95
|
|
96 sub new {
|
|
97 my ($class, @args) = @_;
|
|
98
|
|
99 # my $self = $class->SUPER::new(@args);
|
|
100
|
|
101 my $self = bless {}, $class;
|
|
102
|
|
103 if (scalar @args) {
|
|
104 #do this explicitly.
|
|
105 my ($dbid, $method_link_species_set_id, $adaptor, $regions) =
|
|
106 rearrange([qw(DBID METHOD_LINK_SPECIES_SET_ID ADAPTOR REGIONS)], @args);
|
|
107
|
|
108 $dbid && $self->dbID($dbid);
|
|
109 $regions && $self->regions($regions);
|
|
110 $method_link_species_set_id && $self->method_link_species_set_id($method_link_species_set_id);
|
|
111 $adaptor && $self->adaptor($adaptor);
|
|
112 }
|
|
113
|
|
114 return $self;
|
|
115 }
|
|
116
|
|
117
|
|
118 =head2 new_fast
|
|
119
|
|
120 Arg [1] : hash reference $hashref
|
|
121 Example : none
|
|
122 Description : This is an ultra fast constructor which requires knowledge of
|
|
123 the objects internals to be used.
|
|
124 Returntype : Bio::EnsEMBL::Compara::SyntenyRegion object
|
|
125 Exceptions : none
|
|
126 Caller :
|
|
127 Status : Stable
|
|
128
|
|
129 =cut
|
|
130
|
|
131 sub new_fast {
|
|
132 my ($class, $hashref) = @_;
|
|
133
|
|
134 return bless $hashref, $class;
|
|
135 }
|
|
136
|
|
137
|
|
138 =head2 stable_id
|
|
139
|
|
140 DEPRECATED: SyntenyRegions don't have any stable id.
|
|
141
|
|
142 =cut
|
|
143
|
|
144 sub stable_id {
|
|
145 my $obj = shift;
|
|
146
|
|
147 deprecate("SyntenyRegions don't have any stable id.");
|
|
148
|
|
149 if( @_ ) {
|
|
150 my $value = shift;
|
|
151 $obj->{'stable_id'} = $value;
|
|
152 }
|
|
153
|
|
154 return $obj->{'stable_id'};
|
|
155 }
|
|
156
|
|
157
|
|
158 =head2 method_link_species_set_id
|
|
159
|
|
160 Arg [1] : (optional) integer $method_link_species_set_id
|
|
161 Example : none
|
|
162 Description : Getter/setter for the method_link_species_set_id value.
|
|
163 Returntype : integer
|
|
164 Exceptions : none
|
|
165 Caller : general
|
|
166 Status : Stable
|
|
167
|
|
168 =cut
|
|
169
|
|
170 sub method_link_species_set_id {
|
|
171 my $obj = shift;
|
|
172 if( @_ ) {
|
|
173 my $value = shift;
|
|
174 $obj->{'method_link_species_set_id'} = $value;
|
|
175 }
|
|
176 return $obj->{'method_link_species_set_id'};
|
|
177 }
|
|
178
|
|
179
|
|
180 =head2 dbID
|
|
181
|
|
182 Arg [1] : (optional) integer $dbID
|
|
183 Example : none
|
|
184 Description : Getter/setter for the dbID value. This corresponds to
|
|
185 synteny_region.synteny_region_id
|
|
186 Returntype : integer
|
|
187 Exceptions : none
|
|
188 Caller : general
|
|
189 Status : Stable
|
|
190
|
|
191 =cut
|
|
192
|
|
193 sub dbID {
|
|
194 my $obj = shift;
|
|
195
|
|
196 if (@_) {
|
|
197 my $value = shift;
|
|
198 $obj->{'dbID'} = $value;
|
|
199 }
|
|
200
|
|
201 return $obj->{'dbID'};
|
|
202 }
|
|
203
|
|
204
|
|
205 =head2 adaptor
|
|
206
|
|
207 Arg [1] : (optional) Bio::EnsEMBL::Compara::DBSQL::SyntenyRegionAdaptor $adaptor
|
|
208 Example : none
|
|
209 Description : Getter/setter for the adaptor
|
|
210 Returntype : Bio::EnsEMBL::Compara::DBSQL::SyntenyRegionAdaptor object
|
|
211 Exceptions : none
|
|
212 Caller : general
|
|
213 Status : Stable
|
|
214
|
|
215 =cut
|
|
216
|
|
217 sub adaptor {
|
|
218 my $obj = shift;
|
|
219
|
|
220 if (@_) {
|
|
221 my $value = shift;
|
|
222 $obj->{'adaptor'} = $value;
|
|
223 }
|
|
224
|
|
225 return $obj->{'adaptor'};
|
|
226 }
|
|
227
|
|
228
|
|
229 =head2 get_all_DnaFragRegions
|
|
230
|
|
231 Arg 1 : -none-
|
|
232 Example : my $all_dnafrag_regions = $obj->get_all_DnaFragRegions();
|
|
233 Description: returns all the DnaFragRegion objects for this syntenic
|
|
234 region. This method is an alias for children(), see
|
|
235 Bio::EnsEMBL::Compara::NestedSet for more details.
|
|
236 Returntype : a ref. to an array of Bio::EnsEMBL::Compara::DnaFragRegion
|
|
237 objects
|
|
238 Exception :
|
|
239 Caller : general
|
|
240 Status : Stable
|
|
241
|
|
242 =cut
|
|
243
|
|
244 sub get_all_DnaFragRegions {
|
|
245 my $obj = shift;
|
|
246
|
|
247 return $obj->regions();
|
|
248 # return $obj->children();
|
|
249 }
|
|
250
|
|
251 sub regions {
|
|
252 my ($obj, $value) = @_;
|
|
253
|
|
254 if (defined $value) {
|
|
255 $obj->{'regions'} = $value;
|
|
256 }
|
|
257
|
|
258 return $obj->{'regions'};
|
|
259 }
|
|
260
|
|
261 1;
|