Fisrt functional version

This commit is contained in:
Eric Coissac committed 2024-11-14 19:10:23 +01:00
1 parent 9471fedfa1
commit 03f4e88a17
26 files changed
+908 -307

No files matched your search

+16 -1
View File
@@ -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
}