in reply to Re^3: How to find any of many motifs?
in thread How to find any of many motifs?
I wish that it could find any of motifs for each gene
So it seems you want to test all motifs against every gene. In case the list of all motifs fits into working memory, you could read them into an array (once, at the beginning), and then iterate over it for every gene. Roughly sketched:
my @motifs; while (my $motif = <MOTIF>) { ... push @motifs, $motif; } while (my $seq = <FILE>) { ... for my $motif (@motifs) { if ( $seq =~ /$motif/ ) { ... } ... } }
|
|---|