mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Patch e bug in the ngsfilter library when match with indel are at the extremities
Former-commit-id: 5a8a3100ac4b3eca104644597abe599eb7f2a5f4
This commit is contained in:
@ -118,7 +118,16 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
|
|||||||
aseq, _ := obiapat.MakeApatSequence(sequence, false)
|
aseq, _ := obiapat.MakeApatSequence(sequence, false)
|
||||||
|
|
||||||
start, end, nerr, matched := marker.forward.BestMatch(aseq, marker.taglength, -1)
|
start, end, nerr, matched := marker.forward.BestMatch(aseq, marker.taglength, -1)
|
||||||
|
|
||||||
if matched {
|
if matched {
|
||||||
|
if start < 0 {
|
||||||
|
start = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if end > sequence.Len() {
|
||||||
|
end = sequence.Len()
|
||||||
|
}
|
||||||
|
|
||||||
sseq := sequence.String()
|
sseq := sequence.String()
|
||||||
direct := sseq[start:end]
|
direct := sseq[start:end]
|
||||||
tagstart := obiutils.MaxInt(start-marker.taglength, 0)
|
tagstart := obiutils.MaxInt(start-marker.taglength, 0)
|
||||||
@ -176,6 +185,14 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
|
|||||||
start, end, nerr, matched = marker.reverse.BestMatch(aseq, marker.taglength, -1)
|
start, end, nerr, matched = marker.reverse.BestMatch(aseq, marker.taglength, -1)
|
||||||
|
|
||||||
if matched {
|
if matched {
|
||||||
|
if start < 0 {
|
||||||
|
start = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if end > sequence.Len() {
|
||||||
|
end = sequence.Len()
|
||||||
|
}
|
||||||
|
|
||||||
sseq := sequence.String()
|
sseq := sequence.String()
|
||||||
|
|
||||||
reverse := strings.ToLower(sseq[start:end])
|
reverse := strings.ToLower(sseq[start:end])
|
||||||
|
Reference in New Issue
Block a user