Skip to content

Commit

Permalink
fix taxids of abbreviated lineage containing names shared by differen…
Browse files Browse the repository at this point in the history
…t taxids. fix #35
  • Loading branch information
shenwei356 committed Oct 31, 2020
1 parent 6f91fdf commit 2e42ad3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- [TaxonKit v0.6.2](https://github.com/shenwei356/taxonkit/releases/tag/v0.6.2)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/taxonkit/v0.6.2/total.svg)](https://github.com/shenwei356/taxonkit/releases/tag/v0.6.1)
- `taxonkit reformat -F`: fix taxids of abbreviated lineage containing names shared by different taxids. [#35](https://github.com/shenwei356/taxonkit/issues/35)
- [TaxonKit v0.6.1](https://github.com/shenwei356/taxonkit/releases/tag/v0.6.1)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/taxonkit/v0.6.1/total.svg)](https://github.com/shenwei356/taxonkit/releases/tag/v0.6.1)
- `taxonkit lineage`:
Expand Down
2 changes: 1 addition & 1 deletion taxonkit/cmd/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
)

// VERSION of taxonkit
const VERSION = "0.6.1"
const VERSION = "0.6.2"

// Config is the struct containing all global flags
type Config struct {
Expand Down
6 changes: 5 additions & 1 deletion taxonkit/cmd/reformat.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ column by flag "-t/--show-lineage-taxids".
ranks[i] = rank
if srank, ok = rank2symbol[rank]; ok {
replacements[srank] = name2Name[name]
ireplacements[srank] = fmt.Sprintf("%d", name2taxid[name])
if i == 0 {
ireplacements[srank] = fmt.Sprintf("%d", name2taxid[name])
} else {
ireplacements[srank] = fmt.Sprintf("%d", name2parent2taxid[name][plname])
}
srank2idx[srank] = i
sranks[i] = srank
}
Expand Down

0 comments on commit 2e42ad3

Please sign in to comment.