Refactor taxonomy handling and improve performance

This update introduces logic for handling embedded taxonomy, allowing users to specify taxonomy or extract it from sequences, while optimizing performance through reduced memory usage. It also adds batch reordering capabilities and implements comprehensive testing to ensure correct precedence rules and robust error handling for missing taxonomic paths.
This commit is contained in:
Eric Coissac committed 2026-11-03 22:44:44 +11:00
1 parent 57c2517b24
commit 574221df42
6 files changed
+284 -19

No files matched your search

+5 -3
View File
@@ -465,7 +465,9 @@ func (iterator IBioSequence) RebatchBySize(maxBytes int, maxCount int) IBioSeque
go func() {
order := 0
iterator = iterator.SortBatches()
// a local variable: reassigning the captured iterator would race with
// the IsPaired call below, made by the caller on the same variable
sorted := iterator.SortBatches()
buffer := obiseq.MakeBioSequenceSlice()
bufBytes := 0
source := ""
@@ -479,8 +481,8 @@ func (iterator IBioSequence) RebatchBySize(maxBytes int, maxCount int) IBioSeque
}
}
for iterator.Next() {
seqs := iterator.Get()
for sorted.Next() {
seqs := sorted.Get()
source = seqs.Source()
for _, s := range seqs.Slice() {
sz := s.MemorySize()