awk -v seq="CTGTTGGGGGCCCGTGC" '
NR%4 == 1 {name = $0}
NR%4 == 2 && index($0, seq) {print name}
' filename
Se, por "taxa de incompatibilidade de 1", você quiser ser capaz de corresponder 29 dessas 30 (como CTG.TGGGGGCCCGTGC
, isso é um pouco mais complexo.
...
Eh, não muito mais complexo:
awk -v seq="CTGTTGGGGGCCCGTGC" '
NR%4 == 1 {name=$0}
NR%4 == 2 {
if (index($0, seq))
print "found seq \"" seq "\" in " name
else
for (i=1; i<=length(seq); i++) {
patt = substr(seq, 1, i-1) "." substr(seq, i+1)
if (match($0, patt)) {
print "found pattern \"" patt "\" in " name
break
}
}
}
' filename