mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Xprize update
Former-commit-id: d38919a897961e4d40da3b844057c3fb94fdb6d7
This commit is contained in:
@ -57,6 +57,23 @@ func (taxonomy *Taxonomy) IsSubCladeOf(taxid int) obiseq.SequencePredicate {
|
||||
return f
|
||||
}
|
||||
|
||||
func (taxonomy *Taxonomy) IsSubCladeOfSlot(key string) obiseq.SequencePredicate {
|
||||
|
||||
f := func(sequence *obiseq.BioSequence) bool {
|
||||
val, ok := sequence.GetStringAttribute(key)
|
||||
|
||||
if ok {
|
||||
parent, err1 := taxonomy.Taxon(val)
|
||||
taxon, err2 := taxonomy.Taxon(sequence.Taxid())
|
||||
return err1 == nil && err2 == nil && taxon.IsSubCladeOf(parent)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
return f
|
||||
}
|
||||
|
||||
func (taxonomy *Taxonomy) HasRequiredRank(rank string) obiseq.SequencePredicate {
|
||||
|
||||
if !obiutils.Contains(taxonomy.RankList(), rank) {
|
||||
|
Reference in New Issue
Block a user