* seq_inds is not defined for Model-based HSPs
[bioperl-live.git] / Bio / Expression / Sample.pm
blob4f6c21b07a2d41ad02d99ada1a2572ad64e10725
1 # $Id$
3 # BioPerl module for Bio::Expression::Sample
5 # Cared for by Allen Day <allenday@ucla.edu>
7 # Copyright Allen Day
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Expression::Sample - DESCRIPTION of Object
17 =head1 SYNOPSIS
19 Give standard usage here
21 =head1 DESCRIPTION
23 Describe the object here
25 =head1 FEEDBACK
27 =head2 Mailing Lists
29 User feedback is an integral part of the evolution of this and other
30 Bioperl modules. Send your comments and suggestions preferably to
31 the Bioperl mailing list. Your participation is much appreciated.
33 bioperl-l@bioperl.org - General discussion
34 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
36 =head2 Reporting Bugs
38 Report bugs to the Bioperl bug tracking system to help us keep track
39 of the bugs and their resolution. Bug reports can be submitted via
40 the web:
42 http://bugzilla.open-bio.org/
44 =head1 AUTHOR - Allen Day
46 Email allenday@ucla.edu
48 =head1 APPENDIX
50 The rest of the documentation details each of the object methods.
51 Internal methods are usually preceded with a _
53 =cut
56 # Let the code begin...
59 package Bio::Expression::Sample;
60 use strict;
61 use base qw(Bio::Root::Root);
63 =head2 new()
65 Usage : my $obj = Bio::Expression::Sample->new();
66 Function: Builds a new Bio::Expression::Sample object
67 Returns : an instance of Bio::Expression::Sample
68 Args :
71 =cut
73 sub new {
74 my($class,@args) = @_;
76 my $self = $class->SUPER::new(@args);
77 $self->_initialize(@args);
78 return $self;
81 =head2 _initialize()
83 Usage : $obj->_initialize(%arg);
84 Function: Internal method to initialize a new Bio::Expression::Sample object
85 Returns : true on success
86 Args : passed through to new()
88 =cut
90 sub _initialize {
91 my($self,%arg) = @_;
93 foreach my $arg (keys %arg){
94 my $marg = $arg;
95 $marg =~ s/^-//;
96 $self->$marg($arg{$arg}) if $self->can($marg);
99 return 1;
102 =head2 accession()
104 Usage : $obj->accession($newval)
105 Function:
106 Example :
107 Returns : value of accession (a scalar)
108 Args : on set, new value (a scalar or undef, optional)
111 =cut
113 sub accession {
114 my($self,$val) = @_;
115 $self->{'accession'} = $val if defined($val);
116 return $self->{'accession'};
119 =head2 dataset()
121 Usage : $obj->dataset($newval)
122 Function:
123 Example :
124 Returns : value of dataset (a scalar)
125 Args : on set, new value (a scalar or undef, optional)
128 =cut
130 sub dataset {
131 my($self,$val) = @_;
132 $self->{'dataset'} = $val if defined($val);
133 return $self->{'dataset'};
136 =head2 db()
138 Usage : $obj->db($newval)
139 Function:
140 Example :
141 Returns : value of db (a scalar)
142 Args : on set, new value (a scalar or undef, optional)
145 =cut
147 sub db {
148 my($self,$val) = @_;
149 $self->{'db'} = $val if defined($val);
150 return $self->{'db'};
158 =head2 name()
160 Usage : $obj->name($newval)
161 Function:
162 Example :
163 Returns : value of name (a scalar)
164 Args : on set, new value (a scalar or undef, optional)
167 =cut
169 sub name {
170 my($self,$val) = @_;
171 $self->_load();
172 $self->{'name'} = $val if defined($val);
173 return $self->{'name'};
176 =head2 source_name()
178 Usage : $obj->source_name($newval)
179 Function:
180 Example :
181 Returns : value of source_name (a scalar)
182 Args : on set, new value (a scalar or undef, optional)
185 =cut
187 sub source_name {
188 my($self,$val) = @_;
189 $self->_load();
190 $self->{'source_name'} = $val if defined($val);
191 return $self->{'source_name'};
194 =head2 description()
196 Usage : $obj->description($newval)
197 Function:
198 Example :
199 Returns : value of description (a scalar)
200 Args : on set, new value (a scalar or undef, optional)
203 =cut
205 sub description {
206 my($self,$val) = @_;
207 $self->_load();
208 $self->{'description'} = $val if defined($val);
209 return $self->{'description'};
212 =head2 treatment_description()
214 Usage : $obj->treatment_description($newval)
215 Function:
216 Example :
217 Returns : value of treatment_description (a scalar)
218 Args : on set, new value (a scalar or undef, optional)
221 =cut
223 sub treatment_description {
224 my($self,$val) = @_;
225 $self->_load();
226 $self->{'treatment_description'} = $val if defined($val);
227 return $self->{'treatment_description'};
230 sub _load {
231 my $self = shift;
232 if ( $self->{'_load'} ) {
233 return 1;
235 $self->{'_load'}++;
236 $self->db->fill_sample( $self );
237 return $self->{'_load'};