Finalyse the obimultiplex with indels

Former-commit-id: cef0ac39dac0e02d16d4bd321966a0f8a67f2c85
This commit is contained in:
2023-03-21 22:01:02 +07:00
parent 27d6c60e25
commit d09011fac2
3 changed files with 10 additions and 2 deletions

View File

@ -49,6 +49,10 @@ func FastLCSEGFScoreByte(bA, bB []byte, maxError int, endgapfree bool, buffer *[
delta := lA - lB
if endgapfree {
maxError += delta
}
// The difference of length is larger the maximum allowed errors
if delta > maxError {
return -1, -1
@ -170,6 +174,9 @@ func FastLCSEGFScoreByte(bA, bB []byte, maxError int, endgapfree bool, buffer *[
// score = _setout(score)
// }
if x == 0 || x == (even-1) {
score = _setout(score)
}
// // BEGINNING OF DEBUG CODE //
// if i < 2 && j < 5 {
// log.Debugf("[%d,%d]\n",i,j)

View File

@ -370,10 +370,11 @@ func (pattern ApatPattern) BestMatch(sequence ApatSequence, begin, length int) (
score, lali := obialign.FastLCSEGFScoreByte(
(*cseq)[start:end],
(*cpattern)[0:int(pattern.pointer.pointer.patlen)],
nerr*2, true, &buffer)
nerr, true, &buffer)
nerr = lali - score
start = best[0] + int(pattern.pointer.pointer.patlen) - lali
end = start + lali
log.Println("results", score, lali, start, nerr)
return
}

View File

@ -199,7 +199,7 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
m.ForwardMatch = direct.String()
m.ForwardTag = sftag
m.ReverseMismatches = nerr
m.ForwardMismatches = nerr
m.BarcodeEnd = start
sample, ok := marker.samples[TagPair{sftag, rtag}]