Fisrt versin of the two levels indexing

Former-commit-id: 4d86483bc120e27cb6f5d2c216596d410274fc69
This commit is contained in:
Eric Coissac
2024-07-12 15:17:48 +02:00
parent 42c5881ddc
commit 4e4fac491f
9 changed files with 319 additions and 19 deletions

View File

@ -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()
}
})
}