in reply to Re: To count letters (%identity) in DNA alignment
in thread To count letters (%identity) in DNA alignment
And while we're at it, if we're ready to deal with unsuitable data, might as well, point out when it happens:
For that matter, if all the records are supposed to have the same number of letters, add that as part of the conditional.... my $bad_count = 0; while (<...>) { chomp; my ( $name, $seq ) = split; unless ( $seq and $seq =~ /^[ACGT]+$/ ) { $bad_count++; next; } ... } warn "Input file had $bad_count unusable lines\n"; ...
|
|---|