mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
First commit
This commit is contained in:
30
pkg/obiformats/fastseq_header.go
Normal file
30
pkg/obiformats/fastseq_header.go
Normal file
@ -0,0 +1,30 @@
|
||||
package obiformats
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/oa2/pkg/obiseq"
|
||||
)
|
||||
|
||||
func ParseGuessedFastSeqHeader(sequence obiseq.BioSequence) {
|
||||
if strings.HasPrefix(sequence.Definition(), "{") {
|
||||
ParseFastSeqJsonHeader(sequence)
|
||||
} else {
|
||||
ParseFastSeqOBIHeader(sequence)
|
||||
}
|
||||
}
|
||||
|
||||
func IParseFastSeqHeaderBatch(iterator obiseq.IBioSequenceBatch, options ...WithOption) obiseq.IBioSequenceBatch {
|
||||
opt := MakeOptions(options)
|
||||
return iterator.MakeIWorker(obiseq.AnnotatorToSeqWorker(opt.ParseFastSeqHeader()),
|
||||
opt.ParallelWorkers(),
|
||||
opt.BufferSize())
|
||||
}
|
||||
|
||||
func IParseFastSeqHeader(iterator obiseq.IBioSequence, options ...WithOption) obiseq.IBioSequence {
|
||||
opt := MakeOptions(options)
|
||||
|
||||
return IParseFastSeqHeaderBatch(iterator.IBioSequenceBatch(opt.BatchSize(),
|
||||
opt.BufferSize()),
|
||||
options...).SortBatches().IBioSequence()
|
||||
}
|
Reference in New Issue
Block a user