Skip to content

Bio::SeqIO::fastq can't handle FASTQ with empty sequence and quality lines #400

Description

@ntakebay

After removing primers, there ends up with no sequence, which end up with FASTQ with empty sequence and quality lines like this:

@M0 M0:1

+

@M5 M5:1
TTTTTAGAG
+
GGGGGGGGG

When I try to read this FASTQ file withsomething like this:

my $seqio_obj = Bio::SeqIO->new(-file => $file, -format => 'fastq');
while (my $seq = $seqio_obj->next_seq()) {
    $seq->desc( $seq->id . " ". $seq->desc);
    push(@seqArr, $seq);
}

It stops processing with error:
------------- EXCEPTION: Bio::Root::Exception ------------- MSG: Missing sequence and/or quality data; line: 30 STACK: Error::throw STACK: Bio::Root::Root::throw /usr/local/share/perl5/5.40/Bio/Root/Root.pm:449 STACK: Bio::SeqIO::fastq::next_dataset /usr/local/share/perl5/5.40/Bio/SeqIO/fastq.pm:121 STACK: Bio::SeqIO::fastq::next_seq /usr/local/share/perl5/5.40/Bio/SeqIO/fastq.pm:52 STACK: /home/lab/bin/fastqSortByName.pl:44 -----------------------------------------------------------

In next_seq() of Bio/SeqIO/fastq.pm, there is a comment:

        # Are FASTQ sequences w/o any sequence valid?  Removing for now
        # -cjfields 6.22.09

and he chose to throw an error, but since empty fastq sequence does happen during analyses, it shouldn't quit when empty line is encountered, and it should read it in as empty sequence.

The version of Bio::SeqIO is the current ctan version 1.7.8.

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