mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Fisrt functional version
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
package obitax
|
||||
|
||||
import "log"
|
||||
import log "github.com/sirupsen/logrus"
|
||||
|
||||
func (taxon *Taxon) IsSubCladeOf(parent *Taxon) bool {
|
||||
|
||||
@ -20,3 +20,18 @@ func (taxon *Taxon) IsSubCladeOf(parent *Taxon) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (taxon *Taxon) IsBelongingSubclades(clades *TaxonSet) bool {
|
||||
ok := clades.Contains(taxon.Node.id)
|
||||
|
||||
for !ok && !taxon.IsRoot() {
|
||||
taxon = taxon.Parent()
|
||||
ok = clades.Contains(taxon.Node.id)
|
||||
}
|
||||
|
||||
if taxon.IsRoot() {
|
||||
ok = clades.Contains(taxon.Node.id)
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
Reference in New Issue
Block a user