mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-03-25 13:30:52 +00:00
Refactor rope scanner and add FASTQ rope parser
This commit refactors the rope scanner implementation by renaming gbRopeScanner to ropeScanner and extracting the common functionality into a new file. It also introduces a new FastqChunkParserRope function that parses FASTQ chunks directly from a rope without Pack(), enabling more efficient memory usage. The existing parsers are updated to use the new rope-based parser when available. The BioSequence type is enhanced with a TakeQualities method for more efficient quality data handling.
This commit is contained in:
@@ -480,6 +480,15 @@ func (s *BioSequence) SetQualities(qualities Quality) {
|
||||
s.qualities = CopySlice(qualities)
|
||||
}
|
||||
|
||||
// TakeQualities stores the slice directly without copying.
|
||||
// The caller must not use the slice after this call.
|
||||
func (s *BioSequence) TakeQualities(qualities Quality) {
|
||||
if s.qualities != nil {
|
||||
RecycleSlice(&s.qualities)
|
||||
}
|
||||
s.qualities = qualities
|
||||
}
|
||||
|
||||
// A method that appends a byte slice to the qualities of the BioSequence.
|
||||
func (s *BioSequence) WriteQualities(data []byte) (int, error) {
|
||||
s.qualities = append(s.qualities, data...)
|
||||
|
||||
Reference in New Issue
Block a user