work on obiclean chimera detection

This commit is contained in:
Eric Coissac
2025-10-20 16:35:19 +02:00
parent 29bf4ce871
commit d17a9520b9
6 changed files with 160 additions and 92 deletions

View File

@@ -1,6 +1,9 @@
package obialign
import log "github.com/sirupsen/logrus"
import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
log "github.com/sirupsen/logrus"
)
// buffIndex converts a pair of coordinates (i, j) into a linear index in a matrix
// of size width x width. The coordinates are (-1)-indexed, and the linear index
@@ -69,7 +72,7 @@ func LocatePattern(id string, pattern, sequence []byte) (int, int, int) {
// Mismatch score = -1
// Match score = 0
match := -1
if _samenuc(pattern[j], sequence[i]) {
if obiseq.SameIUPACNuc(pattern[j], sequence[i]) {
match = 0
}
@@ -103,7 +106,7 @@ func LocatePattern(id string, pattern, sequence []byte) (int, int, int) {
// Mismatch score = -1
// Match score = 0
match := -1
if _samenuc(pattern[jmax], sequence[i]) {
if obiseq.SameIUPACNuc(pattern[jmax], sequence[i]) {
match = 0
}