Adds a reader for NGS filter files and change some API for the apat library

This commit is contained in:
2022-01-18 13:09:32 +01:00
parent 6571296bb2
commit 4551df08b1
13 changed files with 301 additions and 96 deletions

View File

@ -56,16 +56,23 @@ func WriteSequenceBatch(iterator obiseq.IBioSequenceBatch,
file io.Writer,
options ...WithOption) (obiseq.IBioSequenceBatch, error) {
var newIter obiseq.IBioSequenceBatch
var err error
iterator = iterator.Rebatch(1000)
ok := iterator.Next()
if ok {
iterator.PushBack()
batch := iterator.Get()
if batch.Slice()[0].HasQualities() {
newIter, err = WriteFastqBatch(iterator, file, options...)
iterator.PushBack()
var newIter obiseq.IBioSequenceBatch
var err error
if len(batch.Slice()) > 0 {
if batch.Slice()[0].HasQualities() {
newIter, err = WriteFastqBatch(iterator, file, options...)
} else {
newIter, err = WriteFastaBatch(iterator, file, options...)
}
} else {
newIter, err = WriteFastaBatch(iterator, file, options...)
}