Skip to content

Commit

Permalink
fix seq validation introduced in v2.7.0. fix #439
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Feb 19, 2024
1 parent 8d45e83 commit 5fcd0bd
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- [SeqKit v2.7.1](https://github.com/shenwei356/seqkit/releases/tag/v2.7.1) - 2024-01-31
[![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)
- `seqkit seq/locate/fish/watch`:
- Removing the flag `-V/--validate-seq-length`. Now the whole sequence will be checked if `-v/--validate-seq` is given.
- [SeqKit v2.7.0](https://github.com/shenwei356/seqkit/releases/tag/v2.7.0) - 2024-01-31
[![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)
- `seqkit`:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/mattn/go-isatty v0.0.16
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.9.1
github.com/shenwei356/bio v0.12.1
github.com/shenwei356/bio v0.13.0
github.com/shenwei356/breader v0.3.2
github.com/shenwei356/bwt v0.6.1
github.com/shenwei356/go-logging v0.0.0-20171012171522-c6b9702d88ba
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk=
github.com/shenwei356/bio v0.12.1 h1:RAABmg9XVOEaPXqcNx7gLK710FN007a+v9SXho3P6GU=
github.com/shenwei356/bio v0.12.1/go.mod h1:JjWavkWha/UzK0K7dqTVuzkHEBgGNad9yC1hv0YJrG0=
github.com/shenwei356/bio v0.13.0 h1:PtgC6pJyBcSR7S16qjn6dW1mISAmsFakaBgh0uI+aFY=
github.com/shenwei356/bio v0.13.0/go.mod h1:JjWavkWha/UzK0K7dqTVuzkHEBgGNad9yC1hv0YJrG0=
github.com/shenwei356/breader v0.3.2 h1:GLy2clIMck6FdTwj8WLnmhv0PW/7Pp+Wcx7TVEHG0ks=
github.com/shenwei356/breader v0.3.2/go.mod h1:BimwolkMTIr/O4iX7xXtjEB1z5y39G+8I5Tsm9guC3E=
github.com/shenwei356/bwt v0.6.1 h1:BDS1nhhIxiC284OKtLBUgy+U5L/7WrvT/ehOExB/DSA=
Expand Down
4 changes: 0 additions & 4 deletions seqkit/cmd/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,8 @@ Attention:
alnParams := parseAlnParams(flagAlnParams)

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

seq.ValidateSeq = validateSeq
seq.ValidateWholeSeq = false
seq.ValidSeqLengthThreshold = validateSeqLength
seq.ValidSeqThreads = config.Threads

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

Expand Down
3 changes: 0 additions & 3 deletions seqkit/cmd/locate.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ Attentions:
outFile := config.OutFile
seq.AlphabetGuessSeqLengthThreshold = config.AlphabetGuessSeqLength
seq.ValidateSeq = true
seq.ValidateWholeSeq = false
seq.ValidSeqLengthThreshold = getFlagValidateSeqLength(cmd, "validate-seq-length")
seq.ValidSeqThreads = config.Threads
seq.ComplementThreads = config.Threads
quiet := config.Quiet
Expand Down Expand Up @@ -988,7 +986,6 @@ func init() {
locateCmd.Flags().BoolP("use-fmi", "F", false, "use FM-index for much faster search of lots of sequence patterns")
locateCmd.Flags().BoolP("ignore-case", "i", false, "ignore case")
locateCmd.Flags().BoolP("only-positive-strand", "P", false, "only search on positive strand")
locateCmd.Flags().IntP("validate-seq-length", "V", 10000, "length of sequence to validate (0 for whole seq)")
locateCmd.Flags().BoolP("non-greedy", "G", false, "non-greedy mode, faster but may miss motifs overlapping with others")
locateCmd.Flags().BoolP("gtf", "", false, "output in GTF format")
locateCmd.Flags().BoolP("bed", "", false, "output in BED6 format")
Expand Down
4 changes: 0 additions & 4 deletions seqkit/cmd/seq.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ var seqCmd = &cobra.Command{
rna2dna := getFlagBool(cmd, "rna2dna")
color := getFlagBool(cmd, "color")
validateSeq := getFlagBool(cmd, "validate-seq")
validateSeqLength := getFlagValidateSeqLength(cmd, "validate-seq-length")
minLen := getFlagInt(cmd, "min-len")
maxLen := getFlagInt(cmd, "max-len")
qBase := getFlagPositiveInt(cmd, "qual-ascii-base")
Expand Down Expand Up @@ -112,8 +111,6 @@ var seqCmd = &cobra.Command{
}

seq.ValidateSeq = validateSeq
seq.ValidateWholeSeq = false
seq.ValidSeqLengthThreshold = validateSeqLength
seq.ValidSeqThreads = config.Threads
seq.ComplementThreads = config.Threads

Expand Down Expand Up @@ -446,7 +443,6 @@ func init() {
seqCmd.Flags().BoolP("rna2dna", "", false, "RNA to DNA")
seqCmd.Flags().BoolP("color", "k", false, "colorize sequences - to be piped into \"less -R\"")
seqCmd.Flags().BoolP("validate-seq", "v", false, "validate bases according to the alphabet")
seqCmd.Flags().IntP("validate-seq-length", "V", 10000, "length of sequence to validate (0 for whole seq)")
seqCmd.Flags().IntP("min-len", "m", -1, "only print sequences longer than or equal to the minimum length (-1 for no limit)")
seqCmd.Flags().IntP("max-len", "M", -1, "only print sequences shorter than or equal to the maximum length (-1 for no limit)")
seqCmd.Flags().IntP("qual-ascii-base", "b", 33, "ASCII BASE, 33 for Phred+33")
Expand Down
4 changes: 0 additions & 4 deletions seqkit/cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ var watchCmd = &cobra.Command{
_ = logMode
fieldsText := getFlagString(cmd, "fields")
validateSeq := getFlagBool(cmd, "validate-seq")
validateSeqLength := getFlagValidateSeqLength(cmd, "validate-seq-length")
qBase := getFlagPositiveInt(cmd, "qual-ascii-base")
_ = qBase

Expand Down Expand Up @@ -148,8 +147,6 @@ var watchCmd = &cobra.Command{
}

seq.ValidateSeq = validateSeq
seq.ValidateWholeSeq = false
seq.ValidSeqLengthThreshold = validateSeqLength
seq.ValidSeqThreads = config.Threads
seq.ComplementThreads = config.Threads

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

0 comments on commit 5fcd0bd

Please sign in to comment.