| 1 | # | ||||||||||
| 2 | # BioPerl module for Bio::Tools::Tmhmm | ||||||||||
| 3 | # | ||||||||||
| 4 | # Original copyright Balamurugan Kumarasamy | ||||||||||
| 5 | # Re-written cleanly by Torsten Seemann, Sep 2006 | ||||||||||
| 6 | # | ||||||||||
| 7 | # Copyright: | ||||||||||
| 8 | # You may distribute this module under the same terms as Perl itself | ||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Bio::Tools::Tmhmm - parse TMHMM output (TransMembrane HMM) | ||||||||||
| 13 | |||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||
| 15 | |||||||||||
| 16 | use Bio::Tools::Tmhmm; | ||||||||||
| 17 | my $parser = Bio::Tools::Tmhmm->new(-fh => $filehandle ); | ||||||||||
| 18 | while ( my $tmhmm_feat = $parser->next_result ) { | ||||||||||
| 19 | # do something, e.g. | ||||||||||
| 20 | push @tmhmm_feat, $tmhmm_feat; | ||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | =head1 DESCRIPTION | ||||||||||
| 24 | |||||||||||
| 25 | TMHMM is software for the prediction of transmembrane helices in proteins. | ||||||||||
| 26 | See L<http://www.cbs.dtu.dk/services/TMHMM/> for more details. | ||||||||||
| 27 | |||||||||||
| 28 | This module parses the "long output" format of TMHMM 2.0 and | ||||||||||
| 29 | creates a Bio:SeqFeature::Generic object for each C<TMHelix> feature found | ||||||||||
| 30 | from lines like this: | ||||||||||
| 31 | |||||||||||
| 32 | my_sequence_id TMHMM2.0 TMhelix 54 76 | ||||||||||
| 33 | |||||||||||
| 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 | ||||||||||
| 41 | the Bioperl mailing list. 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 | of 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 - Torsten Seemann | ||||||||||
| 66 | |||||||||||
| 67 | Email torsten.seemann AT infotech.monash.edu.au | ||||||||||
| 68 | |||||||||||
| 69 | =head1 CONTRIBUTOR - Bala | ||||||||||
| 70 | |||||||||||
| 71 | Email savikalpa@fugu-sg.org | ||||||||||
| 72 | |||||||||||
| 73 | =head1 APPENDIX | ||||||||||
| 74 | |||||||||||
| 75 | The rest of the documentation details each of the object methods. | ||||||||||
| 76 | Internal methods are usually preceded with a _ | ||||||||||
| 77 | |||||||||||
| 78 | =cut | ||||||||||
| 79 | |||||||||||
| 80 | package Bio::Tools::Tmhmm; | ||||||||||
| 81 | 2 | $Bio::Tools::Tmhmm::VERSION = '1.7.8'; | |||||||||
| 82 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 83 | |||||||||||
| 84 | 2 | ▶ | use Bio::Tools::AnalysisResult; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 85 | 2 | ▶ | use Bio::Root::Root; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 86 | 2 | ▶ | use Bio::Root::IO; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 87 | |||||||||||
| 88 | 2 | ▶ | use base qw(Bio::Root::Root Bio::Root::IO Bio::Tools::AnalysisResult); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 89 | |||||||||||
| 90 | 2 | ▶ | use Bio::SeqFeature::Generic; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 91 | |||||||||||
| 92 | |||||||||||
| 93 | =head2 new | ||||||||||
| 94 | |||||||||||
| 95 | Title : new | ||||||||||
| 96 | Usage : my $obj = Bio::Tools::Tmhmm->new(); | ||||||||||
| 97 | Function: Builds a new Bio::Tools::Tmhmm object | ||||||||||
| 98 | Returns : Bio::Tools::Tmhmm | ||||||||||
| 99 | Args : Either of the following as per L<Bio::Root::IO> interface | ||||||||||
| 100 | -fh => $filehandle | ||||||||||
| 101 | -file => $filename | ||||||||||
| 102 | |||||||||||
| 103 | =cut | ||||||||||
| 104 | |||||||||||
| 105 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 106 | 1 | my($class,@args) = @_; | |||||||||
| 107 | 1 | my $self = $class->SUPER::new(@args); | |||||||||
| 108 | 1 | $self->_initialize_io(@args); | |||||||||
| 109 | 1 | return $self; | |||||||||
| 110 | } | ||||||||||
| 111 | |||||||||||
| 112 | |||||||||||
| 113 | =head2 next_result | ||||||||||
| 114 | |||||||||||
| 115 | Title : next_result | ||||||||||
| 116 | Usage : my $feat = $Tmhmm->next_result | ||||||||||
| 117 | Function: Get the next result set from parser data | ||||||||||
| 118 | Returns : Bio::SeqFeature::Generic | ||||||||||
| 119 | Args : none | ||||||||||
| 120 | |||||||||||
| 121 | =cut | ||||||||||
| 122 | |||||||||||
| 123 | 4 | ▶ | sub next_result { | ||||||||
|
Subroutine
next_result: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 124 | 4 | my $self = shift; | |||||||||
| 125 | |||||||||||
| 126 | # # my_sequence_id Length: 178 | ||||||||||
| 127 | # my_sequence_id TMHMM2.0 outside 1 53 | ||||||||||
| 128 | # my_sequence_id TMHMM2.0 TMhelix 54 76 | ||||||||||
| 129 | # my_sequence_id TMHMM2.0 inside 77 115 | ||||||||||
| 130 | |||||||||||
| 131 | 4 | ▶ | while (my $line = $self->_readline) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 132 | 12 | ▶ | if ( $line =~ m/^(\S+)\s+(\S+)\s+(TMhelix)\s+(\d+)\s+(\d+)$/i ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 133 | 3 | return Bio::SeqFeature::Generic->new( | |||||||||
| 134 | -primary => 'transmembrane', | ||||||||||
| 135 | -seq_id => $1, | ||||||||||
| 136 | -source => $2, | ||||||||||
| 137 | -start => $4, | ||||||||||
| 138 | -end => $5, | ||||||||||
| 139 | ); | ||||||||||
| 140 | } | ||||||||||
| 141 | } | ||||||||||
| 142 | } | ||||||||||
| 143 | |||||||||||
| 144 | 2 | 1; | |||||||||
| 145 | |||||||||||
| 146 | |||||||||||