Skip to content

Give the user the option to continue parsing records if a previous record has mismatched sequence and quality lengths #118

Description

@nrminor

Hello!

I'm using needletail to parse through large volumes of reads from SRA/ENA. For reasons that are mysterious to me, these datasets occasionally contain invalid FASTQ records where the sequence length is different from the quality scores length, but the record is otherwise parseable. In these cases, needletail sets an internal finished field to true, which ceases iteration through records.

With the looseness of the FASTQ format, I can understand why this was implemented. But often, these records pop up something like two-thirds of the way through multi-billion-read FASTQs. Furthermore, they are often the only invalid record or one of a very small number of records that show this length mismatch.

As a library user, it would be helpful if needletail gave me control over what to do with these records. For example, if iteration were allowed to continue but I was able to match on the UnequalLengths error variant, I could choose (and indeed would choose) to just skip that invalid record and continue taking what I can get from the un-normalized data that sometimes makes it into SRA.

To implement this, I could see removing the finished switch entirely. I could also see bringing in a new parser option that could tell needletail how to handle these cases. Would there be any interest in reviewing a PR that implements either of these designs?

Thanks!
--Nick

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions