sum: a file that fails is left out of the output, but the exit code is 0
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 54/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- bioinformatics, cli
Direzione di ricerca
Start at the sum command’s input handling and worker logic, then trace how per-file errors and --id-regexp validation affect the exit status. Reproduce the reported cases with the commands in the issue, especially duplicate - input. Done when failures produce a non-zero exit status and repeated stdin is handled consistently, with regression coverage for the listed cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version: seqkit v2.14.0 (bioconda), Linux x86_64
In each case below, sum writes a message, writes no line for that file,
continues with the next files and exits 0. A script that checks the exit
code does not see that a file is missing. A missing file gives exit 255, so
the two kinds of failure disagree. The progress bar lines are removed from
the output.
Test files:
$ printf '>a\nACGT\n>b\nGGGG\n' > t.fa
$ printf '>c\nTTTT\n' > u.fa
$ awk 'BEGIN{print ">A"; for(i=0;i<15;i++) printf "ACGT"; print ""}' > A.fa
$ printf '>p\nMKVLAAGIW\n' > prot.fa
$ printf '>a\nACGTACGT\n>b\nGGCCAATT\n' > two.fa
sum -c: k too big, or protein input
$ seqkit sum -c A.fa
[ERRO] k (1000) is too big for sequence of 60 bp: A.fa
$ echo $?
0
$ seqkit sum -c -k 3 prot.fa
[ERRO] the flag -c/--circular does not support protein sequences: prot.fa
$ echo $?
0
Expected: a non-zero exit code after an [ERRO] message.
sum -c: a file with more than one sequence
$ seqkit sum -c -k 2 two.fa u.fa
[WARN] skip file with more than 1 sequences: two.fa
seqkit.v0.1_DCD_k2_3fcbf84a5fc9f459c2b154ab7d4ed9b3 u.fa
$ echo $?
0
Expected: an error and a non-zero exit code when all files are done.
sum: a directory, a non-sequence file or a broken FASTQ
$ mkdir dd
$ printf 'hello\n' > x.txt
$ printf '@a\nACGT\n+\nII\n' > b.fq
$ seqkit sum dd x.txt b.fq t.fa
[WARN] skip file: dd: fastx: xopen: input is a directory
[WARN] b.fq: fastx: unequal sequence and quality
[WARN] x.txt: fastx: invalid FASTA/Q format
seqkit.v0.1_DLS_k0_af09c73fbf60e59e4c72e8052ee7cb8b t.fa
$ echo $?
0
$ seqkit sum nofile.fa t.fa
[ERRO] stat nofile.fa: no such file or directory
$ echo $?
255
Expected: an error and a non-zero exit code, as for a missing file.
sum --id-regexp: a bad regular expression skips every file
A regular expression that does not compile, or that has no capturing group,
is reported once for each file. No file gets a line.
$ seqkit sum -i --id-regexp '(' t.fa u.fa
[WARN] skip file: u.fa: fastx: fail to compile regexp "(": error parsing regexp: missing closing ): `(`
[WARN] skip file: t.fa: fastx: fail to compile regexp "(": error parsing regexp: missing closing ): `(`
$ echo $?
0
$ seqkit sum --id-regexp 'aaa' t.fa
[WARN] skip file: t.fa: fastx: regular expression must contain a capturing group for the ID; default: ^(\S+)\s?
$ echo $?
0
Expected: one error before any file is read, and a non-zero exit code.
sum - -: stdin given twice gives two different digests
Two workers read stdin at the same time. One line gets the digest of the
data. The other line gets the digest of an empty input. A file given twice
gives two equal lines.
$ cat t.fa | seqkit sum - -
seqkit.v0.1_LS_k0_56fc8fa222734a7d4b9ddedcca604bbf -
seqkit.v0.1_DLS_k0_af09c73fbf60e59e4c72e8052ee7cb8b -
$ seqkit sum t.fa t.fa
seqkit.v0.1_DLS_k0_af09c73fbf60e59e4c72e8052ee7cb8b t.fa
seqkit.v0.1_DLS_k0_af09c73fbf60e59e4c72e8052ee7cb8b t.fa
Expected: stdin is read once, and each - gets the same digest, or an
error when - is given more than once.
- Lingua principale
- Go
- Stelle
- 1.6k
- Fork
- 189
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di shenwei356/seqkit
-
convert: no range check between Phred encodings, so a wrong --from writes a broken FASTQ (exit 0)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
shenwei356/seqkit#612 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
shenwei356/seqkit#620 ·
-
sliding, merge-slides, mutate, translate, replace: panics, lost windows and wrong output with exit 0Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
shenwei356/seqkit#619 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
shenwei356/seqkit#618 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
shenwei356/seqkit#617 ·
Tutte le issue di shenwei356/seqkit
Issue simili
-
[BUG] deploy.restart_policy without condition drops the restart policyForse già presa @akshat-lakhera l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
docker/compose#14383 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
AvengeMedia/dank-greeter#39 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
dokku/dokku-datastore#367 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: ap gateway image build cannot find local policies on WindowsForse già presa @Jayzilva l’ha presa oggi. ApertaAspect/Configuration Severity/Major
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
wso2/api-platform#3912 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni