mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Rename the Length methods Len to follow GO standart
This commit is contained in:
@ -31,7 +31,7 @@ func (batch BioSequenceBatch) Slice() obiseq.BioSequenceSlice {
|
||||
return batch.slice
|
||||
}
|
||||
|
||||
func (batch BioSequenceBatch) Length() int {
|
||||
func (batch BioSequenceBatch) Len() int {
|
||||
return len(batch.slice)
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ func (iterator IBioSequenceBatch) Push(batch BioSequenceBatch) {
|
||||
if batch.IsNil() {
|
||||
log.Panicln("A Nil batch is pushed on the channel")
|
||||
}
|
||||
if batch.Length() == 0 {
|
||||
if batch.Len() == 0 {
|
||||
log.Panicln("An empty batch is pushed on the channel")
|
||||
}
|
||||
|
||||
@ -453,7 +453,7 @@ func (iterator IBioSequenceBatch) Count(recycle bool) (int, int, int) {
|
||||
for _, seq := range batch.Slice() {
|
||||
variants++
|
||||
reads += seq.Count()
|
||||
nucleotides += seq.Length()
|
||||
nucleotides += seq.Len()
|
||||
|
||||
if recycle {
|
||||
seq.Recycle()
|
||||
|
@ -30,7 +30,7 @@ func (iterator IBioSequenceBatch) IMergeSequenceBatch(na string, statsOn []strin
|
||||
seqs := iterator.Get()
|
||||
batch.slice = append(batch.slice, seqs.slice.Merge(na, statsOn))
|
||||
}
|
||||
if batch.Length() > 0 {
|
||||
if batch.Len() > 0 {
|
||||
newIter.Push(batch)
|
||||
}
|
||||
}
|
||||
@ -40,11 +40,10 @@ func (iterator IBioSequenceBatch) IMergeSequenceBatch(na string, statsOn []strin
|
||||
return newIter
|
||||
}
|
||||
|
||||
|
||||
func MergePipe(na string, statsOn []string, sizes ...int) Pipeable {
|
||||
f := func(iterator IBioSequenceBatch) IBioSequenceBatch {
|
||||
return iterator.IMergeSequenceBatch(na,statsOn,sizes...)
|
||||
return iterator.IMergeSequenceBatch(na, statsOn, sizes...)
|
||||
}
|
||||
|
||||
return f
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
package obiiter
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"sync"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
|
||||
@ -41,8 +42,7 @@ func (batch PairedBioSequenceBatch) Reorder(newOrder int) PairedBioSequenceBatch
|
||||
return batch
|
||||
}
|
||||
|
||||
|
||||
func (batch PairedBioSequenceBatch) Length() int {
|
||||
func (batch PairedBioSequenceBatch) Len() int {
|
||||
return len(batch.forward)
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ func (iterator IBioSequenceBatch) Speed(message ...string) IBioSequenceBatch {
|
||||
|
||||
for iterator.Next() {
|
||||
batch := iterator.Get()
|
||||
l := batch.Length()
|
||||
l := batch.Len()
|
||||
newIter.Push(batch)
|
||||
bar.Add(l)
|
||||
}
|
||||
|
Reference in New Issue
Block a user