Skip to content

Commit

Permalink
locate: fix -G/--non-greedy for tandem repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Oct 31, 2024
1 parent 1c96e2f commit 60902aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
- [SeqKit v2.9.0](https://github.com/shenwei356/seqkit/releases/tag/v2.9.0) - 2024-07-xx
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/seqkit/v2.9.0/total.svg)](https://github.com/shenwei356/seqkit/releases/tag/v2.9.0)
- `seqkit`:
- Fix sequence ID parsing with the default regular expression (in this case, we actually use bytes.Index instead) for a rare case: "xxx\tyyy zzz" was wrongly parsed as "xxx\tyyy". [#486](https://github.com/shenwei356/seqkit/issues/486)
- **Fix sequence ID parsing with the default regular expression (in this case, we actually use bytes.Index instead) for a rare case: "xxx\tyyy zzz" was wrongly parsed as "xxx\tyyy"**. [#486](https://github.com/shenwei356/seqkit/issues/486)
- `seqkit locate`:
- **Fix `-G/--non-greedy` for tandem repeats**, e.g., ATTCGATTCGATTCG (ATTCGx3).
- `seqkit grep/subseq`:
- Fix negative regions longer than sequence length. [#479](https://github.com/shenwei356/seqkit/issues/479).
- `seqkit stats`:
Expand Down
4 changes: 2 additions & 2 deletions seqkit/cmd/locate.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ Attention:
// }

if nonGreedy {
offset = offset + loc[1] + 1
offset = offset + loc[1]
} else {
offset = offset + loc[0] + 1
}
Expand Down Expand Up @@ -956,7 +956,7 @@ Attention:
// }

if nonGreedy {
offset = offset + loc[1] + 1
offset = offset + loc[1]
} else {
offset = offset + loc[0] + 1
}
Expand Down

0 comments on commit 60902aa

Please sign in to comment.