ProteinFeature.pm 3.71 KB
Newer Older
1
=head1 LICENSE
Emmanuel Mongin's avatar
Emmanuel Mongin committed
2

3
  Copyright (c) 1999-2011 The European Bioinformatics Institute and
4
  Genome Research Limited.  All rights reserved.
Emmanuel Mongin's avatar
Emmanuel Mongin committed
5

6
7
8
9
10
11
12
13
  This software is distributed under a modified Apache license.
  For license details, please see

    http://www.ensembl.org/info/about/code_licence.html

=head1 CONTACT

  Please email comments or questions to the public Ensembl
14
  developers list at <dev@ensembl.org>.
15
16
17
18
19

  Questions may also be sent to the Ensembl help desk at
  <helpdesk@ensembl.org>.

=cut
Emmanuel Mongin's avatar
Emmanuel Mongin committed
20
21
22

=head1 NAME

23
Bio::EnsEMBL::ProteinFeature
Emmanuel Mongin's avatar
Emmanuel Mongin committed
24
25
26

=head1 SYNOPSIS

27
  my $feature = Bio::EnsEMBL::ProteinFeature->new(
Andy Yates's avatar
Andy Yates committed
28
29
30
31
32
    -start    => $start,
    -end      => $end,
    -hstart   => $hit_start,
    -hend     => $hit_end,
    -hseqname => $hit_name
33
  );
Emmanuel Mongin's avatar
Emmanuel Mongin committed
34

35
=head1 DESCRIPTION
Emmanuel Mongin's avatar
Emmanuel Mongin committed
36

37
ProteinFeature objects represent domains or other features of interest
38
on a peptide sequence.
39

40
=head1 METHODS
Emmanuel Mongin's avatar
Emmanuel Mongin committed
41
42
43

=cut

44
package Bio::EnsEMBL::ProteinFeature;
45

Emmanuel Mongin's avatar
Emmanuel Mongin committed
46
use strict;
47

Emmanuel Mongin's avatar
Emmanuel Mongin committed
48
use Bio::EnsEMBL::FeaturePair;
49
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
Emmanuel Mongin's avatar
Emmanuel Mongin committed
50

51
use vars qw(@ISA);
Emmanuel Mongin's avatar
Emmanuel Mongin committed
52
53
@ISA = qw(Bio::EnsEMBL::FeaturePair);

54
55
56
57


=head2 new

58
59
60
61
62
63
64
65
66
67
68
  Arg [IDESC]           : (optional) string An interpro description
  Arg [INTERPRO_AC]     : (optional) string An interpro accession
  Arg [TRANSLATION_ID]  : (optional) integer A translation dbID
  Arg [...]             : named arguments to FeaturePair superclass
  Example    :

    $pf =
      Bio::EnsEMBL::ProteinFeature->new( -IDESC       => $idesc,
                                         -INTERPRO_AC => $iac,
                                         @fp_args );

69
70
71
72
  Description: Instantiates a Bio::EnsEMBL::ProteinFeature
  Returntype : Bio::EnsEMBL::FeaturePair
  Exceptions : none
  Caller     : general
73
  Status     : Stable
74
75
76
77

=cut

sub new {
78
  my $proto = shift;
79

80
  my $class = ref($proto) || $proto;
81

82
83
  my ( $idesc, $interpro_ac, $translation_id ) =
    rearrange( [ 'IDESC', 'INTERPRO_AC', 'TRANSLATION_ID' ], @_ );
84
85
86

  my $self = $class->SUPER::new(@_);

87
88
89
90
  # the strand of protein features is always 0
  $self->{'strand'}         = 0;
  $self->{'idesc'}          = $idesc || '';
  $self->{'interpro_ac'}    = $interpro_ac || '';
91
  $self->{'translation_id'} = $translation_id || '';
92
93
94
95
96

  return $self;
}


97
98
99
100
101
102
103
104
105
=head2 strand

  Arg [1]    : Ignored
  Description: Overwrites Bio::EnsEMBL::Feature->strand to not allow
             : the strand to be set.
  Returntype : int
  Status     : Stable

=cut
106
107
108
109
110
111
112
113

#do not allow the strand to be set
sub strand {
  my $self = shift;
  return $self->{'strand'};
}


114

115
=head2 idesc
116

117
118
  Arg [1]    : (optional) string The interpro description
  Example    : print $protein_feature->idesc();
119
  Description: Getter/Setter for the interpro description of this protein
120
121
122
123
               feature.
  Returntype : string
  Exceptions : none
  Caller     : general
124
  Status     : Stable
125
126
127
128

=cut

sub idesc{
129
130
131
  my $self = shift;
  $self->{'idesc'} = shift if(@_);
  return $self->{'idesc'};
132
}
133

134

135

136
=head2 interpro_ac
137

138
139
  Arg [1]    : (optional) string The interpro accession
  Example    : print $protein_feature->interpro_ac();
140
  Description: Getter/Setter for the interpro accession of this protein
141
142
143
144
               feature.
  Returntype : string
  Exceptions : none
  Caller     : general
145
  Status     : Stable
146
147
148
149

=cut

sub interpro_ac{
150
151
152
  my $self = shift;
  $self->{'interpro_ac'} = shift if(@_);
  return $self->{'interpro_ac'};
153
154
155
}


156
=head2 translation_id
157

158
159
160
  Arg [1]    : (optional) integer The dbID of the translation
  Example    : print $protein_feature->translation_id();
  Description: Getter/Setter for the translation dbID of this protein
161
162
163
164
165
166
167
168
               feature.
  Returntype : string
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

169
sub translation_id {
170
  my $self = shift;
171
  $self->{'translation_id'} = shift if (@_);
172
173
174
  return $self->{'translation_id'};
}

175
1;