Bio::Tools Seg
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
Bio::Tools::Seg - parse Seg output (filter low complexity protein sequence)
Package variables
No package variables defined.
Included modules
Bio::Root::IO
Bio::Root::Root
Bio::SeqFeature::FeaturePair
Bio::SeqFeature::Generic
Inherit
Bio::Root::IO Bio::Root::Root
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
newDescriptionCode
next_resultDescriptionCode
create_featureDescriptionCode
Methods description
newcode    nextTop
 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
next_resultcodeprevnextTop
 Title   : next_result
 Usage   : my $feat = $seg->next_result
 Function: Get the next result set from parser data
 Returns : Bio::SeqFeature::Generic
 Args    : none
create_feature codeprevnextTop
 Title   : create_feature
 Usage   : obj->create_feature(\%feature)
 Function: Internal(not to be used directly)
 Returns : 
 Args    :
Methods code
newdescriptionprevnextTop
sub new {
      my($class,@args) = @_;

      my $self = $class->SUPER::new(@args);
      $self->_initialize_io(@args);

      return $self;
}
next_resultdescriptionprevnextTop
sub next_result {
        my ($self) = @_;

        my $line;
        # parse
my $id; while ($_=$self->_readline()) { $line = $_; chomp $line; next if /^$/; if ($line=~/^\>/) { #if it is a line starting with a ">"
$line=~/^\>\s*(\S+)\s*\((\d+)\-(\d+)\)\s*complexity=(\S+)/; my $id = $1; my $start = $2; my $end = $3; my $score = $4; #for example in this line test_prot(214-226) complexity=2.26 (12/2.20/2.50)
#$1 is test_prot $2 is 214 $3 is 226 and $4 is 2.26
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; }
}
create_featuredescriptionprevnextTop
sub create_feature {
       my ($self, $feat) = @_;


       # create feature object
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;
}
General documentation
FEEDBACKTop
Mailing ListsTop
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
Reporting BugsTop
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/
AUTHOR - BalaTop
Email savikalpa@fugu-sg.org
CONTRIBUTORSTop
Additional contributors names and emails here
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _