Skip to content

Commit ca7c562

Browse files
committed
Fix issue where insert size metrics failed on a sample without adapters
1 parent 16fceb4 commit ca7c562

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version 0.9.1
11+
-----------------
12+
+ Fix an issue where the insert size metrics module would crash when no
13+
adapters where present.
14+
1015
version 0.9.0
1116
-----------------
1217
+ MultiQC support since MultiQC version 1.22

src/sequali/report_modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,8 +1843,8 @@ def from_insert_size_metrics(cls, metrics: InsertSizeMetrics):
18431843
metrics.adapters_read1())
18441844
adapters_read2 = AdapterFromOverlapReport.select_relevant_adapters(
18451845
metrics.adapters_read2())
1846-
longest_adapter_read1 = adapters_read1[-1][0]
1847-
longest_adapter_read2 = adapters_read2[-1][0]
1846+
longest_adapter_read1 = adapters_read1[-1][0] if adapters_read1 else ""
1847+
longest_adapter_read2 = adapters_read2[-1][0] if adapters_read2 else ""
18481848
longest_adapter_read1_match = identify_sequence_builtin(
18491849
longest_adapter_read1)[2]
18501850
longest_adapter_read2_match = identify_sequence_builtin(

0 commit comments

Comments
 (0)