Code reefactoring

This commit is contained in:
coissac committed 2022-01-14 16:10:19 +01:00
1 parent 45a1765a03
commit ff40222902
13 files changed
+68 -92

No files matched your search

+6 -13
View File
@@ -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
}