Patch a bug in registering merged taxa

This commit is contained in:
Eric Coissac
2025-02-10 11:42:46 +01:00
parent f2e81adf95
commit e2563cd8df
3 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "773e549"
var _Commit = "f2e81ad"
var _Version = "Release 4.2.0"
// Version returns the version of the obitools package.

View File

@ -131,7 +131,7 @@ func loadMergedTable(reader io.Reader, taxonomy *Taxonomy) int {
oldtaxid := strings.TrimSpace(record[0])
newtaxid := strings.TrimSpace(record[1])
taxonomy.AddAlias(newtaxid, oldtaxid, false)
taxonomy.AddAlias(oldtaxid, newtaxid, false)
}
return n

View File

@ -151,7 +151,8 @@ func (set *TaxonSet) Alias(id *string, taxon *Taxon) {
if original == nil {
log.Fatalf("Original taxon %v is not part of taxon set", id)
}
set.set[id] = taxon.Node
set.set[id] = original.Node
set.nalias++
}