in reply to Removing Poly-ATCG from and Array of Strings
sub remove_poly { my ($list, $threshold) = @_; return map { my $lim = $threshold * length $list->[$_]; my (%cnt, $excede); for ( unpack 'U*', $list->[$_] ) { $excede = 1, last if ++$cnt{$_} > $lim; } $excede ? () : $list->[$_]; } 0 .. $#$list; }
Cheers - L~R
|
|---|