Skip to content

Commit

Permalink
create-taxdump: fix circular definition in merged.dmp. shenwei356/gtd…
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Aug 25, 2022
1 parent a73772d commit cc261ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/taxonkit/v0.12.1/total.svg)](https://github.com/shenwei356/taxonkit/releases/tag/v0.12.1)
- `taxonkit reformat`: add a new placeholder `{K}` for rank `kingdom`. [#64](https://github.com/shenwei356/taxonkit/issues/64)
- `taxonkit create-taxdump`:
- fix merged.dmp and delnodes.dmp. [gtdb-taxdump/issues/2](https://github.com/shenwei356/gtdb-taxdump/issues/2)
- fix merged.dmp and delnodes.dmp. Thanks to @apcamargo ! [gtdb-taxdump/issues/2](https://github.com/shenwei356/gtdb-taxdump/issues/2).
- fix bug of handling non-GTDB data when using `-A/--field-accession` and no rank names given.
- `taxonkit reformat`: do not panic for invalid TaxIds, e.g., the column name, when using `-I--taxid-field`.
- [TaxonKit v0.12.0](https://github.com/shenwei356/taxonkit/releases/tag/v0.12.0)
Expand Down
7 changes: 7 additions & 0 deletions taxonkit/cmd/create-taxdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,13 @@ Attentions:

// append old merged.dmp
for from, to := range taxdb.MergeNodes {
// https://github.com/shenwei356/gtdb-taxdump/issues/2#issuecomment-1226186877
// The history of GCF_001405015.1 showed Clostridium disporicum was renamed to
// Clostridium disporicum_A in R95, and changed back in R207.
if _, ok = merged[to]; ok && merged[to] == from {
// delnodes[to] = struct{}{}
continue
}
if _, ok = delnodes[to]; ok { // could not append deleted nodes
delnodes[from] = struct{}{} // if the new taxid has been deleted, mark the old taxid too
continue
Expand Down

0 comments on commit cc261ad

Please sign in to comment.