Patch excessive log in obimultiplex and an error in detecting the tag.

Former-commit-id: e6f427ac743cae373247a15bf49b0a27273b2569
This commit is contained in:
2023-03-23 11:40:24 +07:00
parent 98eac2360c
commit 57474214e7
2 changed files with 8 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import (
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiapat"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
)
@ -107,11 +108,13 @@ func (marker *Marker) Compile(forward, reverse string, maxError int, allowsIndel
func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
aseq, _ := obiapat.MakeApatSequence(sequence, false)
start, end, nerr ,matched := marker.forward.BestMatch(aseq, marker.taglength,-1)
if matched {
sseq := sequence.String()
direct := sseq[start:end]
ftag := strings.ToLower(sseq[(start - marker.taglength):start])
tagstart := goutils.MaxInt(start - marker.taglength,0)
ftag := strings.ToLower(sseq[tagstart:start])
m := DemultiplexMatch{
ForwardMatch: direct,
@ -161,13 +164,15 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
return &m
}
start, end, nerr ,matched = marker.reverse.BestMatch(aseq, marker.taglength,-1)
if matched {
sseq := sequence.String()
reverse := strings.ToLower(sseq[start:end])
rtag := strings.ToLower(sseq[(start - marker.taglength):start])
tagstart := goutils.MaxInt(start - marker.taglength,0)
rtag := strings.ToLower(sseq[tagstart:start])
m := DemultiplexMatch{
ReverseMatch: reverse,