mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 00:30:27 +00:00
Rename ISequenceChunk
This commit is contained in:
@@ -9,7 +9,20 @@ import (
|
|||||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ISequenceChunk(iterator obiiter.IBioSequence,
|
// ISequenceChunkMemory processes a sequence iterator by distributing the sequences
|
||||||
|
// into chunks in memory. It uses a classifier to determine how to distribute
|
||||||
|
// the sequences and returns a new iterator for the processed sequences.
|
||||||
|
//
|
||||||
|
// Parameters:
|
||||||
|
// - iterator: An iterator of biosequences to be processed.
|
||||||
|
// - classifier: A pointer to a BioSequenceClassifier used to classify the sequences
|
||||||
|
// during distribution.
|
||||||
|
//
|
||||||
|
// Returns:
|
||||||
|
// An iterator of biosequences representing the processed chunks.
|
||||||
|
//
|
||||||
|
// The function operates asynchronously.
|
||||||
|
func ISequenceChunkMemory(iterator obiiter.IBioSequence,
|
||||||
classifier *obiseq.BioSequenceClassifier) (obiiter.IBioSequence, error) {
|
classifier *obiseq.BioSequenceClassifier) (obiiter.IBioSequence, error) {
|
||||||
|
|
||||||
newIter := obiiter.MakeIBioSequence()
|
newIter := obiiter.MakeIBioSequence()
|
||||||
@@ -35,7 +35,7 @@ func IUniqueSequence(iterator obiiter.IBioSequence,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
iterator, err = ISequenceChunk(iterator,
|
iterator, err = ISequenceChunkMemory(iterator,
|
||||||
obiseq.HashClassifier(opts.BatchCount()))
|
obiseq.HashClassifier(opts.BatchCount()))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ func IndexFamilyDB(iterator obiiter.IBioSequence) obiiter.IBioSequence {
|
|||||||
obidefault.ParallelWorkers(),
|
obidefault.ParallelWorkers(),
|
||||||
)
|
)
|
||||||
|
|
||||||
family_iterator, err := obichunk.ISequenceChunk(
|
family_iterator, err := obichunk.ISequenceChunkMemory(
|
||||||
partof,
|
partof,
|
||||||
obiseq.AnnotationClassifier("family_taxid", "NA"),
|
obiseq.AnnotationClassifier("family_taxid", "NA"),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user