Skip to content

Commit 60902aa

Browse files
committed
locate: fix -G/--non-greedy for tandem repeats
1 parent 1c96e2f commit 60902aa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- [SeqKit v2.9.0](https://github.com/shenwei356/seqkit/releases/tag/v2.9.0) - 2024-07-xx
22
[![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)
33
- `seqkit`:
4-
- 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)
4+
- **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)
5+
- `seqkit locate`:
6+
- **Fix `-G/--non-greedy` for tandem repeats**, e.g., ATTCGATTCGATTCG (ATTCGx3).
57
- `seqkit grep/subseq`:
68
- Fix negative regions longer than sequence length. [#479](https://github.com/shenwei356/seqkit/issues/479).
79
- `seqkit stats`:

seqkit/cmd/locate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ Attention:
857857
// }
858858

859859
if nonGreedy {
860-
offset = offset + loc[1] + 1
860+
offset = offset + loc[1]
861861
} else {
862862
offset = offset + loc[0] + 1
863863
}
@@ -956,7 +956,7 @@ Attention:
956956
// }
957957

958958
if nonGreedy {
959-
offset = offset + loc[1] + 1
959+
offset = offset + loc[1]
960960
} else {
961961
offset = offset + loc[0] + 1
962962
}

0 commit comments

Comments
 (0)