Haven't figured out how to make findinRows_EX tacit yet, but good if
performance and simplicity are desired.
A=:'CTGGTTGAT','GTAGTCATA','CATGTCTAA','TCGAAAGTT',:'CCGGAGAAG'
B=:'TAGT'
ts' AA findinRows_ML BB'[AA=: 500 $,:A [BB=:500$B
4.48007 2.08916e8
ts' AA findinRows_SH BB'
0.567838 3.37196e7
AA (findinRows_ML (-: |:) findinRows_SH) BB
1
findinRows_EX=:(4 : 0)"1
while. #x do.
if. ''-:y do. 1 return. end.
x=.x}.~x i.{.y
y=.}.y
end.
0
)
ts' AA findinRows_EX BB'
0.0826731 9472
AA (findinRows_EX (-: |:) findinRows_SH) BB
1
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm