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 =cut
|
|
20
|
|
21 =head1 NAME
|
|
22
|
|
23 Bio::EnsEMBL::ProjectionSegment - part of the list that is returned from
|
|
24 project function calls
|
|
25
|
|
26 =head1 SYNOPSIS
|
|
27
|
|
28 $slice =
|
|
29 $sa->fetch_by_region( 'chromosome', 'X', 1_000_000, 2_000_000 );
|
|
30
|
|
31 my $projection = $slice->project("clone");
|
|
32
|
|
33 foreach my $projection_segment (@$projection) {
|
|
34 print( " from_start ", $projection_segment->from_start(), "\n" );
|
|
35 print( " from_end ", $projection_segment->from_end(), "\n" );
|
|
36 print( " to_Slice ",
|
|
37 $projection_segment->to_Slice()->name(), "\n" );
|
|
38 }
|
|
39
|
|
40 =head1 DESCRIPTION
|
|
41
|
|
42 The ProjectionSegment is a helper object to make the arrays returned by
|
|
43 project more accessible. Instead of writing $segment->[0], $segment->[1]
|
|
44 or $segment->[2] its possible to use the more descriptive notation of
|
|
45 $segment->from_start(), $segement->from_end(), $segment->to_Slice().
|
|
46
|
|
47 =head1 METHODS
|
|
48
|
|
49 =cut
|
|
50
|
|
51 package Bio::EnsEMBL::ProjectionSegment;
|
|
52
|
|
53 #
|
|
54 # WARNING: THIS CLASS IS REPRESENTED BY A BLESSED ARRAY REFERENCE
|
|
55 # NOT A HASH REFERENCE
|
|
56 #
|
|
57
|
|
58
|
|
59
|
|
60
|
|
61
|
|
62 =head2 from_start
|
|
63
|
|
64 Args : none
|
|
65 Example : $coord_in_fetaure_start = $segment->from_start()
|
|
66 Description: First element in projects returned segment lists
|
|
67 Returntype : int
|
|
68 Exceptions : none
|
|
69 Caller : general
|
|
70 Status : Stable
|
|
71
|
|
72 =cut
|
|
73
|
|
74 sub from_start {
|
|
75 my $self = shift;
|
|
76 return $self->[0];
|
|
77 }
|
|
78
|
|
79
|
|
80
|
|
81 =head2 from_end
|
|
82
|
|
83 Args : none
|
|
84 Example : $coord_in_feature_end = $segment->from_end()
|
|
85 Description: Second element in projects returned segment lists
|
|
86 Returntype : int
|
|
87 Exceptions : none
|
|
88 Caller : general
|
|
89 Status : Stable
|
|
90
|
|
91 =cut
|
|
92
|
|
93 sub from_end {
|
|
94 my $self = shift;
|
|
95 return $self->[1];
|
|
96 }
|
|
97
|
|
98
|
|
99
|
|
100
|
|
101 =head2 to_Slice
|
|
102
|
|
103 Args : none
|
|
104 Example : $target_slice = $segment->to_Slice()
|
|
105 Description: Third element in projects returned segment lists
|
|
106 Returntype : Bio::EnsEMBL::Slice
|
|
107 Exceptions : none
|
|
108 Caller : general
|
|
109 Status : Stable
|
|
110
|
|
111 =cut
|
|
112
|
|
113 sub to_Slice {
|
|
114 my $self = shift;
|
|
115 return $self->[2];
|
|
116 }
|
|
117
|
|
118
|
|
119
|
|
120 1;
|