From 2f1bd061b9ec3da83871296e37504f83e43782f3 Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Tue, 6 Jun 2023 15:35:10 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20"Mismatching=20read=20pair!"=20error=20wh?= =?UTF-8?q?en=20the=20read=20name=20matches=20but=20the=E2=80=A6=20(#28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix "Mismatching read pair!" error when the read name matches but the header does not (e.g. due to read number being in the comment section) Co-authored-by: tfenne --- src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 47d16c2..2e9f833 100644 --- a/src/main.rs +++ b/src/main.rs @@ -502,11 +502,12 @@ fn process_paired_reads( progress.record(); progress.record(); } - assert!( - read1.head() == read2.head(), + assert_eq!( + read1.id_bytes(), + read2.id_bytes(), "Mismatching read pair! R1: {} R2: {}", - std::str::from_utf8(read1.head()).unwrap(), - std::str::from_utf8(read2.head()).unwrap() + read1.id().unwrap(), + read2.id().unwrap() ); // NB: if the output is to be colored, always call read_match on read2, regardless of // whether or not read1 had a match, so that read2 is always colored. If the output