in reply to Re^2: How to find any of many motifs?
in thread How to find any of many motifs?
Never mind. I think I see the problem.
Your motifs file contains some blank lines. A blank line will become undef, and undef will match anything.
A simple modification to my code to deal with this is:
if( defined $motif and $seq =~ m[$motif([^A-Z]+)[A-Z]] ) {
It would perhaps be better to deal with this at source--ie. remove blank lines from the motifs file--but data is rarely perfect in the real world, so the above fix is as good a way of dealing with it as any.
|
|---|