mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Adjust the size of the genbank and embl buffer size
This commit is contained in:
@ -187,7 +187,7 @@ func _ParseEmblFile(
|
|||||||
func ReadEMBL(reader io.Reader, options ...WithOption) (obiiter.IBioSequence, error) {
|
func ReadEMBL(reader io.Reader, options ...WithOption) (obiiter.IBioSequence, error) {
|
||||||
opt := MakeOptions(options)
|
opt := MakeOptions(options)
|
||||||
|
|
||||||
buff := make([]byte, 1024*1024*512)
|
buff := make([]byte, 1024*1024*128) // 128 MB
|
||||||
|
|
||||||
entry_channel := ReadSeqFileChunk(
|
entry_channel := ReadSeqFileChunk(
|
||||||
opt.Source(),
|
opt.Source(),
|
||||||
|
@ -223,7 +223,7 @@ func ReadGenbank(reader io.Reader, options ...WithOption) (obiiter.IBioSequence,
|
|||||||
opt := MakeOptions(options)
|
opt := MakeOptions(options)
|
||||||
// entry_channel := make(chan _FileChunk)
|
// entry_channel := make(chan _FileChunk)
|
||||||
|
|
||||||
buff := make([]byte, 1024*1024*512)
|
buff := make([]byte, 1024*1024*128) // 128 MB
|
||||||
|
|
||||||
entry_channel := ReadSeqFileChunk(
|
entry_channel := ReadSeqFileChunk(
|
||||||
opt.Source(),
|
opt.Source(),
|
||||||
|
@ -9,8 +9,6 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _FileChunkSize = 1024 * 1024 * 10
|
|
||||||
|
|
||||||
type SeqFileChunkParser func(string, io.Reader) (obiseq.BioSequenceSlice, error)
|
type SeqFileChunkParser func(string, io.Reader) (obiseq.BioSequenceSlice, error)
|
||||||
|
|
||||||
type SeqFileChunk struct {
|
type SeqFileChunk struct {
|
||||||
@ -46,7 +44,7 @@ func ReadSeqFileChunk(
|
|||||||
|
|
||||||
chunk_channel := make(ChannelSeqFileChunk)
|
chunk_channel := make(ChannelSeqFileChunk)
|
||||||
|
|
||||||
_FileChunkSize := len(buff)
|
fileChunkSize := len(buff)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
size := 0
|
size := 0
|
||||||
@ -73,9 +71,9 @@ func ReadSeqFileChunk(
|
|||||||
// Read from the reader in 1 MB increments until the end of the last entry is found
|
// Read from the reader in 1 MB increments until the end of the last entry is found
|
||||||
for end = splitter(buff); err == nil && end < 0; end = splitter(buff) {
|
for end = splitter(buff); err == nil && end < 0; end = splitter(buff) {
|
||||||
ic++
|
ic++
|
||||||
buff = slices.Grow(buff, _FileChunkSize)
|
buff = slices.Grow(buff, fileChunkSize)
|
||||||
l := len(buff)
|
l := len(buff)
|
||||||
extbuff := buff[l:(l + _FileChunkSize - 1)]
|
extbuff := buff[l:(l + fileChunkSize - 1)]
|
||||||
size, err = io.ReadFull(reader, extbuff)
|
size, err = io.ReadFull(reader, extbuff)
|
||||||
buff = buff[0:(l + size)]
|
buff = buff[0:(l + size)]
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
// TODO: The version number is extracted from git. This induces that the version
|
// TODO: The version number is extracted from git. This induces that the version
|
||||||
// corresponds to the last commit, and not the one when the file will be
|
// corresponds to the last commit, and not the one when the file will be
|
||||||
// commited
|
// commited
|
||||||
var _Commit = "f83032e"
|
var _Commit = "886b5d9"
|
||||||
var _Version = "Release 4.2.0"
|
var _Version = "Release 4.2.0"
|
||||||
|
|
||||||
// Version returns the version of the obitools package.
|
// Version returns the version of the obitools package.
|
||||||
|
Reference in New Issue
Block a user