mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 08:40:26 +00:00
First commit
This commit is contained in:
21
pkg/obitax/issuubcladeof.go
Normal file
21
pkg/obitax/issuubcladeof.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package obitax
|
||||
|
||||
func (taxon *TaxNode) IsSubCladeOf(parent *TaxNode) bool {
|
||||
|
||||
for taxon.taxid != parent.taxid && taxon.parent != taxon.taxid {
|
||||
taxon = taxon.pparent
|
||||
}
|
||||
|
||||
return taxon.taxid == parent.taxid
|
||||
}
|
||||
|
||||
func (taxon *TaxNode) IsBelongingSubclades(clades *TaxonSet) bool {
|
||||
_, ok := (*clades)[taxon.taxid]
|
||||
|
||||
for !ok && taxon.parent != taxon.taxid {
|
||||
taxon = taxon.pparent
|
||||
_, ok = (*clades)[taxon.taxid]
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
Reference in New Issue
Block a user