mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
23 lines
356 B
Go
23 lines
356 B
Go
package obitax
|
|
|
|
import "log"
|
|
|
|
func (taxon *Taxon) IsSubCladeOf(parent *Taxon) bool {
|
|
|
|
if taxon.Taxonomy != parent.Taxonomy {
|
|
log.Fatalf(
|
|
"Both taxa %s and %s must belong to the same taxonomy",
|
|
taxon.String(),
|
|
parent.String(),
|
|
)
|
|
}
|
|
|
|
for t := range taxon.IPath() {
|
|
if t.Node.Id() == parent.Node.Id() {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|