@string = <IN1>; chomp @string; foreach my $string (@string) { foreach $key (keys %seq) { chomp $string; study $seq{$key}; my @matches = ($seq{$key} =~ /$string/ig); #print "@matches\n"; $result{$string} = scalar(@matches); } foreach my $s (keys %result) { print "$s => $result{$s}\n"; }
Your current algorithm would be more efficient as:
@string = <IN1>; chomp @string; while ( my $string = <IN1> ) { chomp $string; my ( $value ) = values %seq; my $result = () = $value =~ /$string/ig; print "$string => $result\n"; }
In reply to Re: counting the number of 16384 pattern matches in a large DNA sequence
by jwkrahn
in thread counting the number of 16384 pattern matches in a large DNA sequence
by anonym
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |