Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/Mapper/IndelCoordinate.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::Mapper::IndelCoordinate | |
24 | |
25 =head1 SYNOPSIS | |
26 | |
27 =head1 DESCRIPTION | |
28 | |
29 Representation of a indel in a sequence; returned from Mapper.pm when | |
30 the target region is in a deletion. | |
31 | |
32 =head1 METHODS | |
33 | |
34 =cut | |
35 | |
36 package Bio::EnsEMBL::Mapper::IndelCoordinate; | |
37 | |
38 use Bio::EnsEMBL::Mapper::Gap; | |
39 use Bio::EnsEMBL::Mapper::Coordinate; | |
40 | |
41 use vars qw(@ISA); | |
42 use strict; | |
43 | |
44 @ISA = qw(Bio::EnsEMBL::Mapper::Coordinate Bio::EnsEMBL::Mapper::Gap); | |
45 | |
46 | |
47 =head2 new | |
48 | |
49 Arg [1] : Bio::EnsEMBL::Mapper::Gap $gap | |
50 Arg [2] : Bio::EnsEMBL::Mapper::Coordinate $coordinate | |
51 Example : $indelCoord = Bio::EnsEMBL::Mapper::IndelCoordinate($gap, $coordinate); | |
52 Description: Creates a new IndelCoordinate object. | |
53 Returntype : Bio::EnsEMBL::Mapper::IndelCoordinate | |
54 Exceptions : none | |
55 Caller : Bio::EnsEMBL::Mapper | |
56 | |
57 =cut | |
58 | |
59 sub new { | |
60 my ( $proto, $gap, $coordinate ) = @_; | |
61 | |
62 my $class = ref($proto) || $proto; | |
63 | |
64 return | |
65 bless( { 'start' => $coordinate->start(), | |
66 'end' => $coordinate->end(), | |
67 'strand' => $coordinate->strand(), | |
68 'id' => $coordinate->id(), | |
69 'coord_system' => $coordinate->coord_system(), | |
70 'gap_start' => $gap->start(), | |
71 'gap_end' => $gap->end() | |
72 }, | |
73 $class ); | |
74 } | |
75 | |
76 =head2 gap_start | |
77 | |
78 Arg[1] : (optional) int $gap_start | |
79 Example : $gap_start = $ic->gap_start() | |
80 Description : Getter/Setter for the start of the Gap region | |
81 ReturnType : int | |
82 Exceptions : none | |
83 Caller : general | |
84 | |
85 =cut | |
86 | |
87 sub gap_start { | |
88 my ( $self, $value ) = @_; | |
89 | |
90 if ( defined($value) ) { | |
91 $self->{'gap_start'} = $value; | |
92 } | |
93 | |
94 return $self->{'gap_start'}; | |
95 } | |
96 | |
97 =head2 gap_end | |
98 | |
99 Arg[1] : (optional) int $gap_end | |
100 Example : $gap_end = $ic->gap_end() | |
101 Description : Getter/Setter for the end of the Gap region | |
102 ReturnType : int | |
103 Exceptions : none | |
104 Caller : general | |
105 | |
106 =cut | |
107 | |
108 sub gap_end { | |
109 my ( $self, $value ) = @_; | |
110 | |
111 if ( defined($value) ) { | |
112 $self->{'gap_end'} = $value; | |
113 } | |
114 | |
115 return $self->{'gap_end'}; | |
116 } | |
117 | |
118 =head2 gap_length | |
119 | |
120 Args : None | |
121 Example : $gap_length = $ic->gap_length() | |
122 Description : Getter for the length of the Gap region | |
123 ReturnType : int | |
124 Exceptions : none | |
125 Caller : general | |
126 | |
127 =cut | |
128 | |
129 sub gap_length { | |
130 my ($self) = @_; | |
131 | |
132 return $self->{'gap_end'} - $self->{'gap_start'} + 1; | |
133 } | |
134 | |
135 1; |