mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Merge branch 'master' into taxonomy
This commit is contained in:
@ -12,6 +12,7 @@ package obiseq
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"slices"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -182,6 +183,9 @@ func (s *BioSequence) Copy() *BioSequence {
|
||||
newSeq.sequence = CopySlice(s.sequence)
|
||||
newSeq.qualities = CopySlice(s.qualities)
|
||||
newSeq.feature = CopySlice(s.feature)
|
||||
if s.revcomp != nil {
|
||||
newSeq.revcomp = s.revcomp.Copy()
|
||||
}
|
||||
|
||||
if len(s.annotations) > 0 {
|
||||
s.annot_lock.Lock()
|
||||
@ -375,6 +379,11 @@ func (s *BioSequence) MD5() [16]byte {
|
||||
return md5.Sum(s.sequence)
|
||||
}
|
||||
|
||||
func (s *BioSequence) MD5String() string {
|
||||
md5_hash := s.MD5()
|
||||
return hex.EncodeToString(md5_hash[:])
|
||||
}
|
||||
|
||||
// SetId sets the id of the BioSequence.
|
||||
//
|
||||
// Parameters:
|
||||
|
@ -55,8 +55,7 @@ func (sequence *BioSequence) ReverseComplement(inplace bool) *BioSequence {
|
||||
|
||||
if !inplace {
|
||||
original = sequence
|
||||
sequence.revcomp = sequence.Copy()
|
||||
sequence = sequence.revcomp
|
||||
sequence = sequence.Copy()
|
||||
sequence.revcomp = original
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user