convert: no range check between Phred encodings, so a wrong --from writes a broken FASTQ (exit 0)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- bioinformatics
Research direction
Start with the convert command’s quality score conversion paths and the existing Solexa validation mentioned in the report. Trace how source scores become target quality bytes, then run or add focused cases for negative Phred scores and output bytes above ~. Done when invalid conversions return an error with a non-zero exit code instead of writing invalid FASTQ quality lines.
Written by the indexing model from the issue text.
Description
Version: seqkit v2.14.0 (bioconda), Linux x86_64
What happens
convert checks the scores on the Solexa path: Solexa input below -5 gives
[ERRO] seq: invalid Solexa quality, and a negative Phred score converted to
Solexa gives [ERRO] seq: invalid Phred quality. It does not check the scores
when it converts between two Phred encodings, or the upper end of any
conversion. A wrong --from then writes control bytes or bytes above 126
into the quality line, and the command exits 0.
Sanger data read as Illumina-1.3+ (score below 0):
$ printf '@x\nAAA\n+\n*II\n' | seqkit convert --from Illumina-1.3+ --to Sanger | od -c
[INFO] converting Illumina-1.3+ -> Sanger
0000000 @ x \n A A A \n + \n \v * * \n
$ echo $?
0
The first quality letter becomes a vertical tab (byte 11). With other letters
the output byte can be 10, a line end inside the quality line, so the next
tools see a broken record.
High Sanger scores written as Illumina-1.3+ or Solexa (above 126):
$ printf '@x\nAA\n+\nI~\n' | seqkit convert --from Sanger --to Illumina-1.3+ | od -c
[INFO] converting Sanger -> Illumina-1.3+
0000000 @ x \n A A \n + \n h 235 \n
$ printf '@x\nAA\n+\nI~\n' | seqkit convert --from Sanger --to Solexa | od -c
[INFO] converting Sanger -> Solexa
0000000 @ x \n A A \n + \n g 234 \n
Byte 157 (octal 235) and byte 156 are not printable ASCII and not valid
FASTQ quality letters.
Expected
The same kind of error as on the Solexa path, and a non-zero exit code, when
a source score is below 0 or a target letter would be above ~ (126).
- Dominant language
- Go
- Stars
- 1.6k
- Forks
- 189
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from shenwei356/seqkit
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
shenwei356/seqkit#620 ·
-
sliding, merge-slides, mutate, translate, replace: panics, lost windows and wrong output with exit 0Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
shenwei356/seqkit#619 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
shenwei356/seqkit#618 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
shenwei356/seqkit#617 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
shenwei356/seqkit#616 ·
All issues in shenwei356/seqkit
Similar issues
-
area/gateway kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vllm-project/aibrix#3226 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
gencrl: serial numbers that fail to parse are added to the CRL as 0 or a partial valuePossibly taken @sebxt claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cfssl#1460 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
ironcore-dev/cloud-hypervisor-provider#210 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenTollGate/tollgate-module-basic-go#1027 ·
Maintainers usually reply within 1 day