complete the correction related to the tag detection

Former-commit-id: 98326fb0f27788de672cdbd686b32b4dc2615038
This commit is contained in:
2023-03-23 11:52:08 +07:00
parent 57474214e7
commit 42aae88520

View File

@ -133,7 +133,8 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
reverse, _ := sequence.Subsequence(start,end, false)
defer reverse.Recycle()
reverse = reverse.ReverseComplement(true)
rtag, err := sequence.Subsequence(end, end+marker.taglength, false)
endtag := goutils.MinInt(end+marker.taglength,sequence.Len())
rtag, err := sequence.Subsequence(end, endtag, false)
defer rtag.Recycle()
srtag := ""
@ -191,7 +192,8 @@ func (marker *Marker) Match(sequence *obiseq.BioSequence) *DemultiplexMatch {
defer direct.Recycle()
direct = direct.ReverseComplement(true)
ftag, err := sequence.Subsequence(end,end+marker.taglength, false)
endtag := goutils.MinInt(end+marker.taglength,sequence.Len())
ftag, err := sequence.Subsequence(end,endtag, false)
defer ftag.Recycle()
sftag := ""
if err != nil {