mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Several bug in annotation management
This commit is contained in:
@ -43,9 +43,30 @@ func (sequence *BioSequence) Subsequence(from, to int, circular bool) (*BioSeque
|
||||
|
||||
}
|
||||
|
||||
if len(sequence.Annotations()) > 0 {
|
||||
if sequence.HasAnnotation() {
|
||||
newSeq.annotations = GetAnnotation(sequence.Annotations())
|
||||
}
|
||||
|
||||
return newSeq, nil
|
||||
return newSeq._subseqMutation(from), nil
|
||||
}
|
||||
|
||||
func (sequence *BioSequence) _subseqMutation(shift int) *BioSequence {
|
||||
|
||||
lseq := sequence.Length()
|
||||
|
||||
mut, ok := sequence.GetIntMap("pairing_mismatches")
|
||||
if ok && len(mut) > 0 {
|
||||
cmut := make(map[string]int, len(mut))
|
||||
|
||||
for m, p := range mut {
|
||||
if p < lseq {
|
||||
cmut[m] = p - shift
|
||||
}
|
||||
}
|
||||
|
||||
sequence.SetAttribute("pairing_mismatches", cmut)
|
||||
}
|
||||
|
||||
return sequence
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user