Patch a bug in Subsequence and adds few unit tests.

Former-commit-id: caddc9ad6523e4ef02899bfe83cc8681ef674383
This commit is contained in:
2023-11-08 10:16:34 +02:00
parent 8f96517f3c
commit dedf125f6e
8 changed files with 186 additions and 44 deletions

View File

@@ -111,6 +111,28 @@ func NewBioSequence(id string,
return bs
}
// NewBioSequenceWithQualities creates a new BioSequence object with the given id, sequence, definition, and qualities.
//
// Parameters:
// - id: the id of the BioSequence.
// - sequence: the sequence data of the BioSequence.
// - definition: the definition of the BioSequence.
// - qualities: the qualities data of the BioSequence.
//
// Returns:
// - *BioSequence: a pointer to the newly created BioSequence object.
func NewBioSequenceWithQualities(id string,
sequence []byte,
definition string,
qualities []byte) *BioSequence {
bs := NewEmptyBioSequence(0)
bs.SetId(id)
bs.SetSequence(sequence)
bs.SetDefinition(definition)
bs.SetQualities(qualities)
return bs
}
// Recycle recycles the BioSequence object.
//
// It decreases the count of in-memory sequences and increases the count of recycled sequences.