mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Changes to be committed:
modified: pkg/obioptions/version.go modified: pkg/obitools/obiclean/chimera.go
This commit is contained in:
@ -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.
|
||||||
|
@ -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(),
|
||||||
|
Reference in New Issue
Block a user