rename goutils to obiutils

Former-commit-id: 2147f53db972bba571dfdae30c51b62d3e69cec5
This commit is contained in:
2023-03-24 10:25:12 +07:00
parent 42aae88520
commit d5e84ec676
33 changed files with 245 additions and 156 deletions

View File

@@ -3,8 +3,8 @@ package obiformats
import (
"log"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiutils"
)
func ReadSequencesBatchFromFiles(filenames []string,
@@ -17,7 +17,7 @@ func ReadSequencesBatchFromFiles(filenames []string,
}
batchiter := obiiter.MakeIBioSequence(0)
nextCounter := goutils.AtomicCounter()
nextCounter := obiutils.AtomicCounter()
batchiter.Add(concurrent_readers)

View File

@@ -9,9 +9,9 @@ import (
"sync"
"time"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiutils"
log "github.com/sirupsen/logrus"
)
@@ -52,7 +52,7 @@ func CSVRecord(sequence *obiseq.BioSequence, opt Options) []string {
value = opt.CSVNAValue()
}
svalue, _ := goutils.InterfaceToString(value)
svalue, _ := obiutils.InterfaceToString(value)
record = append(record, svalue)
}
@@ -132,7 +132,7 @@ func WriteCSV(iterator obiiter.IBioSequence,
options ...WithOption) (obiiter.IBioSequence, error) {
opt := MakeOptions(options)
file, _ = goutils.CompressStream(file, opt.CompressedFile(), opt.CloseFile())
file, _ = obiutils.CompressStream(file, opt.CompressedFile(), opt.CloseFile())
newIter := obiiter.MakeIBioSequence()

View File

@@ -6,8 +6,8 @@ import (
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiutils"
"github.com/goccy/go-json"
)
@@ -71,7 +71,7 @@ func FormatFastSeqJsonHeader(sequence *obiseq.BioSequence) string {
annotations := sequence.Annotations()
if len(annotations) > 0 {
text, err := goutils.JsonMarshal(sequence.Annotations())
text, err := obiutils.JsonMarshal(sequence.Annotations())
if err != nil {
panic(err)

View File

@@ -9,8 +9,8 @@ import (
"strconv"
"strings"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiutils"
"github.com/goccy/go-json"
)
@@ -305,7 +305,7 @@ func FormatFastSeqOBIHeader(sequence *obiseq.BioSequence) string {
map[string]string,
map[string]interface{},
obiseq.StatsOnValues:
tv, err := goutils.JsonMarshal(t)
tv, err := obiutils.JsonMarshal(t)
if err != nil {
log.Fatalf("Cannot convert %v value", value)
}

View File

@@ -11,9 +11,9 @@ import (
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiutils"
)
func min(x, y int) int {
@@ -70,7 +70,7 @@ func WriteFasta(iterator obiiter.IBioSequence,
opt := MakeOptions(options)
iterator = iterator.Rebatch(10000)
file, _ = goutils.CompressStream(file, opt.CompressedFile(), opt.CloseFile())
file, _ = obiutils.CompressStream(file, opt.CompressedFile(), opt.CloseFile())
newIter := obiiter.MakeIBioSequence()

View File

@@ -10,9 +10,9 @@ import (
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiutils"
)
func FormatFastq(seq *obiseq.BioSequence, quality_shift int, formater FormatHeader) string {
@@ -61,7 +61,7 @@ func WriteFastq(iterator obiiter.IBioSequence,
opt := MakeOptions(options)
file, _ = goutils.CompressStream(file, opt.CompressedFile(), opt.CloseFile())
file, _ = obiutils.CompressStream(file, opt.CompressedFile(), opt.CloseFile())
newIter := obiiter.MakeIBioSequence()