3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
37 # fetch an exon from the db and create a lightweight exon object
39 my $exon = $exon_adaptor->fetch_by_stable_id(
'ENSE000345437');
49 $exon->slice->seq_region_name,
50 $exon->slice->coord_system_name,
51 $exon->slice->coord_system->version,
52 $exon->slice->subseq( $exon->start, $exon->end, $exon->strand ),
59 This is a lightweight
exon object for the stable Id mapping. See the
83 package Bio::EnsEMBL::IdMapping::TinyExon;
85 # internal data structure (array indices):
93 # 10 coord_system_version
105 no warnings
'uninitialized';
115 Arg[1] : (optional) Int - the
exon's start coordinate
116 Description : Getter/setter for the exon's start coordinate.
127 $self->[5] = shift if (@_);
134 Arg[1] : (optional) Int - the
exon's end coordinate
135 Description : Getter/setter for the exon's end coordinate.
146 $self->[6] = shift if (@_);
153 Arg[1] : (optional) Int - the
exon's strand
154 Description : Getter/setter for the exon's strand.
165 $self->[7] = shift if (@_);
170 =head2 seq_region_name
172 Arg[1] : (optional) String - seq_region name
173 Description : Getter/setter
for the seq_region name of the slice the
exon is
183 sub seq_region_name {
185 $self->[8] = shift if (@_);
190 =head2 coord_system_name
192 Arg[1] : (optional) String - coord_system name
193 Description : Getter/setter
for the coord_system name of the slice the
exon is
203 sub coord_system_name {
205 $self->[9] = shift if (@_);
210 =head2 coord_system_version
212 Arg[1] : (optional) String - coord_system version
213 Description : Getter/setter
for the coord_system version of the slice the
223 sub coord_system_version {
225 $self->[10] = shift if (@_);
232 Arg[1] : (optional) String - the
exon's sequence
233 Description : Getter/setter for the exon's sequence.
244 $self->[11] = shift if (@_);
251 Arg[1] : (optional) Int - the
exon's phase
252 Description : Getter/setter for the exon's phase.
263 $self->[12] = shift if (@_);
270 Arg[1] : (optional) Boolean - attribute to set
271 Description : Getter/setter
for the attribute determining whether an
exon
272 needs to be projected onto a common coord_system. You don
't need
273 to do so if the native coord_system is common to the source and
274 target assemblies, or if no common coord_system is found (the
275 Cache object has methods to determine this).
276 Return type : Boolean
286 $self->[13] = shift if (@_);
293 Arg[1] : (optional) Int - the exon's start in common coord_system
295 Description : Getter/setter
for the
exon's start in common coord_system
296 coordinates. Will return $self->start if no projection to a
297 common coord_system is required.
309 # when used as a setter, always set a value
310 $self->[14] = shift if (@_);
312 # when used as a getter
313 if (scalar(@$self) > 14) {
314 # return value for common coord_system if available (but avoid
315 # autovivification gotcha!)
317 } elsif ($self->need_project) {
318 # return undef if common value expected but not there (e.g. no projection
322 # return native value
330 Arg[1] : (optional) Int - the exon's end in common coord_system
332 Description : Getter/setter
for the
exon's end in common coord_system
333 coordinates. Will return $self->end if no projection to a
334 common coord_system is required.
346 # when used as a setter, always set a value
347 $self->[15] = shift if (@_);
349 # when used as a getter
350 if (scalar(@$self) > 14) {
351 # return value for common coord_system if available (but avoid
352 # autovivification gotcha!)
354 } elsif ($self->need_project) {
355 # return undef if common value expected but not there (e.g. no projection
359 # return native value
367 Arg[1] : (optional) Int - the exon's strand in common coord_system
369 Description : Getter/setter
for the
exon's strand in common coord_system
370 coordinates. Will return $self->strand if no projection to a
371 common coord_system is required.
383 # when used as a setter, always set a value
384 $self->[16] = shift if (@_);
386 # when used as a getter
387 if (scalar(@$self) > 14) {
388 # return value for common coord_system if available (but avoid
389 # autovivification gotcha!)
391 } elsif ($self->need_project) {
392 # return undef if common value expected but not there (e.g. no projection
396 # return native value
397 return $self->strand;
402 =head2 common_sr_name
404 Arg[1] : (optional) String - seq_region name of the exon's slice on the
406 Description : Getter/setter
for the seq_region name of the
exon's slice on the
407 common coord_system coordinates. Will return
408 $self->seq_region_name if no projection to a common coord_system
421 # when used as a setter, always set a value
422 $self->[17] = shift if (@_);
424 # when used as a getter
425 if (scalar(@$self) > 14) {
426 # return value for common coord_system if available (but avoid
427 # autovivification gotcha!)
429 } elsif ($self->need_project) {
430 # return undef if common value expected but not there (e.g. no projection
434 # return native value
435 return $self->seq_region_name;
442 Description : Returns the exon length (distance between start and end).
453 return ($self->end - $self->start + 1);