Bio::Tools
Tmhmm
Toolbar
Summary
Bio::Tools::Tmhmm - parse TmHMM output (transmembrane HMM)
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
use Bio::Tools::Tmhmm;
my $parser = new Bio::Tools::Tmhmm(-fh =>$filehandle );
while( my $tmhmm_feat = $parser->next_result ) {
#do something
#eg
push @tmhmm_feat, $tmhmm_feat;
}
Description
Parser for Tmhmm output
Methods
Methods description
Title : _seqname Usage : obj->_seqname($seqname) Function: Internal(not to be used directly) Returns : Args : seqname |
Title : create_feature Usage : obj->create_feature(\%feature) Function: Internal(not to be used directly) Returns : A Bio::SeqFeature::Generic object Args : |
Title : new Usage : my $obj = new Bio::Tools::Tmhmm(); Function: Builds a new Bio::Tools::Tmhmm object Returns : Bio::Tools::Tmhmm Args : -fh/-file => $val, # for initing input, see Bio::Root::IO |
Title : next_result Usage : my $feat = $Tmhmm->next_result Function: Get the next result set from parser data Returns : Bio::SeqFeature::Generic Args : none |
Methods code
sub _seqname
{ my ($self,$seqname)=@_;
if (defined $seqname){
$self->{'seqname'}=$seqname;
}
return $self->{'seqname'};
}
1; } |
sub create_feature
{ my ($self, $feat) = @_;
my $feature = Bio::SeqFeature::Generic->new(-seq_id => $feat->{name},
-start => $feat->{start},
-end => $feat->{end},
-score => $feat->{score},
-source => $feat->{source},
-primary => $feat->{primary},
-logic_name => $feat->{logic_name},
);
return $feature; } |
sub new
{ my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
$self->_initialize_io(@args);
return $self; } |
sub next_result
{ my ($self) = @_;
my $line;
my $id;
while ($_=$self->_readline()) {
$line = $_;
chomp $line;
next if /^$/;
if ($line=~/^#\s+(\S+)/) {
$id = $1;
my ($junk, $values) = split /:/;
$self->_seqname($id);
next;
}
elsif ($line=~/^(\S+)\s+(\S+)\s+(\w+)\s+(\d+)\s+(\d+)/) {
my $orien = $3;
my $start = $4;
my $end = $5;
$orien = uc ($orien);
if ($orien eq "TMHELIX") {
my (%feature);
$feature{name} = $self->_seqname;
$feature{start} = $start;
$feature{end} = $end;
$feature{source} ='tmhmm';
$feature{primary}= 'transmembrane';
$feature{program} ='tmhmm';
$feature{logic_name} = 'TMHelix';
my $new_feat= $self->create_feature(\%feature);
return $new_feat;
}
next;
}
next;
} } |
General documentation
user feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/MailList.shtml - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
email or the web:
bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _