3 # BioPerl module for Bio::Tools::HMMER::Set
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Ewan Birney <birney@sanger.ac.uk>
9 # Copyright Ewan Birney
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
17 Bio::Tools::HMMER::Set - Set of identical domains from HMMER matches
21 # get a Set object probably from the results object
22 print "Bits score over set ",$set->bits," evalue ",$set->evalue,"\n";
24 foreach $domain ( $set->each_Domain ) {
25 print "Domain start ",$domain->start," end ",$domain->end,"\n";
30 Represents a set of HMMER domains hitting one sequence. HMMER reports two
31 different scores, a per sequence total score (and evalue) and a per
32 domain score and evalue. This object represents a collection of the same
33 domain with the sequence bits score and evalue. (these attributes are also
34 on the per domain scores, which you can get there).
40 User feedback is an integral part of the evolution of this and other
41 Bioperl modules. Send your comments and suggestions preferably to one
42 of the Bioperl mailing lists. Your participation is much appreciated.
44 bioperl-l@bioperl.org - General discussion
45 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
49 Please direct usage questions or support issues to the mailing list:
51 I<bioperl-l@bioperl.org>
53 rather than to the module maintainer directly. Many experienced and
54 reponsive experts will be able look at the problem and quickly
55 address it. Please include a thorough description of the problem
56 with code and data examples if at all possible.
60 Report bugs to the Bioperl bug tracking system to help us keep track
61 the bugs and their resolution.Bug reports can be submitted via the
62 web: http://bugzilla.open-bio.org/
64 =head1 AUTHOR - Ewan Birney
66 Email birney-at-ebi.ac.uk
70 The rest of the documentation details each of the object
71 methods. Internal methods are usually preceded with a _
76 # Let the code begin...
79 package Bio
::Tools
::HMMER
::Set
;
82 use Bio
::Tools
::HMMER
::Domain
;
84 use base
qw(Bio::Root::Root);
87 my($class,@args) = @_;
88 my $self = $class->SUPER::new
(@args);
89 my ($name,$acc,$desc) = $self->_rearrange([qw(NAME ACCESSION DESC)],
91 $name && $self->name($name);
92 $acc && $self->accession($acc);
93 $desc && $self->desc($desc);
96 $self->{'domains'} = [];
97 $self->{'domainnames'} = {};
104 Usage : $set->add_Domain($domain)
105 Function: adds the domain to the list
107 Args : A Bio::Tools::HMMER::Domain object
112 my ($self,$domain) = @_;
115 if( ! defined $domain || ! $domain->isa("Bio::Tools::HMMER::Domain") ) {
116 $self->throw("[$domain] is not a Bio::Tools::HMMER::Domain. aborting");
118 return if $self->{'domainnames'}->{$domain->get_nse}++;
119 push(@
{$self->{'domains'}},$domain);
126 Usage : foreach $domain ( $set->each_Domain() )
127 Function: returns an array of domain objects in this set
135 my ($self,@args) = @_;
137 return @
{$self->{'domains'}};
143 Usage : $obj->name($newval)
146 Returns : value of name
147 Args : newvalue (optional)
153 my ($obj,$value) = @_;
154 if( defined $value) {
155 $obj->{'name'} = $value;
157 return $obj->{'name'};
164 Usage : $obj->desc($newval)
167 Returns : value of desc
168 Args : newvalue (optional)
173 my ($self,$value) = @_;
174 if( defined $value) {
175 $self->{'desc'} = $value;
177 return $self->{'desc'};
184 Usage : $obj->accession($newval)
187 Returns : value of accession
188 Args : newvalue (optional)
194 my ($self,$value) = @_;
195 if( defined $value) {
196 $self->{'accession'} = $value;
198 return $self->{'accession'};
205 Usage : $obj->bits($newval)
208 Returns : value of bits
209 Args : newvalue (optional)
215 my ($obj,$value) = @_;
217 if( defined $value) {
218 $obj->{'bits'} = $value;
220 return $obj->{'bits'};
227 Usage : $obj->evalue($newval)
230 Returns : value of evalue
231 Args : newvalue (optional)
237 my ($obj,$value) = @_;
238 if( defined $value) {
239 $obj->{'evalue'} = $value;
241 return $obj->{'evalue'};
250 $self->warn("Using old addHMMUnit call on Bio::Tools::HMMER::Set. Should replace with add_Domain");
251 return $self->add_Domain($unit);
256 $self->warn("Using old eachHMMUnit call on Bio::Tools::HMMER::Set. Should replace with each_Domain");
257 return $self->each_Domain();