Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

convert: no range check between Phred encodings, so a wrong --from writes a broken FASTQ (exit 0)

Open Beginner friendly
#612 1 comment 0 reactions 0 assignees View on GitHub

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from shenwei356/seqkit

All issues in shenwei356/seqkit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.