| 1 | # | ||||||||||||||||||||||||||||
| 2 | # BioPerl module for Bio::Tools::HMMER::Set | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # Cared for by Ewan Birney <birney@sanger.ac.uk> | ||||||||||||||||||||||||||||
| 7 | # | ||||||||||||||||||||||||||||
| 8 | # Copyright Ewan Birney | ||||||||||||||||||||||||||||
| 9 | # | ||||||||||||||||||||||||||||
| 10 | # You may distribute this module under the same terms as perl itself | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # POD documentation - main docs before the code | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | =head1 NAME | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | Bio::Tools::HMMER::Set - Set of identical domains from HMMER matches | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # get a Set object probably from the results object | ||||||||||||||||||||||||||||
| 21 | print "Bits score over set ",$set->bits," evalue ",$set->evalue,"\n"; | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | foreach $domain ( $set->each_Domain ) { | ||||||||||||||||||||||||||||
| 24 | print "Domain start ",$domain->start," end ",$domain->end,"\n"; | ||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 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). | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | =head1 FEEDBACK | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | =head2 Mailing Lists | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | bioperl-l@bioperl.org - General discussion | ||||||||||||||||||||||||||||
| 44 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | =head2 Support | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | Please direct usage questions or support issues to the mailing list: | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | I<bioperl-l@bioperl.org> | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 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. | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | =head2 Reporting Bugs | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||
| 61 | web: | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | https://github.com/bioperl/bioperl-live/issues | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | =head1 AUTHOR - Ewan Birney | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | Email birney-at-ebi.ac.uk | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | =head1 APPENDIX | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | The rest of the documentation details each of the object | ||||||||||||||||||||||||||||
| 72 | methods. Internal methods are usually preceded with a _ | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | =cut | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | # Let the code begin... | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | package Bio::Tools::HMMER::Set; | ||||||||||||||||||||||||||||
| 81 | 3 | $Bio::Tools::HMMER::Set::VERSION = '1.7.3'; | |||||||||||||||||||||||||||
| 82 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | 3 | ▶ | use Bio::Tools::HMMER::Domain; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 3 | ▶ | use base qw(Bio::Root::Root); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 1505 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.2
Pod
documented
| |||||||||||||||||||||||||||||
| 89 | 1505 | my($class,@args) = @_; | |||||||||||||||||||||||||||
| 90 | 1505 | my $self = $class->SUPER::new(@args); | |||||||||||||||||||||||||||
| 91 | 1505 | my ($name,$acc,$desc) = $self->_rearrange([qw(NAME ACCESSION DESC)], | |||||||||||||||||||||||||||
| 92 | @args); | ||||||||||||||||||||||||||||
| 93 | 1505 | ▶ | $name && $self->name($name); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 94 | 1505 | ▶ | $acc && $self->accession($acc); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 95 | 1505 | ▶ | $desc && $self->desc($desc); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 1505 | $self->{'domains'} = []; | |||||||||||||||||||||||||||
| 99 | 1505 | $self->{'domainnames'} = {}; | |||||||||||||||||||||||||||
| 100 | 1505 | return $self; | |||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | =head2 add_Domain | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | Title : add_Domain | ||||||||||||||||||||||||||||
| 106 | Usage : $set->add_Domain($domain) | ||||||||||||||||||||||||||||
| 107 | Function: adds the domain to the list | ||||||||||||||||||||||||||||
| 108 | Returns : nothing | ||||||||||||||||||||||||||||
| 109 | Args : A Bio::Tools::HMMER::Domain object | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | =cut | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 3038 | ▶ | sub add_Domain{ | ||||||||||||||||||||||||||
|
Subroutine
add_Domain: called CC=4 SCAR=15.0
Pod
documented
| |||||||||||||||||||||||||||||
| 114 | 3038 | my ($self,$domain) = @_; | |||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | 3038 | ▶ | if( ! defined $domain || ! $domain->isa("Bio::Tools::HMMER::Domain") ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $domain and $domain->isa("Bio::Tools::HMMER::Domain")
MC/DC0%0/2
defined $domain and $domain->isa("Bio::Tools::HMMER::Domain")
defined $domain
$domain->isa("Bio::Tools::HMMER::Domain")
Truth table33%1/3
A and B
A= defined $domainB= $domain->isa("Bio::Tools::HMMER::Domain")
| |||||||||||||||||||||||||||||
| 118 | 0 | $self->throw("[$domain] is not a Bio::Tools::HMMER::Domain. aborting"); | |||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||
| 120 | 3038 | ▶ | return if $self->{'domainnames'}->{$domain->get_nse}++; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 121 | 2434 | push(@{$self->{'domains'}},$domain); | |||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | =head2 each_Domain | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | Title : each_Domain | ||||||||||||||||||||||||||||
| 128 | Usage : foreach $domain ( $set->each_Domain() ) | ||||||||||||||||||||||||||||
| 129 | Function: returns an array of domain objects in this set | ||||||||||||||||||||||||||||
| 130 | Returns : array | ||||||||||||||||||||||||||||
| 131 | Args : none | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | =cut | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | 1059 | ▶ | sub each_Domain{ | ||||||||||||||||||||||||||
|
Subroutine
each_Domain: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 137 | 1059 | my ($self,@args) = @_; | |||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | 1059 | return @{$self->{'domains'}}; | |||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | =head2 name | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | Title : name | ||||||||||||||||||||||||||||
| 145 | Usage : $obj->name($newval) | ||||||||||||||||||||||||||||
| 146 | Function: | ||||||||||||||||||||||||||||
| 147 | Example : | ||||||||||||||||||||||||||||
| 148 | Returns : value of name | ||||||||||||||||||||||||||||
| 149 | Args : newvalue (optional) | ||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | =cut | ||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||
| 154 | 3314 | ▶ | sub name{ | ||||||||||||||||||||||||||
|
Subroutine
name: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 155 | 3314 | my ($obj,$value) = @_; | |||||||||||||||||||||||||||
| 156 | 3314 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 157 | 1505 | $obj->{'name'} = $value; | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | 3314 | return $obj->{'name'}; | |||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | =head2 desc | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | Title : desc | ||||||||||||||||||||||||||||
| 166 | Usage : $obj->desc($newval) | ||||||||||||||||||||||||||||
| 167 | Function: | ||||||||||||||||||||||||||||
| 168 | Example : | ||||||||||||||||||||||||||||
| 169 | Returns : value of desc | ||||||||||||||||||||||||||||
| 170 | Args : newvalue (optional) | ||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | =cut | ||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||
| 174 | 4 | ▶ | sub desc{ | ||||||||||||||||||||||||||
|
Subroutine
desc: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 175 | 4 | my ($self,$value) = @_; | |||||||||||||||||||||||||||
| 176 | 4 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | 2 | $self->{'desc'} = $value; | |||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||
| 179 | 4 | return $self->{'desc'}; | |||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | =head2 accession | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | Title : accession | ||||||||||||||||||||||||||||
| 186 | Usage : $obj->accession($newval) | ||||||||||||||||||||||||||||
| 187 | Function: | ||||||||||||||||||||||||||||
| 188 | Example : | ||||||||||||||||||||||||||||
| 189 | Returns : value of accession | ||||||||||||||||||||||||||||
| 190 | Args : newvalue (optional) | ||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | =cut | ||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | 1506 | ▶ | sub accession{ | ||||||||||||||||||||||||||
|
Subroutine
accession: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 196 | 1506 | my ($self,$value) = @_; | |||||||||||||||||||||||||||
| 197 | 1506 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 198 | 2 | $self->{'accession'} = $value; | |||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||
| 200 | 1506 | return $self->{'accession'}; | |||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | =head2 bits | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | Title : bits | ||||||||||||||||||||||||||||
| 207 | Usage : $obj->bits($newval) | ||||||||||||||||||||||||||||
| 208 | Function: | ||||||||||||||||||||||||||||
| 209 | Example : | ||||||||||||||||||||||||||||
| 210 | Returns : value of bits | ||||||||||||||||||||||||||||
| 211 | Args : newvalue (optional) | ||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | =cut | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | 2255 | ▶ | sub bits{ | ||||||||||||||||||||||||||
|
Subroutine
bits: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 217 | 2255 | my ($obj,$value) = @_; | |||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||
| 219 | 2255 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 220 | 1503 | $obj->{'bits'} = $value; | |||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||
| 222 | 2255 | return $obj->{'bits'}; | |||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | =head2 evalue | ||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||
| 228 | Title : evalue | ||||||||||||||||||||||||||||
| 229 | Usage : $obj->evalue($newval) | ||||||||||||||||||||||||||||
| 230 | Function: | ||||||||||||||||||||||||||||
| 231 | Example : | ||||||||||||||||||||||||||||
| 232 | Returns : value of evalue | ||||||||||||||||||||||||||||
| 233 | Args : newvalue (optional) | ||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | =cut | ||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||
| 238 | 1504 | ▶ | sub evalue{ | ||||||||||||||||||||||||||
|
Subroutine
evalue: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 239 | 1504 | my ($obj,$value) = @_; | |||||||||||||||||||||||||||
| 240 | 1504 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 241 | 1503 | $obj->{'evalue'} = $value; | |||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||
| 243 | 1504 | return $obj->{'evalue'}; | |||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | 0 | ▶ | sub addHMMUnit { | ||||||||||||||||||||||||||
|
Subroutine
addHMMUnit: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 249 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 250 | 0 | my $unit = shift; | |||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||
| 252 | 0 | $self->warn("Using old addHMMUnit call on Bio::Tools::HMMER::Set. Should replace with add_Domain"); | |||||||||||||||||||||||||||
| 253 | 0 | return $self->add_Domain($unit); | |||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||
| 256 | 0 | ▶ | sub eachHMMUnit { | ||||||||||||||||||||||||||
|
Subroutine
eachHMMUnit: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 257 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 258 | 0 | $self->warn("Using old eachHMMUnit call on Bio::Tools::HMMER::Set. Should replace with each_Domain"); | |||||||||||||||||||||||||||
| 259 | 0 | return $self->each_Domain(); | |||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||
| 262 | 3 | 1; # says use was ok | |||||||||||||||||||||||||||
| 263 | __END__ | ||||||||||||||||||||||||||||