Skip to content

Commit c34a02e

Browse files
committed
Check for inconsistent fastq pair
1 parent e94eb3d commit c34a02e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/groovy/com/milaboratory/migec/Assemble.groovy

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ while ((header1 = reader1.readLine()) != null) {
192192
seq2 = reader2.readLine()
193193
reader2.readLine()
194194
reader2.readLine()
195+
196+
if (header2 == null){
197+
println "[ERROR] R1 file has more reads than R2"
198+
System.exit(1)
199+
}
195200
}
196201

197202
if (seq1.length() >= MIN_READ_SZ && (!paired || seq2.length() >= MIN_READ_SZ)) {
@@ -210,6 +215,16 @@ while ((header1 = reader1.readLine()) != null) {
210215
"unique UMIs so far ${migData[0].size()}"
211216
}
212217
}
218+
219+
if (paired) {
220+
header2 = reader2.readLine()
221+
222+
if (header2 != null){
223+
println "[ERROR] R2 file has more reads than R1"
224+
System.exit(1)
225+
}
226+
}
227+
213228
println "[${new Date()} $scriptName] Processed $nReads reads, " +
214229
"unique UMIs ${migData[0].size()}"
215230

0 commit comments

Comments
 (0)