EnsEMBL/ProjectionSegment.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran n/a Conditioncond n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 22 CC 1 SCAR 6.9
CC
1
Cov
0%
from_start
2.0
from_end
2.0
to_Slice
2.0
CRAP 2.0
1 =head1 LICENSE
2  
3 See the NOTICE file distributed with this work for additional information
4 regarding copyright ownership.
5  
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
9  
10 http://www.apache.org/licenses/LICENSE-2.0
11  
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.
17  
18 =cut
19  
20  
21 =head1 CONTACT
22  
23 Please email comments or questions to the public Ensembl
24 developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
25  
26 Questions may also be sent to the Ensembl help desk at
27 <http://www.ensembl.org/Help/Contact>.
28  
29 =cut
30  
31 =head1 NAME
32  
33 Bio::EnsEMBL::ProjectionSegment - part of the list that is returned from
34 project function calls
35  
36 =head1 SYNOPSIS
37  
38 $slice =
39 $sa->fetch_by_region( 'chromosome', 'X', 1_000_000, 2_000_000 );
40  
41 my $projection = $slice->project("clone");
42  
43 foreach my $projection_segment (@$projection) {
44 print( " from_start ", $projection_segment->from_start(), "\n" );
45 print( " from_end ", $projection_segment->from_end(), "\n" );
46 print( " to_Slice ",
47 $projection_segment->to_Slice()->name(), "\n" );
48 }
49  
50 =head1 DESCRIPTION
51  
52 The ProjectionSegment is a helper object to make the arrays returned by
53 project more accessible. Instead of writing $segment->[0], $segment->[1]
54 or $segment->[2] its possible to use the more descriptive notation of
55 $segment->from_start(), $segement->from_end(), $segment->to_Slice().
56  
57 =head1 METHODS
58  
59 =cut
60  
61 package Bio::EnsEMBL::ProjectionSegment;
62 $Bio::EnsEMBL::ProjectionSegment::VERSION = '114.0.0_50'; # TRIAL
63 $Bio::EnsEMBL::ProjectionSegment::VERSION = '114.0.050';
64 use strict;
65 use warnings;
66  
67 #
68 # WARNING: THIS CLASS IS REPRESENTED BY A BLESSED ARRAY REFERENCE
69 # NOT A HASH REFERENCE
70 #
71  
72  
73  
74  
75  
76 =head2 from_start
77  
78 Args : none
79 Example : $coord_in_fetaure_start = $segment->from_start()
80 Description: First element in projects returned segment lists
81 Returntype : int
82 Exceptions : none
83 Caller : general
84 Status : Stable
85  
86 =cut
87  
88 sub from_start {
89 my $self = shift;
90 return $self->[0];
91 }
92  
93  
94  
95 =head2 from_end
96  
97 Args : none
98 Example : $coord_in_feature_end = $segment->from_end()
99 Description: Second element in projects returned segment lists
100 Returntype : int
101 Exceptions : none
102 Caller : general
103 Status : Stable
104  
105 =cut
106  
107 sub from_end {
108 my $self = shift;
109 return $self->[1];
110 }
111  
112  
113  
114  
115 =head2 to_Slice
116  
117 Args : none
118 Example : $target_slice = $segment->to_Slice()
119 Description: Third element in projects returned segment lists
120 Returntype : Bio::EnsEMBL::Slice
121 Exceptions : none
122 Caller : general
123 Status : Stable
124  
125 =cut
126  
127 sub to_Slice {
128 my $self = shift;
129 return $self->[2];
130 }
131  
132  
133  
134 1;