| 1 | # $Id: bioperl.lisp 15559 2009-02-23 12:11:20Z maj $ |
| 2 | # |
| 3 | # BioPerl module for Bio::Search::Result::hmmer3Result |
| 4 | # |
| 5 | # Please direct questions and support issues to <[email protected]> |
| 6 | # |
| 7 | # Cared for by Thomas Sharpton <[email protected]> |
| 8 | # |
| 9 | # Copyright Thomas Sharpton |
| 10 | # |
| 11 | # You may distribute this module under the same terms as perl itself |
| 12 | |
| 13 | # POD documentation - main docs before the code |
| 14 | |
| 15 | =head1 NAME |
| 16 | |
| 17 | Bio::Search::Result::hmmer3Result - DESCRIPTION of Object |
| 18 | |
| 19 | =head1 SYNOPSIS |
| 20 | |
| 21 | Give standard usage here |
| 22 | |
| 23 | =head1 DESCRIPTION |
| 24 | |
| 25 | Describe the object here |
| 26 | |
| 27 | =head1 FEEDBACK |
| 28 | |
| 29 | =head2 Mailing Lists |
| 30 | |
| 31 | User feedback is an integral part of the evolution of this and other |
| 32 | Bioperl modules. Send your comments and suggestions preferably to |
| 33 | the Bioperl mailing list. Your participation is much appreciated. |
| 34 | |
| 35 | [email protected] - General discussion |
| 36 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
| 37 | |
| 38 | =head2 Support |
| 39 | |
| 40 | Please direct usage questions or support issues to the mailing list: |
| 41 | |
| 42 | L<[email protected]> |
| 43 | |
| 44 | rather than to the module maintainer directly. Many experienced and |
| 45 | reponsive experts will be able look at the problem and quickly |
| 46 | address it. Please include a thorough description of the problem |
| 47 | with code and data examples if at all possible. |
| 48 | |
| 49 | =head2 Reporting Bugs |
| 50 | |
| 51 | Report bugs to the Bioperl bug tracking system to help us keep track |
| 52 | of the bugs and their resolution. Bug reports can be submitted via |
| 53 | the web: |
| 54 | |
| 55 | https://github.com/bioperl/bioperl-live/issues |
| 56 | |
| 57 | =head1 AUTHOR - Thomas Sharpton |
| 58 | |
| 59 | Email [email protected] |
| 60 | |
| 61 | Describe contact details here |
| 62 | |
| 63 | =head1 CONTRIBUTORS |
| 64 | |
| 65 | Additional contributors names and emails here |
| 66 | |
| 67 | =head1 APPENDIX |
| 68 | |
| 69 | The rest of the documentation details each of the object methods. |
| 70 | Internal methods are usually preceded with a _ |
| 71 | |
| 72 | =cut |
| 73 | |
| 74 | # Let the code begin... |
| 75 | |
| 76 | package Bio::Search::Result::hmmer3Resultscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/; |
| 77 | $Bio::Search::Result::hmmer3Result::VERSIONscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/$VERSION. = '1.7.3'; |
| 78 | use strictscip-perl cpan Bio-SearchIO-hmmer 1.7.3 strict/; |
| 79 | |
| 80 | use basescip-perl cpan Bio-SearchIO-hmmer 1.7.3 base/ qw(Bio::Search::Result::GenericResult); |
| 81 | |
| 82 | =head2 new |
| 83 | |
| 84 | Title : new |
| 85 | Usage : my $obj = new Bio::Search::Result::hmmer3Result.pm(); |
| 86 | Function: Builds a new Bio::Search::Result::hmmer3Result.pm object |
| 87 | Returns : an instance of Bio::Search::Result::hmmer3Result.pm |
| 88 | Args : -hmm_name => string, name of hmm file |
| 89 | -sequence_file => name of the sequence file |
| 90 | |
| 91 | =cut |
| 92 | |
| 93 | sub newscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/new(). { |
| 94 | my($class,@args) = @_scip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/`@_`.; |
| 95 | my $self = $class->SUPER::newscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/`SUPER::new`().(@args); |
| 96 | |
| 97 | my ($hmm,$seqfile) = $self->_rearrangescip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/_rearrange().([qw(HMM_NAME SEQUENCE_FILE)], |
| 98 | @args); |
| 99 | definedscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/defined().( $seqfile ) && $self->sequence_filescip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/sequence_file().( $seqfile ); |
| 100 | definedscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/defined().( $hmm ) && $self->hmm_namescip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/hmm_name().( $hmm ); |
| 101 | |
| 102 | return $self; |
| 103 | } |
| 104 | |
| 105 | =head2 hmm_name |
| 106 | |
| 107 | Title : hmm_name |
| 108 | Usage : $obj->hmm_name($newval) |
| 109 | Function: Get/Set the value of hmm_name |
| 110 | Returns : value of hmm_name |
| 111 | Args : newvalue (optional) |
| 112 | |
| 113 | |
| 114 | =cut |
| 115 | |
| 116 | sub hmm_namescip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/hmm_name().{ |
| 117 | my ($self,$value) = @_scip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/`@_`.; |
| 118 | if( definedscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/defined(). $value) { |
| 119 | $self->{'_hmm_name'} = $value; |
| 120 | } |
| 121 | return $self->{'_hmm_name'}; |
| 122 | } |
| 123 | |
| 124 | =head2 sequence_file |
| 125 | |
| 126 | Title : sequence_file |
| 127 | Usage : $obj->sequence_file($newval) |
| 128 | Function: Get/Set the value of sequence_file |
| 129 | Returns : value of sequence_file |
| 130 | Args : newvalue (optional) |
| 131 | |
| 132 | |
| 133 | =cut |
| 134 | |
| 135 | sub sequence_filescip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/sequence_file().{ |
| 136 | my ($self,$value) = @_scip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/`@_`.; |
| 137 | if( definedscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/defined(). $value) { |
| 138 | $self->{'_sequence_file'} = $value; |
| 139 | } |
| 140 | return $self->{'_sequence_file'}; |
| 141 | |
| 142 | } |
| 143 | |
| 144 | =head2 next_model |
| 145 | |
| 146 | Title : next_model |
| 147 | Usage : my $domain = $result->next_model |
| 148 | Function: Returns the next domain - this |
| 149 | is an alias for next_hit |
| 150 | Returns : L<Bio::Search::Hit::HitI> object |
| 151 | Args : none |
| 152 | |
| 153 | |
| 154 | =cut |
| 155 | |
| 156 | sub next_modelscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/next_model().{ shift->next_hitscip-perl cpan Bio-SearchIO-hmmer 1.7.3 shift/next_hit(). } |
| 157 | |
| 158 | =head2 models |
| 159 | |
| 160 | Title : models |
| 161 | Usage : my @domains = $result->models; |
| 162 | Function: Returns the list of HMM models seen - this |
| 163 | is an alias for hits() |
| 164 | Returns : Array of L<Bio::Search::Hit::HitI> objects |
| 165 | Args : none |
| 166 | |
| 167 | |
| 168 | =cut |
| 169 | |
| 170 | sub modelsscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/models().{ shift->hitsscip-perl cpan Bio-SearchIO-hmmer 1.7.3 shift/hits(). } |
| 171 | |
| 172 | =head2 rewind |
| 173 | |
| 174 | Title : rewind |
| 175 | Usage : $result->rewind; |
| 176 | Function: Allow one to reset the Hit iteration to the beginning |
| 177 | Since this is an in-memory implementation |
| 178 | Returns : none |
| 179 | Args : none |
| 180 | |
| 181 | =cut |
| 182 | |
| 183 | sub rewindscip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/rewind().{ |
| 184 | my ($self) = @_scip-perl cpan Bio-SearchIO-hmmer 1.7.3 Bio/Search/Result/hmmer3Result/`@_`.; |
| 185 | $self->{'_hitindex'} = 0; |
| 186 | } |
| 187 | |
| 188 | |
| 189 | |
| 190 | 1; |