From 4b65bfce846d203ce021b0736c2a748e1e613182 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 4 Nov 2024 14:30:17 +0100 Subject: [PATCH] Changes to be committed: modified: pkg/obioptions/version.go modified: pkg/obitools/obitagpcr/pcrtag.go --- pkg/obioptions/version.go | 2 +- pkg/obitools/obitagpcr/pcrtag.go | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/pkg/obioptions/version.go b/pkg/obioptions/version.go index 14ceb61..666cf6e 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 = "422f11c" +var _Commit = "fc75974" var _Version = "Release 4.3.0" // Version returns the version of the obitools package. diff --git a/pkg/obitools/obitagpcr/pcrtag.go b/pkg/obitools/obitagpcr/pcrtag.go index 8b7caf6..9604e26 100644 --- a/pkg/obitools/obitagpcr/pcrtag.go +++ b/pkg/obitools/obitagpcr/pcrtag.go @@ -64,7 +64,7 @@ func IPCRTagPESequencesBatch(iterator obiiter.IBioSequence, newIter := obiiter.MakeIBioSequence() newIter.MarkAsPaired() - f := func(iterator obiiter.IBioSequence, wid int) { + f := func(iterator obiiter.IBioSequence) { arena := obialign.MakePEAlignArena(150, 150) shifts := make(map[int]int) @@ -89,39 +89,46 @@ func IPCRTagPESequencesBatch(iterator obiiter.IBioSequence, forward_match := annot["obimultiplex_forward_match"].(string) forward_mismatches := annot["obimultiplex_forward_error"].(int) - forward_tag := annot["obimultiplex_forward_tag"].(string) reverse_match := annot["obimultiplex_reverse_match"].(string) reverse_mismatches := annot["obimultiplex_reverse_error"].(int) - reverse_tag := annot["obimultiplex_reverse_tag"].(string) sample := annot["sample"].(string) experiment := annot["experiment"].(string) aanot := A.Annotations() + banot := B.Annotations() + + if value, ok := annot["obimultiplex_forward_tag"]; ok { + forward_tag := value.(string) + aanot["obimultiplex_forward_tag"] = forward_tag + banot["obimultiplex_forward_tag"] = forward_tag + } + + if value, ok := annot["obimultiplex_reverse_tag"]; ok { + reverse_tag := value.(string) + aanot["obimultiplex_reverse_tag"] = reverse_tag + banot["obimultiplex_reverse_tag"] = reverse_tag + } + aanot["obimultiplex_direction"] = direction aanot["obimultiplex_forward_match"] = forward_match aanot["obimultiplex_forward_mismatches"] = forward_mismatches - aanot["obimultiplex_forward_tag"] = forward_tag aanot["obimultiplex_reverse_match"] = reverse_match aanot["obimultiplex_reverse_mismatches"] = reverse_mismatches - aanot["obimultiplex_reverse_tag"] = reverse_tag aanot["sample"] = sample aanot["experiment"] = experiment - banot := B.Annotations() banot["obimultiplex_direction"] = direction banot["obimultiplex_forward_match"] = forward_match banot["obimultiplex_forward_mismatches"] = forward_mismatches - banot["obimultiplex_forward_tag"] = forward_tag banot["obimultiplex_reverse_match"] = reverse_match banot["obimultiplex_reverse_mismatches"] = reverse_mismatches - banot["obimultiplex_reverse_tag"] = reverse_tag banot["sample"] = sample banot["experiment"] = experiment @@ -162,9 +169,9 @@ func IPCRTagPESequencesBatch(iterator obiiter.IBioSequence, newIter.Add(nworkers) for i := 1; i < nworkers; i++ { - go f(iterator.Split(), i) + go f(iterator.Split()) } - go f(iterator, 0) + go f(iterator) go func() { newIter.WaitAndClose()