2 # BioPerl module for Bio::Tools::HMMER::Set
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Ewan Birney <birney@sanger.ac.uk>
8 # Copyright Ewan Birney
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Tools::HMMER::Set - Set of identical domains from HMMER matches
20 # get a Set object probably from the results object
21 print "Bits score over set ",$set->bits," evalue ",$set->evalue,"\n";
23 foreach $domain ( $set->each_Domain ) {
24 print "Domain start ",$domain->start," end ",$domain->end,"\n";
29 Represents a set of HMMER domains hitting one sequence. HMMER reports two
30 different scores, a per sequence total score (and evalue) and a per
31 domain score and evalue. This object represents a collection of the same
32 domain with the sequence bits score and evalue. (these attributes are also
33 on the per domain scores, which you can get there).
39 User feedback is an integral part of the evolution of this and other
40 Bioperl modules. Send your comments and suggestions preferably to one
41 of the Bioperl mailing lists. Your participation is much appreciated.
43 bioperl-l@bioperl.org - General discussion
44 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
48 Please direct usage questions or support issues to the mailing list:
50 I<bioperl-l@bioperl.org>
52 rather than to the module maintainer directly. Many experienced and
53 reponsive experts will be able look at the problem and quickly
54 address it. Please include a thorough description of the problem
55 with code and data examples if at all possible.
59 Report bugs to the Bioperl bug tracking system to help us keep track
60 the bugs and their resolution.Bug reports can be submitted via the
63 https://github.com/bioperl/bioperl-live/issues
65 =head1 AUTHOR - Ewan Birney
67 Email birney-at-ebi.ac.uk
71 The rest of the documentation details each of the object
72 methods. Internal methods are usually preceded with a _
77 # Let the code begin...
80 package Bio
::Tools
::HMMER
::Set
;
83 use Bio
::Tools
::HMMER
::Domain
;
85 use base
qw(Bio::Root::Root);
88 my($class,@args) = @_;
89 my $self = $class->SUPER::new
(@args);
90 my ($name,$acc,$desc) = $self->_rearrange([qw(NAME ACCESSION DESC)],
92 $name && $self->name($name);
93 $acc && $self->accession($acc);
94 $desc && $self->desc($desc);
97 $self->{'domains'} = [];
98 $self->{'domainnames'} = {};
105 Usage : $set->add_Domain($domain)
106 Function: adds the domain to the list
108 Args : A Bio::Tools::HMMER::Domain object
113 my ($self,$domain) = @_;
116 if( ! defined $domain || ! $domain->isa("Bio::Tools::HMMER::Domain") ) {
117 $self->throw("[$domain] is not a Bio::Tools::HMMER::Domain. aborting");
119 return if $self->{'domainnames'}->{$domain->get_nse}++;
120 push(@
{$self->{'domains'}},$domain);
127 Usage : foreach $domain ( $set->each_Domain() )
128 Function: returns an array of domain objects in this set
136 my ($self,@args) = @_;
138 return @
{$self->{'domains'}};
144 Usage : $obj->name($newval)
147 Returns : value of name
148 Args : newvalue (optional)
154 my ($obj,$value) = @_;
155 if( defined $value) {
156 $obj->{'name'} = $value;
158 return $obj->{'name'};
165 Usage : $obj->desc($newval)
168 Returns : value of desc
169 Args : newvalue (optional)
174 my ($self,$value) = @_;
175 if( defined $value) {
176 $self->{'desc'} = $value;
178 return $self->{'desc'};
185 Usage : $obj->accession($newval)
188 Returns : value of accession
189 Args : newvalue (optional)
195 my ($self,$value) = @_;
196 if( defined $value) {
197 $self->{'accession'} = $value;
199 return $self->{'accession'};
206 Usage : $obj->bits($newval)
209 Returns : value of bits
210 Args : newvalue (optional)
216 my ($obj,$value) = @_;
218 if( defined $value) {
219 $obj->{'bits'} = $value;
221 return $obj->{'bits'};
228 Usage : $obj->evalue($newval)
231 Returns : value of evalue
232 Args : newvalue (optional)
238 my ($obj,$value) = @_;
239 if( defined $value) {
240 $obj->{'evalue'} = $value;
242 return $obj->{'evalue'};
251 $self->warn("Using old addHMMUnit call on Bio::Tools::HMMER::Set. Should replace with add_Domain");
252 return $self->add_Domain($unit);
257 $self->warn("Using old eachHMMUnit call on Bio::Tools::HMMER::Set. Should replace with each_Domain");
258 return $self->each_Domain();