~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to Bio/Annotation/SimpleValue.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: SimpleValue.pm,v 1.10 2003/03/10 21:53:56 lapp Exp $
 
1
# $Id: SimpleValue.pm,v 1.18.4.3 2006/10/02 23:10:12 sendu Exp $
2
2
#
3
3
# BioPerl module for Bio::Annotation::SimpleValue
4
4
#
5
 
# Cared for by bioperl <bioperl-l@bio.perl.org>
 
5
# Cared for by bioperl <bioperl-l@bioperl.org>
6
6
#
7
7
# Copyright bioperl
8
8
#
12
12
 
13
13
=head1 NAME
14
14
 
15
 
Bio::Annotation::SimpleValue - A simple scalar 
 
15
Bio::Annotation::SimpleValue - A simple scalar
16
16
 
17
17
=head1 SYNOPSIS
18
18
 
20
20
   use Bio::Annotation::Collection;
21
21
 
22
22
   my $col = new Bio::Annotation::Collection;
23
 
   my $sv = new Bio::Annotation::SimpleValue(-value => 'someval');   
 
23
   my $sv = new Bio::Annotation::SimpleValue(-value => 'someval');
24
24
   $col->add_Annotation('tagname', $sv);
25
25
 
26
26
=head1 DESCRIPTION
27
27
 
28
 
Scalar value annotation object 
 
28
Scalar value annotation object
29
29
 
30
30
=head1 FEEDBACK
31
31
 
35
35
Bioperl modules. Send your comments and suggestions preferably to one
36
36
of the Bioperl mailing lists. Your participation is much appreciated.
37
37
 
38
 
  bioperl-l@bioperl.org              - General discussion
39
 
  http://bio.perl.org/MailList.html  - About the mailing lists
 
38
  bioperl-l@bioperl.org                  - General discussion
 
39
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
40
40
 
41
41
=head2 Reporting Bugs
42
42
 
43
43
Report bugs to the Bioperl bug tracking system to help us keep track
44
 
the bugs and their resolution.  Bug reports can be submitted via email
45
 
or the web:
46
 
 
47
 
  bioperl-bugs@bioperl.org
48
 
  http://bugzilla.bioperl.org/
49
 
 
50
 
=head1 AUTHOR - bioperl
51
 
 
52
 
Email bioperl-l@bio.perl.org
53
 
 
54
 
Describe contact details here
 
44
the bugs and their resolution.  Bug reports can be submitted via
 
45
the web:
 
46
 
 
47
  http://bugzilla.open-bio.org/
 
48
 
 
49
=head1 AUTHOR  - Ewan Birney 
 
50
 
 
51
Email birney@ebi.ac.uk
55
52
 
56
53
=head1 APPENDIX
57
54
 
64
61
 
65
62
 
66
63
package Bio::Annotation::SimpleValue;
67
 
use vars qw(@ISA);
68
64
use strict;
 
65
use overload '""' => sub { $_[0]->value};
 
66
use overload 'eq' => sub { "$_[0]" eq "$_[1]" };
69
67
 
70
68
# Object preamble - inherits from Bio::Root::Root
71
69
 
72
 
use Bio::AnnotationI;
73
70
#use Bio::Ontology::TermI;
74
 
use Bio::Root::Root;
75
71
 
76
 
@ISA = qw(Bio::Root::Root Bio::AnnotationI);
 
72
use base qw(Bio::Root::Root Bio::AnnotationI);
77
73
 
78
74
=head2 new
79
75
 
112
108
 
113
109
 Title   : as_text
114
110
 Usage   : my $text = $obj->as_text
115
 
 Function: return the string "Value: $v" where $v is the value 
 
111
 Function: return the string "Value: $v" where $v is the value
116
112
 Returns : string
117
113
 Args    : none
118
114
 
138
134
=cut
139
135
 
140
136
sub hash_tree{
141
 
   my ($self) = @_;
142
 
   
143
 
   my $h = {};
144
 
   $h->{'value'} = $self->value;
 
137
    my $self = shift;
 
138
 
 
139
    my $h = {};
 
140
    $h->{'value'} = $self->value;
 
141
    return $h;
145
142
}
146
143
 
147
144
=head2 tagname
154
151
           provide a tag to AnnotationCollection when adding this
155
152
           object.
156
153
 
157
 
 Example : 
 
154
 Example :
158
155
 Returns : value of tagname (a scalar)
159
156
 Args    : new value (a scalar, optional)
160
157
 
193
190
 
194
191
sub value{
195
192
   my ($self,$value) = @_;
196
 
   
 
193
 
197
194
   if( defined $value) {
198
195
      $self->{'value'} = $value;
199
196
    }
219
216
           is not needed. Once it is set to a valid value, tagname()
220
217
           will actually delegate to the name() of this term.
221
218
 
222
 
 Example : 
 
219
 Example :
223
220
 Returns : a L<Bio::Ontology::TermI> compliant object, or undef
224
221
 Args    : on set, new value (a L<Bio::Ontology::TermI> compliant
225
222
           object or undef, optional)