Adds the command obimultiplex

This commit is contained in:
2022-02-01 17:31:28 +01:00
parent 76d9309508
commit 8dbda68746
13 changed files with 688 additions and 79 deletions

View File

@@ -61,11 +61,13 @@ func (sequence *BioSequence) Recycle() {
pseq := sequence.sequence
RecycleSlice(pseq.sequence)
RecycleSlice(pseq.feature)
RecycleSlice(pseq.feature)
if pseq != nil {
RecycleSlice(pseq.sequence)
RecycleSlice(pseq.feature)
RecycleSlice(pseq.feature)
RecycleAnnotation(pseq.annotations)
RecycleAnnotation(pseq.annotations)
}
sequence.sequence = nil
}
@@ -132,9 +134,14 @@ func (s BioSequence) HasAnnotation() bool {
}
func (s BioSequence) Annotations() Annotation {
if s.sequence == nil {
return nil
}
if s.sequence.annotations == nil {
s.sequence.annotations = GetAnnotation()
}
return s.sequence.annotations
}

View File

@@ -36,10 +36,12 @@ var BioSequenceAnnotationPool = sync.Pool{
}
func RecycleAnnotation(a Annotation) {
for k := range a {
delete(a, k)
if a != nil {
for k := range a {
delete(a, k)
}
BioSequenceAnnotationPool.Put(&(a))
}
BioSequenceAnnotationPool.Put(&(a))
}
func GetAnnotation(values ...Annotation) Annotation {