Skip to content

Commit 36e9af7

Browse files
committed
fix seq validation introduced in v2.7.0. fix #439
1 parent 8d45e83 commit 36e9af7

File tree

8 files changed

+10
-19
lines changed

8 files changed

+10
-19
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
- [SeqKit v2.7.1](https://github.com/shenwei356/seqkit/releases/tag/v2.7.1) - 2024-01-31
2+
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/seqkit/v2.7.1/total.svg)](https://github.com/shenwei356/seqkit/releases/tag/v2.7.1)
3+
- `seqkit seq/locate/fish/watch`:
4+
- Removing the flag `-V/--validate-seq-length`. Now the whole sequence will be checked if `-v/--validate-seq` is given.
5+
- `seqkit amplicon`:
6+
- Fix the speed problem, introduced in v2.7.0. [#439](https://github.com/shenwei356/seqkit/issues/439).
17
- [SeqKit v2.7.0](https://github.com/shenwei356/seqkit/releases/tag/v2.7.0) - 2024-01-31
28
[![Github Releases (by Release)](https://img.shields.io/github/downloads/shenwei356/seqkit/v2.7.0/total.svg)](https://github.com/shenwei356/seqkit/releases/tag/v2.7.0)
39
- `seqkit`:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/mattn/go-isatty v0.0.16
2121
github.com/mitchellh/go-homedir v1.1.0
2222
github.com/pkg/errors v0.9.1
23-
github.com/shenwei356/bio v0.12.1
23+
github.com/shenwei356/bio v0.13.0
2424
github.com/shenwei356/breader v0.3.2
2525
github.com/shenwei356/bwt v0.6.1
2626
github.com/shenwei356/go-logging v0.0.0-20171012171522-c6b9702d88ba

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
123123
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
124124
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
125125
github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
126-
github.com/shenwei356/bio v0.12.1 h1:RAABmg9XVOEaPXqcNx7gLK710FN007a+v9SXho3P6GU=
127-
github.com/shenwei356/bio v0.12.1/go.mod h1:JjWavkWha/UzK0K7dqTVuzkHEBgGNad9yC1hv0YJrG0=
126+
github.com/shenwei356/bio v0.13.0 h1:PtgC6pJyBcSR7S16qjn6dW1mISAmsFakaBgh0uI+aFY=
127+
github.com/shenwei356/bio v0.13.0/go.mod h1:JjWavkWha/UzK0K7dqTVuzkHEBgGNad9yC1hv0YJrG0=
128128
github.com/shenwei356/breader v0.3.2 h1:GLy2clIMck6FdTwj8WLnmhv0PW/7Pp+Wcx7TVEHG0ks=
129129
github.com/shenwei356/breader v0.3.2/go.mod h1:BimwolkMTIr/O4iX7xXtjEB1z5y39G+8I5Tsm9guC3E=
130130
github.com/shenwei356/bwt v0.6.1 h1:BDS1nhhIxiC284OKtLBUgy+U5L/7WrvT/ehOExB/DSA=

seqkit/cmd/fish.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,8 @@ Attention:
154154
alnParams := parseAlnParams(flagAlnParams)
155155

156156
validateSeq := getFlagBool(cmd, "validate-seq")
157-
validateSeqLength := getFlagValidateSeqLength(cmd, "validate-seq-length")
158157

159158
seq.ValidateSeq = validateSeq
160-
seq.ValidateWholeSeq = false
161-
seq.ValidSeqLengthThreshold = validateSeqLength
162159
seq.ValidSeqThreads = config.Threads
163160

164161
if !(alphabet == nil || alphabet == seq.Unlimit) {
@@ -360,7 +357,6 @@ func init() {
360357
fishCmd.Flags().BoolP("print-desc", "D", false, "print full sequence header")
361358
fishCmd.Flags().BoolP("print-aln", "g", false, "print sequence alignments")
362359
fishCmd.Flags().BoolP("invert", "i", false, "print out references not matching with any query")
363-
fishCmd.Flags().IntP("validate-seq-length", "V", 10000, "length of sequence to validate (0 for whole seq)")
364360
fishCmd.Flags().Float64P("min-qual", "q", 5.0, "minimum mapping quality")
365361
}
366362

seqkit/cmd/locate.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ Attentions:
7070
outFile := config.OutFile
7171
seq.AlphabetGuessSeqLengthThreshold = config.AlphabetGuessSeqLength
7272
seq.ValidateSeq = true
73-
seq.ValidateWholeSeq = false
74-
seq.ValidSeqLengthThreshold = getFlagValidateSeqLength(cmd, "validate-seq-length")
7573
seq.ValidSeqThreads = config.Threads
7674
seq.ComplementThreads = config.Threads
7775
quiet := config.Quiet
@@ -988,7 +986,6 @@ func init() {
988986
locateCmd.Flags().BoolP("use-fmi", "F", false, "use FM-index for much faster search of lots of sequence patterns")
989987
locateCmd.Flags().BoolP("ignore-case", "i", false, "ignore case")
990988
locateCmd.Flags().BoolP("only-positive-strand", "P", false, "only search on positive strand")
991-
locateCmd.Flags().IntP("validate-seq-length", "V", 10000, "length of sequence to validate (0 for whole seq)")
992989
locateCmd.Flags().BoolP("non-greedy", "G", false, "non-greedy mode, faster but may miss motifs overlapping with others")
993990
locateCmd.Flags().BoolP("gtf", "", false, "output in GTF format")
994991
locateCmd.Flags().BoolP("bed", "", false, "output in BED6 format")

seqkit/cmd/seq.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ var seqCmd = &cobra.Command{
7474
rna2dna := getFlagBool(cmd, "rna2dna")
7575
color := getFlagBool(cmd, "color")
7676
validateSeq := getFlagBool(cmd, "validate-seq")
77-
validateSeqLength := getFlagValidateSeqLength(cmd, "validate-seq-length")
7877
minLen := getFlagInt(cmd, "min-len")
7978
maxLen := getFlagInt(cmd, "max-len")
8079
qBase := getFlagPositiveInt(cmd, "qual-ascii-base")
@@ -112,8 +111,6 @@ var seqCmd = &cobra.Command{
112111
}
113112

114113
seq.ValidateSeq = validateSeq
115-
seq.ValidateWholeSeq = false
116-
seq.ValidSeqLengthThreshold = validateSeqLength
117114
seq.ValidSeqThreads = config.Threads
118115
seq.ComplementThreads = config.Threads
119116

@@ -446,7 +443,6 @@ func init() {
446443
seqCmd.Flags().BoolP("rna2dna", "", false, "RNA to DNA")
447444
seqCmd.Flags().BoolP("color", "k", false, "colorize sequences - to be piped into \"less -R\"")
448445
seqCmd.Flags().BoolP("validate-seq", "v", false, "validate bases according to the alphabet")
449-
seqCmd.Flags().IntP("validate-seq-length", "V", 10000, "length of sequence to validate (0 for whole seq)")
450446
seqCmd.Flags().IntP("min-len", "m", -1, "only print sequences longer than or equal to the minimum length (-1 for no limit)")
451447
seqCmd.Flags().IntP("max-len", "M", -1, "only print sequences shorter than or equal to the maximum length (-1 for no limit)")
452448
seqCmd.Flags().IntP("qual-ascii-base", "b", 33, "ASCII BASE, 33 for Phred+33")

seqkit/cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
)
3030

3131
// VERSION of seqkit
32-
const VERSION = "2.7.0"
32+
const VERSION = "2.7.1"
3333

3434
// versionCmd represents the version command
3535
var versionCmd = &cobra.Command{

seqkit/cmd/watch.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ var watchCmd = &cobra.Command{
7373
_ = logMode
7474
fieldsText := getFlagString(cmd, "fields")
7575
validateSeq := getFlagBool(cmd, "validate-seq")
76-
validateSeqLength := getFlagValidateSeqLength(cmd, "validate-seq-length")
7776
qBase := getFlagPositiveInt(cmd, "qual-ascii-base")
7877
_ = qBase
7978

@@ -148,8 +147,6 @@ var watchCmd = &cobra.Command{
148147
}
149148

150149
seq.ValidateSeq = validateSeq
151-
seq.ValidateWholeSeq = false
152-
seq.ValidSeqLengthThreshold = validateSeqLength
153150
seq.ValidSeqThreads = config.Threads
154151
seq.ComplementThreads = config.Threads
155152

@@ -285,7 +282,6 @@ func init() {
285282
watchCmd.Flags().BoolP("pass", "x", false, "pass through mode (write input to stdout)")
286283
watchCmd.Flags().BoolP("log", "L", false, "log10(x+1) transform numeric values")
287284
watchCmd.Flags().StringP("fields", "f", "ReadLen", "target fields, available values: ReadLen, MeanQual, GC, GCSkew")
288-
watchCmd.Flags().IntP("validate-seq-length", "V", 10000, "length of sequence to validate (0 for whole seq)")
289285
watchCmd.Flags().IntP("qual-ascii-base", "b", 33, "ASCII BASE, 33 for Phred+33")
290286
watchCmd.Flags().IntP("bins", "B", -1, "number of histogram bins")
291287
watchCmd.Flags().IntP("print-freq", "p", -1, "print/report after this many records (-1 for print after EOF)")

0 commit comments

Comments
 (0)