Changes to be committed:

modified:   pkg/obialign/alignment.go
	modified:   pkg/obialign/pairedendalign.go
	modified:   pkg/obioptions/version.go
	modified:   pkg/obitools/obipairing/pairing.go
This commit is contained in:
Eric Coissac
2025-02-23 17:37:56 +01:00
parent fb6f857d8c
commit 51d11aa36d
4 changed files with 19 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import (
"strings" "strings"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
) )
// // A pool of byte slices. // // A pool of byte slices.
@ -158,19 +159,29 @@ func BuildQualityConsensus(seqA, seqB *obiseq.BioSequence, path []int, statOnMis
match := 0 match := 0
left := obiutils.Abs(path[0])
right := 0
if path[len(path)-1] == 0 {
right = path[len(path)-2]
}
right = obiutils.Abs(right)
right = len(*bufferQA) - right
// log.Warnf("BuildQualityConsensus: left = %d right = %d\n", left, right)
for i, qA = range *bufferQA { for i, qA = range *bufferQA {
nA := (*bufferSA)[i] nA := (*bufferSA)[i]
nB := (*bufferSB)[i] nB := (*bufferSB)[i]
qB = (*bufferQB)[i] qB = (*bufferQB)[i]
if statOnMismatch && nA != nB { if statOnMismatch && i >= left && i < right && nA != nB {
if nA == ' ' { if nA == ' ' {
nA = '-' nA = '-'
qA = 0
} }
if nB == ' ' { if nB == ' ' {
nB = '-' nB = '-'
qB = 0
} }
mismatches[strings.ToUpper(fmt.Sprintf("(%c:%02d)->(%c:%02d)", nA, qA, nB, qB))] = i + 1 mismatches[strings.ToUpper(fmt.Sprintf("(%c:%02d)->(%c:%02d)", nA, qA, nB, qB))] = i + 1
} }

View File

@ -625,6 +625,8 @@ func PEAlign(seqA, seqB *obiseq.BioSequence,
&arena.pointer.scoreMatrix, &arena.pointer.scoreMatrix,
&arena.pointer.pathMatrix) &arena.pointer.pathMatrix)
score = scoreR
path = _Backtracking(arena.pointer.pathMatrix, path = _Backtracking(arena.pointer.pathMatrix,
len(rawSeqA), len(rawSeqB), len(rawSeqA), len(rawSeqB),
&(arena.pointer.path)) &(arena.pointer.path))
@ -641,6 +643,7 @@ func PEAlign(seqA, seqB *obiseq.BioSequence,
len(rawSeqA), len(rawSeqB), len(rawSeqA), len(rawSeqB),
&(arena.pointer.path)) &(arena.pointer.path))
isLeftAlign = true isLeftAlign = true
score = scoreL
} }
} }

View File

@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be // corresponds to the last commit, and not the one when the file will be
// commited // commited
var _Commit = "d4209b4" var _Commit = "fb6f857"
var _Version = "Release 4.2.0" var _Version = "Release 4.2.0"
// Version returns the version of the obitools package. // Version returns the version of the obitools package.

View File

@ -129,6 +129,7 @@ func AssemblePESequences(seqA, seqB *obiseq.BioSequence,
} }
lcons := cons.Len() lcons := cons.Len()
aliLength := lcons - _Abs(left) - _Abs(right) aliLength := lcons - _Abs(left) - _Abs(right)
identity := float64(match) / float64(aliLength) identity := float64(match) / float64(aliLength)
if aliLength == 0 { if aliLength == 0 {
identity = 0 identity = 0