From 80c38eb4a54975f38d002c4c3c78de9264dd38ce Mon Sep 17 00:00:00 2001 From: Illyoung Choi Date: Thu, 30 Aug 2018 12:35:53 -0700 Subject: [PATCH] Show header of a read when input FASTQ sample has invalid format --- src/libra/common/sequence/Read.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libra/common/sequence/Read.java b/src/libra/common/sequence/Read.java index b49bf87..5d1ed18 100644 --- a/src/libra/common/sequence/Read.java +++ b/src/libra/common/sequence/Read.java @@ -116,8 +116,13 @@ public void parseFasta(List lines) throws IOException { public void parseFastq(List lines) throws IOException { clear(); + if(lines.size() == 0) { + return; + } + if(lines.size() != 4) { - throw new IOException(String.format("invalid fastq read format - line num is %d", lines.size())); + String header = lines.get(0); + throw new IOException(String.format("invalid fastq read format - a read (%s) has %d lines", header, lines.size())); } int lineNo = 0;