Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/EnsEMBL/ProteinFeature.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::ProteinFeature | |
24 | |
25 =head1 SYNOPSIS | |
26 | |
27 my $feature = Bio::EnsEMBL::ProteinFeature->new( | |
28 -start => $start, | |
29 -end => $end, | |
30 -hstart => $hit_start, | |
31 -hend => $hit_end, | |
32 -hseqname => $hit_name | |
33 ); | |
34 | |
35 =head1 DESCRIPTION | |
36 | |
37 ProteinFeature objects represent domains or other features of interest | |
38 on a peptide sequence. | |
39 | |
40 =head1 METHODS | |
41 | |
42 =cut | |
43 | |
44 package Bio::EnsEMBL::ProteinFeature; | |
45 | |
46 use strict; | |
47 | |
48 use Bio::EnsEMBL::FeaturePair; | |
49 use Bio::EnsEMBL::Utils::Argument qw(rearrange); | |
50 | |
51 use vars qw(@ISA); | |
52 @ISA = qw(Bio::EnsEMBL::FeaturePair); | |
53 | |
54 | |
55 | |
56 =head2 new | |
57 | |
58 Arg [IDESC] : (optional) string An interpro description | |
59 Arg [INTERPRO_AC] : (optional) string An interpro accession | |
60 Arg [TRANSLATION_ID] : (optional) integer A translation dbID | |
61 Arg [...] : named arguments to FeaturePair superclass | |
62 Example : | |
63 | |
64 $pf = | |
65 Bio::EnsEMBL::ProteinFeature->new( -IDESC => $idesc, | |
66 -INTERPRO_AC => $iac, | |
67 @fp_args ); | |
68 | |
69 Description: Instantiates a Bio::EnsEMBL::ProteinFeature | |
70 Returntype : Bio::EnsEMBL::FeaturePair | |
71 Exceptions : none | |
72 Caller : general | |
73 Status : Stable | |
74 | |
75 =cut | |
76 | |
77 sub new { | |
78 my $proto = shift; | |
79 | |
80 my $class = ref($proto) || $proto; | |
81 | |
82 my ( $idesc, $interpro_ac, $translation_id ) = | |
83 rearrange( [ 'IDESC', 'INTERPRO_AC', 'TRANSLATION_ID' ], @_ ); | |
84 | |
85 my $self = $class->SUPER::new(@_); | |
86 | |
87 # the strand of protein features is always 0 | |
88 $self->{'strand'} = 0; | |
89 $self->{'idesc'} = $idesc || ''; | |
90 $self->{'interpro_ac'} = $interpro_ac || ''; | |
91 $self->{'translation_id'} = $translation_id || ''; | |
92 | |
93 return $self; | |
94 } | |
95 | |
96 | |
97 =head2 strand | |
98 | |
99 Arg [1] : Ignored | |
100 Description: Overwrites Bio::EnsEMBL::Feature->strand to not allow | |
101 : the strand to be set. | |
102 Returntype : int | |
103 Status : Stable | |
104 | |
105 =cut | |
106 | |
107 #do not allow the strand to be set | |
108 sub strand { | |
109 my $self = shift; | |
110 return $self->{'strand'}; | |
111 } | |
112 | |
113 | |
114 | |
115 =head2 idesc | |
116 | |
117 Arg [1] : (optional) string The interpro description | |
118 Example : print $protein_feature->idesc(); | |
119 Description: Getter/Setter for the interpro description of this protein | |
120 feature. | |
121 Returntype : string | |
122 Exceptions : none | |
123 Caller : general | |
124 Status : Stable | |
125 | |
126 =cut | |
127 | |
128 sub idesc{ | |
129 my $self = shift; | |
130 $self->{'idesc'} = shift if(@_); | |
131 return $self->{'idesc'}; | |
132 } | |
133 | |
134 | |
135 | |
136 =head2 interpro_ac | |
137 | |
138 Arg [1] : (optional) string The interpro accession | |
139 Example : print $protein_feature->interpro_ac(); | |
140 Description: Getter/Setter for the interpro accession of this protein | |
141 feature. | |
142 Returntype : string | |
143 Exceptions : none | |
144 Caller : general | |
145 Status : Stable | |
146 | |
147 =cut | |
148 | |
149 sub interpro_ac{ | |
150 my $self = shift; | |
151 $self->{'interpro_ac'} = shift if(@_); | |
152 return $self->{'interpro_ac'}; | |
153 } | |
154 | |
155 | |
156 =head2 translation_id | |
157 | |
158 Arg [1] : (optional) integer The dbID of the translation | |
159 Example : print $protein_feature->translation_id(); | |
160 Description: Getter/Setter for the translation dbID of this protein | |
161 feature. | |
162 Returntype : string | |
163 Exceptions : none | |
164 Caller : general | |
165 Status : Stable | |
166 | |
167 =cut | |
168 | |
169 sub translation_id { | |
170 my $self = shift; | |
171 $self->{'translation_id'} = shift if (@_); | |
172 return $self->{'translation_id'}; | |
173 } | |
174 | |
175 1; |