Changes to be committed:

modified:   pkg/obioptions/version.go
	modified:   pkg/obitools/obiclean/chimera.go
This commit is contained in:
Eric Coissac
2025-02-24 15:25:45 +01:00
parent db284f1d44
commit 13d610aff7
2 changed files with 8 additions and 11 deletions

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 = "51b3e83" var _Commit = "db284f1"
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

@ -35,15 +35,17 @@ func commonSuffix(a, b *obiseq.BioSequence) int {
j := b.Len() - 1 j := b.Len() - 1
if i < 0 || j < 0 { if i < 0 || j < 0 {
return -1 return 0
} }
as := a.Sequence() as := a.Sequence()
bs := b.Sequence() bs := b.Sequence()
l := 0
for i >= 0 && j >= 0 && as[i] == bs[j] { for i >= 0 && j >= 0 && as[i] == bs[j] {
i-- i--
j-- j--
l++
} }
if obiutils.UnsafeString(as[i+1:]) != obiutils.UnsafeString(bs[j+1:]) { if obiutils.UnsafeString(as[i+1:]) != obiutils.UnsafeString(bs[j+1:]) {
@ -51,7 +53,7 @@ func commonSuffix(a, b *obiseq.BioSequence) int {
} }
// log.Warnf("i: %d, j: %d (%s)", i, j, as[i+1:]) // log.Warnf("i: %d, j: %d (%s)", i, j, as[i+1:])
return i + 1 return l
} }
func AnnotateChimera(samples map[string]*[]*seqPCR) { func AnnotateChimera(samples map[string]*[]*seqPCR) {
@ -97,16 +99,11 @@ func AnnotateChimera(samples map[string]*[]*seqPCR) {
} }
} }
ls := s.Sequence.Len()
for k := i + 1; k < lp; k++ { for k := i + 1; k < lp; k++ {
for l := i + 1; l < lp; l++ { for l := i + 1; l < lp; l++ {
if k != l && if k != l && cp[k]+cs[l] == ls {
cs[k] >= 0 &&
obiutils.Abs(cp[k]-cs[l]) == 0 &&
obiutils.UnsafeString(pcrs[k].Sequence.Sequence()[:cp[k]]) !=
obiutils.UnsafeString(pcrs[l].Sequence.Sequence()[:cp[k]]) &&
obiutils.UnsafeString(pcrs[k].Sequence.Sequence()[cp[k]:]) !=
obiutils.UnsafeString(pcrs[l].Sequence.Sequence()[cp[k]:]) {
cm[sample] = fmt.Sprintf("{%s}/{%s}@(%d)", cm[sample] = fmt.Sprintf("{%s}/{%s}@(%d)",
pcrs[k].Sequence.Id(), pcrs[k].Sequence.Id(),
pcrs[l].Sequence.Id(), pcrs[l].Sequence.Id(),