Plenty of small bugs

Former-commit-id: 42c7fab7d65906c80ab4cd32da6867ff21842ea8
This commit is contained in:
Eric Coissac
2024-06-04 16:49:12 +02:00
parent e843d2aa5c
commit 65f5109957
15 changed files with 894 additions and 264 deletions

View File

@@ -26,11 +26,13 @@ func FormatFastq(seq *obiseq.BioSequence, formater FormatHeader) string {
info = formater(seq)
}
return fmt.Sprintf("@%s %s\n%s\n+\n%s",
f := fmt.Sprintf("@%s %s\n%s\n+\n%s",
seq.Id(), info,
seq.String(),
q,
)
return f
}
func FormatFastqBatch(batch obiiter.BioSequenceBatch,
@@ -38,7 +40,8 @@ func FormatFastqBatch(batch obiiter.BioSequenceBatch,
var bs bytes.Buffer
for _, seq := range batch.Slice() {
if seq.Len() > 0 {
bs.WriteString(FormatFastq(seq, formater))
fs := FormatFastq(seq, formater)
bs.WriteString(fs)
bs.WriteString("\n")
} else {
if skipEmpty {
@@ -49,6 +52,7 @@ func FormatFastqBatch(batch obiiter.BioSequenceBatch,
}
}
return bs.Bytes()
}