mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Fisrt versin of the two levels indexing
Former-commit-id: 4d86483bc120e27cb6f5d2c216596d410274fc69
This commit is contained in:
@ -195,3 +195,23 @@ func (s BioSequenceSlice) AttributeKeys(skip_map bool) obiutils.Set[string] {
|
||||
|
||||
return keys
|
||||
}
|
||||
|
||||
func (s *BioSequenceSlice) SortOnCount(reverse bool) {
|
||||
slices.SortFunc(*s, func(a, b *BioSequence) int {
|
||||
if reverse {
|
||||
return b.Count() - a.Count()
|
||||
} else {
|
||||
return a.Count() - b.Count()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (s *BioSequenceSlice) SortOnLength(reverse bool) {
|
||||
slices.SortFunc(*s, func(a, b *BioSequence) int {
|
||||
if reverse {
|
||||
return b.Len() - a.Len()
|
||||
} else {
|
||||
return a.Len() - b.Len()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user