From 7884a74f9c15fd47876c2a36453304a4ec6c5af7 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 18 Nov 2024 21:10:47 +0100 Subject: [PATCH] Patch a bug in obitagpcr --- .gitignore | 1 + pkg/obioptions/version.go | 2 +- pkg/obiseq/biosequence.go | 3 +++ pkg/obiseq/revcomp.go | 3 +-- pkg/obitools/obitagpcr/pcrtag.go | 2 -- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6815284..cb41bc8 100644 --- a/.gitignore +++ b/.gitignore @@ -118,3 +118,4 @@ doc/book/wolf_data/Release-253/ncbitaxo/readme.txt doc/book/results/toto.tasta sample/.DS_Store GO +template.16S diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index 666cf6e..d6633a6 100644 --- a/pkg/obioptions/version.go +++ b/pkg/obioptions/version.go @@ -7,7 +7,7 @@ import ( // TODO: The version number is extracted from git. This induces that the version // corresponds to the last commit, and not the one when the file will be // commited -var _Commit = "fc75974" +var _Commit = "4b65bfc" var _Version = "Release 4.3.0" // Version returns the version of the obitools package. diff --git a/pkg/obiseq/biosequence.go b/pkg/obiseq/biosequence.go index 101e333..3a5f4be 100644 --- a/pkg/obiseq/biosequence.go +++ b/pkg/obiseq/biosequence.go @@ -179,6 +179,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() diff --git a/pkg/obiseq/revcomp.go b/pkg/obiseq/revcomp.go index 837459c..7fc4831 100644 --- a/pkg/obiseq/revcomp.go +++ b/pkg/obiseq/revcomp.go @@ -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 } diff --git a/pkg/obitools/obitagpcr/pcrtag.go b/pkg/obitools/obitagpcr/pcrtag.go index 9604e26..6c2cbbf 100644 --- a/pkg/obitools/obitagpcr/pcrtag.go +++ b/pkg/obitools/obitagpcr/pcrtag.go @@ -134,8 +134,6 @@ func IPCRTagPESequencesBatch(iterator obiiter.IBioSequence, banot["experiment"] = experiment if CLIReorientate() && direction == "reverse" { - B.ReverseComplement(true) - A.ReverseComplement(true) B.PairTo(A) batch.Slice()[i] = B }