Skip to content

Commit

Permalink
amplicon: Fix a big introduced in v2.7.0. When more than one pairs of…
Browse files Browse the repository at this point in the history
… primers are given, only the last one is used. #457. introduced in fixing #439
  • Loading branch information
shenwei356 committed Apr 25, 2024
1 parent 0f495bc commit 98a4782
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- [SeqKit v2.8.2](https://github.com/shenwei356/seqkit/releases/tag/v2.8.2) - 2024-04-07
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/seqkit/v2.8.2/total.svg)](https://github.com/shenwei356/seqkit/releases/tag/v2.8.2)
- `seqkit amplicon`:
- Fix a big introduced in v2.7.0. When more than one pairs of primers are given, only the last one is used. [#457](https://github.com/shenwei356/seqkit/issues/457)
- [SeqKit v2.8.1](https://github.com/shenwei356/seqkit/releases/tag/v2.8.1) - 2024-04-07
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/seqkit/v2.8.1/total.svg)](https://github.com/shenwei356/seqkit/releases/tag/v2.8.1)
- `seqkit sana`:
Expand Down
8 changes: 7 additions & 1 deletion seqkit/cmd/amplicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,14 @@ Examples:
// finder pools
finderPools := make([]*sync.Pool, len(primers))
for i, primer := range primers {
f := make([]byte, len(primer[1])) // copy the primer sequence
copy(f, primer[1])

r := make([]byte, len(primer[2])) // copy the primer sequence
copy(r, primer[2])

finderPools[i] = &sync.Pool{New: func() interface{} {
finder, _ := NewAmpliconFinder([]byte{'A'}, primer[1], primer[2], maxMismatch)
finder, _ := NewAmpliconFinder([]byte{'A'}, f, r, maxMismatch)
return finder
}}
}
Expand Down

0 comments on commit 98a4782

Please sign in to comment.