[Bioperl-l] Bio::AlignIO error

Alex Brown abrown at hgmp.mrc.ac.uk
Tue Apr 12 04:53:50 EDT 2005

I believe I have found an error in Bio::AlignIO - I was getting 
unrealistic results from $aln->no_residues. I traced this to the 
no_residues subroutine in Bio::SimpleAlign:

sub no_residues {
     my $self = shift;
     my $count = 0;

     foreach my $seq ($self->each_seq) {
	my $str = $seq->seq();

	$count += ($str =~ s/[^A-Za-z]//g);

     return $count;

I think line 8 of the subroutine should read:

$count += ($str =~ s/[A-Za-z]//g);


Alex Brown.

More information about the Bioperl-l mailing list