mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Code reefactoring
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
package obiseq
|
||||
|
||||
import "git.metabarcoding.org/lecasofts/go/obitools/pkg/goutils"
|
||||
func (sequence BioSequence) Join(seq2 BioSequence, inplace bool) BioSequence {
|
||||
|
||||
func (sequence BioSequence) Join(seq2 BioSequence, copy_annot bool) (BioSequence, error) {
|
||||
|
||||
new_seq := MakeEmptyBioSequence()
|
||||
new_seq.SetId(sequence.Id())
|
||||
new_seq.SetDefinition(sequence.Definition())
|
||||
|
||||
new_seq.Write(sequence.Sequence())
|
||||
new_seq.Write(seq2.Sequence())
|
||||
|
||||
if copy_annot {
|
||||
goutils.CopyMap(new_seq.Annotations(), sequence.Annotations())
|
||||
if !inplace {
|
||||
sequence = sequence.Copy()
|
||||
}
|
||||
|
||||
return new_seq, nil
|
||||
sequence.Write(seq2.Sequence())
|
||||
|
||||
return sequence
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user