mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
obimultiplex saves unassigned sequence
This commit is contained in:
@ -1,5 +1,11 @@
|
||||
package obitax
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
func (taxon *TaxNode) IsSubCladeOf(parent *TaxNode) bool {
|
||||
|
||||
for taxon.taxid != parent.taxid && taxon.parent != taxon.taxid {
|
||||
@ -19,3 +25,18 @@ func (taxon *TaxNode) IsBelongingSubclades(clades *TaxonSet) bool {
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsSubCladeOf(taxonomy Taxonomy, taxid int) obiseq.SequencePredicate {
|
||||
parent, err := taxonomy.Taxon(taxid)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Cannot find taxon : %d (%v)", taxid, err)
|
||||
}
|
||||
|
||||
f := func(sequence obiseq.BioSequence) bool {
|
||||
taxon, err := taxonomy.Taxon(sequence.Taxid())
|
||||
return err == nil && taxon.IsSubCladeOf(parent)
|
||||
}
|
||||
|
||||
return f
|
||||
}
|
||||
|
Reference in New Issue
Block a user