[Bioperl-l] total_combos addition for Bio::Tools::IUPAC

smontgom at bcgsc.ca smontgom at bcgsc.ca
Tue Oct 26 00:45:48 EDT 2004


Hi Aaron/Bioperl -

Can I send over this code for Bio::Tools::IUPAC in bioperl-live.
to be committed to CVS?

If it is cool that is.

Feel free to change the subroutine name (or anything else)

Cheers,
Stephen



=head2 total_combos

 Title   : total_combos
 Usage   : my $total_combos = $iupac->total_combos;
 Function: Calculates the total number of sequence combinations that can
be made using this IUPAC sequence
 Return  : int
 Args    : none

=cut

sub total_combos{
     my ($self) = @_;

     my $total_combos = 1;
     foreach my $alpha (@{$self->{'_alpha'}}) {
        $total_combos *= scalar (@$alpha);
     }
     return $total_combos;
}



More information about the Bioperl-l mailing list