sub new
{ my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
$self->_initialize_io(@args);
my ($prog) = $self->_rearrange([qw(PROGRAM)], @args);
$self->{'_program'} = $prog;
return $self;} |
sub next_matrix
{ my ($self) = @_;
my @names;
my @values;
my $entry;
my $size = 0;
while ($entry=$self->_readline) {
if($#names >=0 && $entry =~/^\s+\d+\n$/){
$self->_pushback($_);
last;
} elsif($entry=~/^\s+(\d+)\n$/){
$size = $1;
next;
} elsif( $entry =~ s/^\s+(\-?\d+\.\d+)/$1/ ) {
my (@line) = split( /\s+/,$entry);
push @{$values[-1]}, @line;
next;
}
my ($n,@line) = split( /\s+/,$entry);
push @names, $n;
push @values, [@line];
}
if( scalar @names != $size ) {
$self->warn("The number of entries ".(scalar @names).
" is not the same $size");
}
$#names>=0 || return;
my %dist;
my $i=0;
for my $name (@names){
my $j=0;
for my $n (@names) {
$dist{$name}{$n} = [$i,$j];
$j++;
}
$i++;
}
return Bio::Matrix::PhylipDist->new(-program => $self->{'_program'},
-matrix =>\% dist,
-names =>\@ names,
-values =>\@ values);} |
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/wiki/Mailing_lists - 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 the
web:
http://bugzilla.open-bio.org/
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _