From ad4a8612619ba925a8683872628d266e419d0faa Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sun, 21 Aug 2022 14:47:22 +0200 Subject: [PATCH] Change some comments --- pkg/obichunk/unique.go | 6 +++++- pkg/obitools/obiuniq/unique.go | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/obichunk/unique.go b/pkg/obichunk/unique.go index ddfddb6..38f2db5 100644 --- a/pkg/obichunk/unique.go +++ b/pkg/obichunk/unique.go @@ -10,7 +10,7 @@ import ( ) // Runs dereplication algorithm on a obiiter.IBioSequenceBatch -// iterator. +// iterator. func IUniqueSequence(iterator obiiter.IBioSequenceBatch, options ...WithOption) (obiiter.IBioSequenceBatch, error) { @@ -86,6 +86,7 @@ func IUniqueSequence(iterator obiiter.IBioSequenceBatch, next = obiiter.MakeIBioSequenceBatch(opts.BufferSize()) iUnique.Add(1) + go ff(next, obiseq.AnnotationClassifier(cat[icat], na), icat) @@ -96,13 +97,16 @@ func IUniqueSequence(iterator obiiter.IBioSequenceBatch, batch := input.Get() if icat < 0 || len(batch.Slice()) == 1 { + // No more sub classification of sequence or only a single sequence if opts.NoSingleton() && len(batch.Slice()) == 1 && batch.Slice()[0].Count() == 1 { + // We remove singleton from output batch.Slice()[0].Recycle() batch.Recycle() } else { iUnique.Push(batch.Reorder(nextOrder())) } } else { + // A new step of classification must du realized next.Push(batch.Reorder(o)) o++ } diff --git a/pkg/obitools/obiuniq/unique.go b/pkg/obitools/obiuniq/unique.go index 356d9b7..fde5aa1 100644 --- a/pkg/obitools/obiuniq/unique.go +++ b/pkg/obitools/obiuniq/unique.go @@ -30,7 +30,7 @@ func Unique(sequences obiiter.IBioSequenceBatch) obiiter.IBioSequenceBatch { } // - // Considers if sequences observed a singletime in the dataset have to + // Considers if sequences observed a single time in the dataset have to // be conserved in the output // // --no-singleton