Bio::Tools
Seg
Toolbar
Summary
Bio::Tools::Seg - parse Seg output (filter low complexity protein sequence)
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
use Bio::Tools::Seg;
my $parser = new Bio::Tools::Seg(-fh =>$filehandle );
while( my $seg_feat = $parser->next_result ) {
#do something
#eg
push @seg_feat, $seg_feat;
}
Description
Parser for Seg output
Methods
Methods description
Title : create_feature Usage : obj->create_feature(\%feature) Function: Internal(not to be used directly) Returns : Args : |
Title : new Usage : my $obj = new Bio::Tools::Seg(); Function: Builds a new Bio::Tools::Seg object Returns : Bio::Tools::Seg Args : -fh/-file => $val, # for initing input, see Bio::Root::IO |
Title : next_result Usage : my $feat = $seg->next_result Function: Get the next result set from parser data Returns : Bio::SeqFeature::Generic Args : none |
Methods code
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;
}
1; } |
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=~/^\>/) { $line=~/^\>\s*(\S+)\s*\((\d+)\-(\d+)\)\s*complexity=(\S+)/;
my $id = $1;
my $start = $2;
my $end = $3;
my $score = $4;
my (%feature);
$feature{name} = $id;
$feature{score} = $score;
$feature{start} = $start;
$feature{end} = $end;
$feature{source} = "Seg";
$feature{primary} = 'low_complexity';
$feature{program} = "Seg";
$feature{logic_name} = 'low_complexity';
my $new_feat = $self->create_feature (\%feature);
return $new_feat;
}
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/
Additional contributors names and emails here
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _