Patch a bug leading to loose taxonomical identification (set to root) when best_id = 1

Former-commit-id: 8eb4f95d4df774563f5a5fe17d2c9c8836361caa
This commit is contained in:
2023-11-30 13:07:51 +01:00
parent 8d77cc4133
commit 82040dbe55

View File

@ -146,7 +146,7 @@ func FindClosests(sequence *obiseq.BioSequence,
}
log.Debugln("Closest Match", sequence.Id(), maxe, bestId, bestidxs, len(bests))
// log.Debugln("Closest Match", sequence.Id(), maxe, bestId, bestidxs, len(bests))
return bests, maxe, bestId, bestmatch, bestidxs
}
@ -171,7 +171,7 @@ func Identify(sequence *obiseq.BioSequence,
bests, differences, identity, bestmatch, seqidxs := FindClosests(sequence, references, refcounts, runExact)
taxon := (*obitax.TaxNode)(nil)
if identity >= 0.5 && differences > 0 {
if identity >= 0.5 && differences >= 0 {
newidx := 0
for i, best := range bests {
idx := best.OBITagRefIndex()