mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
obitag bug
Former-commit-id: e6f8750d8db74c0b175c4a93d5b58bd84f293d52
This commit is contained in:
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## Latest changes
|
## Latest changes
|
||||||
|
|
||||||
|
### Bug
|
||||||
|
|
||||||
|
- In `obitag`, correct the wrong assignation of the **obitag_bestmatch** attribute.
|
||||||
|
|
||||||
## April 2nd, 2024. Release 4.2.0
|
## April 2nd, 2024. Release 4.2.0
|
||||||
|
|
||||||
### New feature
|
### New feature
|
||||||
|
@ -120,33 +120,37 @@ func FindClosests(sequence *obiseq.BioSequence,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
if lcs >= 0 {
|
||||||
// We have found a better candidate than never
|
//
|
||||||
//
|
// We have found a better candidate than never
|
||||||
if maxe == -1 || score < maxe {
|
//
|
||||||
bests = bests[:0] // Empty the best lists
|
if maxe == -1 || score < maxe {
|
||||||
bestidxs = bestidxs[:0] //
|
bests = bests[:0] // Empty the best lists
|
||||||
|
bestidxs = bestidxs[:0] //
|
||||||
|
|
||||||
maxe = score // Memorize the best scores
|
maxe = score // Memorize the best scores
|
||||||
wordmin = max(0, max(sequence.Len(), ref.Len())-3-4*maxe)
|
wordmin = max(0, max(sequence.Len(), ref.Len())-3-4*maxe)
|
||||||
bestId = float64(lcs) / float64(alilength)
|
bestId = float64(lcs) / float64(alilength)
|
||||||
// log.Warnln(sequence.Id(), ref.Id(), cw[order], maxe, bestId, wordmin)
|
|
||||||
}
|
|
||||||
|
|
||||||
if score == maxe {
|
|
||||||
bests = append(bests, ref)
|
|
||||||
bestidxs = append(bestidxs, order)
|
|
||||||
id := float64(lcs) / float64(alilength)
|
|
||||||
if id > bestId {
|
|
||||||
bestId = id
|
|
||||||
bestmatch = ref.Id()
|
bestmatch = ref.Id()
|
||||||
|
// log.Warnln(sequence.Id(), ref.Id(), cw[order], maxe, bestId, wordmin)
|
||||||
}
|
}
|
||||||
// log.Println(ref.Id(), maxe, bestId,bestidxs)
|
|
||||||
|
if score == maxe {
|
||||||
|
bests = append(bests, ref)
|
||||||
|
bestidxs = append(bestidxs, order)
|
||||||
|
id := float64(lcs) / float64(alilength)
|
||||||
|
if id > bestId {
|
||||||
|
bestId = id
|
||||||
|
bestmatch = ref.Id()
|
||||||
|
}
|
||||||
|
// log.Println(ref.Id(), maxe, bestId,bestidxs)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// log.Debugln("Closest Match", sequence.Id(), maxe, bestId, bestidxs, len(bests))
|
log.Debugln("Closest Match", sequence.Id(), maxe, bestId, references[bestidxs[0]].Id(), bestidxs, len(bests))
|
||||||
return bests, maxe, bestId, bestmatch, bestidxs
|
return bests, maxe, bestId, bestmatch, bestidxs
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,6 +172,7 @@ func Identify(sequence *obiseq.BioSequence,
|
|||||||
taxa obitax.TaxonSet,
|
taxa obitax.TaxonSet,
|
||||||
taxo *obitax.Taxonomy,
|
taxo *obitax.Taxonomy,
|
||||||
runExact bool) *obiseq.BioSequence {
|
runExact bool) *obiseq.BioSequence {
|
||||||
|
|
||||||
bests, differences, identity, bestmatch, seqidxs := FindClosests(sequence, references, refcounts, runExact)
|
bests, differences, identity, bestmatch, seqidxs := FindClosests(sequence, references, refcounts, runExact)
|
||||||
taxon := (*obitax.TaxNode)(nil)
|
taxon := (*obitax.TaxNode)(nil)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user