mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Refactoring of some code
This commit is contained in:
@ -2,8 +2,6 @@ package obitax
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
type TaxNode struct {
|
||||
@ -72,17 +70,6 @@ func (node *TaxNode) HasRankDefined(rank string) bool {
|
||||
for node.rank != rank && node.parent != node.taxid {
|
||||
node = node.pparent
|
||||
}
|
||||
|
||||
return node.rank == rank
|
||||
|
||||
}
|
||||
|
||||
func HasRankDefined(taxonomy Taxonomy, rank string) obiseq.SequencePredicate {
|
||||
|
||||
f := func(sequence *obiseq.BioSequence) bool {
|
||||
taxon, err := taxonomy.Taxon(sequence.Taxid())
|
||||
return err == nil && taxon.HasRankDefined(rank)
|
||||
}
|
||||
|
||||
return f
|
||||
}
|
||||
|
Reference in New Issue
Block a user