bioperl / bioperl-run

BioPerl wrappers
http://bioperl.org
Other
35 stars 17 forks source link

Bio::Tools::Run::Phylo::Phyml, rand_starts cannot be set to 0 #44

Closed qifei9 closed 7 years ago

qifei9 commented 7 years ago

In Bio::Tools::Run::Phylo::Phyml, the parameter rand_starts cannot be set to 0.

=head2 rand_starts
 Title   : rand_starts
 Usage   : $factory->rand_starts(10);
 Function: Sets the number of initial random SPR trees
 Returns : integer (defaults to 1)
 Args    : None to get, integer to set.
v3.* only; only valid if $prog-E<gt>search is 'SPR'
=cut

sub rand_starts {
    my ( $self, $value ) = @_;
    $self->throw("Not a valid parameter [rand_starts] prior to PhyML v3")
      if $self->version < 3;
    if ( defined $value ) {
        die "Invalid number [$value]"
          unless $value =~ /^[-+]?\d+$/;
        $self->{_rand_starts} = $value;
    }
    return $self->{_rand_starts} || 1;
}
bosborne commented 7 years ago

Fixed, thank you.