mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Change some comments
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Runs dereplication algorithm on a obiiter.IBioSequenceBatch
|
// Runs dereplication algorithm on a obiiter.IBioSequenceBatch
|
||||||
// iterator.
|
// iterator.
|
||||||
|
|
||||||
func IUniqueSequence(iterator obiiter.IBioSequenceBatch,
|
func IUniqueSequence(iterator obiiter.IBioSequenceBatch,
|
||||||
options ...WithOption) (obiiter.IBioSequenceBatch, error) {
|
options ...WithOption) (obiiter.IBioSequenceBatch, error) {
|
||||||
@ -86,6 +86,7 @@ func IUniqueSequence(iterator obiiter.IBioSequenceBatch,
|
|||||||
next = obiiter.MakeIBioSequenceBatch(opts.BufferSize())
|
next = obiiter.MakeIBioSequenceBatch(opts.BufferSize())
|
||||||
|
|
||||||
iUnique.Add(1)
|
iUnique.Add(1)
|
||||||
|
|
||||||
go ff(next,
|
go ff(next,
|
||||||
obiseq.AnnotationClassifier(cat[icat], na),
|
obiseq.AnnotationClassifier(cat[icat], na),
|
||||||
icat)
|
icat)
|
||||||
@ -96,13 +97,16 @@ func IUniqueSequence(iterator obiiter.IBioSequenceBatch,
|
|||||||
batch := input.Get()
|
batch := input.Get()
|
||||||
|
|
||||||
if icat < 0 || len(batch.Slice()) == 1 {
|
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 {
|
if opts.NoSingleton() && len(batch.Slice()) == 1 && batch.Slice()[0].Count() == 1 {
|
||||||
|
// We remove singleton from output
|
||||||
batch.Slice()[0].Recycle()
|
batch.Slice()[0].Recycle()
|
||||||
batch.Recycle()
|
batch.Recycle()
|
||||||
} else {
|
} else {
|
||||||
iUnique.Push(batch.Reorder(nextOrder()))
|
iUnique.Push(batch.Reorder(nextOrder()))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// A new step of classification must du realized
|
||||||
next.Push(batch.Reorder(o))
|
next.Push(batch.Reorder(o))
|
||||||
o++
|
o++
|
||||||
}
|
}
|
||||||
|
@ -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
|
// be conserved in the output
|
||||||
//
|
//
|
||||||
// --no-singleton
|
// --no-singleton
|
||||||
|
Reference in New Issue
Block a user