fiberseq/fibertools-rs

Bug: Assertion error in supplemental or secondary reads

Closed this issue · 3 comments

Currently, there is a bug with handling ONT supplemental or secondary alignments in the ML/MM parser. I think it is due to hard clipping but need to investigate.

A temporary workaround is to filter your inputs to remove these types of alignments (samtools view -F 2304)

Errors look like:

[2023-10-31T18:43:32Z TRACE ft] TRACE logging enabled
[2023-10-31T18:43:32Z DEBUG ft] Using 30 threads.
[2023-10-31T18:43:32Z INFO  ft] Starting ft-center
[2023-10-31T18:43:32Z DEBUG bio_io] Compression: No
[2023-10-31T18:43:32Z TRACE fibertools_rs::fiber] cb380dce191d20804ee54cfe86c4173384172d61_dna_r10.4.1_e8.2_400bps_sup@v4.2.0-44EB653E
[2023-10-31T18:43:32Z TRACE fibertools_rs::fiber] cb380dce191d20804ee54cfe86c4173384172d61_dna_r10.4.1_e8.2_400bps_sup@v4.2.0-5FF52E97
[2023-10-31T18:43:32Z TRACE fibertools_rs::fiber] cb380dce191d20804ee54cfe86c4173384172d61_dna_r10.4.1_e8.2_400bps_sup@v4.2.0-44ED6DDD
thread 'thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
 left: `0`,
 right: `4319`', src/basemods/mod.rs<unnamed>' panicked at ':166:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
assertion failed: `(left == right)`
 left: `0`,
 right: `2530`', src/basemods/mod.rs:166:17
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
 left: `0`,
 right: `7916`', src/basemods/mod.rs:166:17

Correct handling of MM/ML tags in hard clipped alignments is still not settled in the SAM spec:

samtools/hts-specs#646

So this will remain an issue until this conversation is resolved.

Please filter any hard clipped reads before using ft.