Bio::Tools::Phylo::Phylip ProtDist
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::Tools::Phylo::Phylip::ProtDist - DESCRIPTION of Object
Package variables
No package variables defined.
Included modules
Bio::Matrix::PhylipDist
Bio::Root::IO
Bio::Root::Root
Inherit
Bio::Root::IO Bio::Root::Root
Synopsis
    use Bio::Tools::Phylo::Phylip::ProtDist;
my $parser = new Bio::Tools::Phylo::Phylip::ProtDist(-file => 'outfile');
while( my $result = $parser->next_matrix) {
}
Description
A parser for ProtDist output into a Bio::Matrix::PhylipDist object
Methods
newDescriptionCode
next_matrix
No description
Code
Methods description
newcode    nextTop
 Title   : new
Usage : my $obj = new Bio::Tools::Phylo::Phylip::ProtDist();
Function: Builds a new Bio::Tools::Phylo::Phylip::ProtDist object
Returns : Bio::Tools::ProtDist
Args : -fh/-file => $val, # for initing input, see Bio::Root::IO
Methods code
newdescriptionprevnextTop
sub new {
  my($class,@args) = @_;

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

  return $self;
}
next_matrixdescriptionprevnextTop
sub next_matrix {
   my ($self) = @_;
   my @names;
   my @values;
   my $entry;
   while ($entry=$self->_readline) {
       if($#names >=0 && $entry =~/^\s+\d+$/){
           last;
       }
       elsif($entry=~/^\s+\d+\n$/){
           next;
       }
       my ($n,@line) = split( /\s+/,$entry);
       push @names, $n;
       push @values, [@line];
    }
    $#names>=0 || return;
    my %dist;
    my $i=0;
    foreach my $name(@names){
      my $j=0;
      foreach my $n(@names) {
        $dist{$name}{$n} = [$i,$j];
        $j++;
      }
     $i++;
    }
    my $matrix = Bio::Matrix::PhylipDist->new(-matrix=>\%dist,
                                              -names =>\@names,
                                              -values=>\@values);
    return $matrix;
}

1;
}
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 - Shawn Hoon Top
Email shawnh@fugu-sg.org
Describe contact details here
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 _
next_resultTop
 Title   : next_result
Usage : my $matrix = $parser->next_result
Function: Get the next result set from parser data
Returns : Bio::Matrix::PhylipDist
Args : none