Skip to content

Commit 993b7db

Browse files
committed
fix issue with alignemnt
1 parent 293aca7 commit 993b7db

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎rust/bioscript-formats/src/alignment.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ pub(crate) fn query_cram_records(
8686
/// Iterate decoded alignment records intersecting `locus`, streaming from an
8787
/// already-built CRAM `IndexedReader`. This is the reader-based entry point
8888
/// used by non-filesystem callers (e.g. wasm with a JS `ReadAt` shim).
89+
///
90+
/// MD5 mismatches between the CRAM slices and the supplied reference are
91+
/// tolerated (lenient decode). The wasm caller has no way to surface a
92+
/// `--allow-md5-mismatch` flag and the web flow expects to keep going when
93+
/// the FASTA is "close enough"; this matches what users get from the CLI
94+
/// after passing that flag.
8995
pub fn for_each_cram_record_with_reader<R, F>(
9096
reader: &mut cram::io::indexed_reader::IndexedReader<R>,
9197
label: &str,
@@ -96,7 +102,7 @@ where
96102
R: Read + Seek,
97103
F: FnMut(AlignmentRecord) -> Result<bool, RuntimeError>,
98104
{
99-
cram_stream::for_each_cram_record_with_reader_inner(reader, label, locus, false, on_record)
105+
cram_stream::for_each_cram_record_with_reader_inner(reader, label, locus, true, on_record)
100106
}
101107

102108
/// Iterate raw CRAM records intersecting `locus`, streaming from an
@@ -113,7 +119,7 @@ where
113119
R: Read + Seek,
114120
F: FnMut(cram::Record<'_>) -> Result<bool, RuntimeError>,
115121
{
116-
for_each_raw_cram_record_with_reader_inner(reader, label, locus, false, on_record)
122+
for_each_raw_cram_record_with_reader_inner(reader, label, locus, true, on_record)
117123
}
118124

119125
#[cfg(test)]

0 commit comments

Comments
 (0)