mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 08:10:45 +00:00
Patch a bug in obitag
This commit is contained in:
@ -8,7 +8,7 @@ import (
|
||||
// corresponds to the last commit, and not the one when the file will be
|
||||
// commited
|
||||
|
||||
var _Commit = "3424d30"
|
||||
var _Commit = "6cb7a5a"
|
||||
var _Version = "Release 4.4.0"
|
||||
|
||||
// Version returns the version of the obitools package.
|
||||
|
@ -56,8 +56,6 @@ func IndexSequence(seqidx int,
|
||||
refs[pseq.Taxon(i).Node] = &temp
|
||||
}
|
||||
|
||||
// log.Infof("%s length of path: %d", sequence.Id(), len(refs))
|
||||
|
||||
n := taxa.Len()
|
||||
lcaCache := make(map[*obitax.TaxNode]*obitax.TaxNode, n)
|
||||
|
||||
@ -89,10 +87,10 @@ func IndexSequence(seqidx int,
|
||||
var matrix []uint64
|
||||
|
||||
// obilog.Warnf("%s : %s", sequence.Id(), pseq.String())
|
||||
|
||||
for idx_path := 1; idx_path < path_len; idx_path++ {
|
||||
mini := -1
|
||||
seqidcs := refs[pseq.Taxon(idx_path).Node]
|
||||
|
||||
ns := len(*seqidcs)
|
||||
|
||||
if ns > 0 {
|
||||
@ -167,7 +165,6 @@ func IndexSequence(seqidx int,
|
||||
|
||||
obitag_index := make(map[int]string, pseq.Len())
|
||||
|
||||
// obilog.Warnf("(%s,%s): %v", sequence.Id(), pseq.Taxon(0).String(), closest)
|
||||
for i, d := range closest {
|
||||
if i < (len(closest)-1) && d < closest[i+1] {
|
||||
current_taxon := pseq.Taxon(i)
|
||||
@ -175,6 +172,10 @@ func IndexSequence(seqidx int,
|
||||
}
|
||||
}
|
||||
|
||||
if len(obitag_index) == 0 {
|
||||
obitag_index[0] = pseq.Taxon(pseq.Len() - 1).String()
|
||||
}
|
||||
|
||||
/*
|
||||
log.Println(sequence.Id(), tseq.Taxid(), tseq.ScientificName(), tseq.Rank(), obitag_index)
|
||||
log.Println(sequence.Id(), tseq.Taxid(), tseq.ScientificName(), tseq.Rank(), nseq)
|
||||
|
@ -213,6 +213,10 @@ func Identify(sequence *obiseq.BioSequence,
|
||||
taxon = match_taxon
|
||||
}
|
||||
|
||||
if taxon.IsRoot() {
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log.Debugln(sequence.Id(), "Best matches:", len(bests), "New index:", newidx)
|
||||
|
Reference in New Issue
Block a user