Skip to content

Commit

Permalink
Fix keeping taxids with a rank of "no rank" or "clade". #97
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Apr 25, 2024
1 parent abc4c3c commit 668d610
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- [TaxonKit v0.16.1](https://github.com/shenwei356/taxonkit/releases/tag/v0.16.1)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/taxonkit/v0.16.1/total.svg)](https://github.com/shenwei356/taxonkit/releases/tag/v0.16.1)
- `taxonkit filter`:
- Fix keeping taxids with a rank of "no rank" or "clade". [#97](https://github.com/shenwei356/taxonkit/issues/97)
- [TaxonKit v0.16.0](https://github.com/shenwei356/taxonkit/releases/tag/v0.16.0)
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/taxonkit/v0.16.0/total.svg)](https://github.com/shenwei356/taxonkit/releases/tag/v0.16.0)
- `taxonkit create-taxdump`:
Expand Down
5 changes: 4 additions & 1 deletion taxonkit/cmd/util-filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func (f *rankFilter) isPassed(taxid uint32) (bool, error) {
f.cache[taxid] = false
return false, nil
}
} else { // all nonrank will be outputted if !discardNorank
f.cache[taxid] = true
return true, nil
}
}

Expand Down Expand Up @@ -267,7 +270,7 @@ func (f *rankFilter) isPassed(taxid uint32) (bool, error) {
}
}

order, _ := f.rankOrder[rank]
order := f.rankOrder[rank]
// order, ok := f.rankOrder[rank]
// if !ok {
// return false, fmt.Errorf("rank order not defined in rank file: %s", rank)
Expand Down

0 comments on commit 668d610

Please sign in to comment.