Skip to content

Commit

Permalink
Samtools: Stats: fix "Percent Mapped" plot when samtools was run with…
Browse files Browse the repository at this point in the history
… read filtering (#1972)

* Update stats.py

fix for #1971

* Update CHANGELOG.md

* Update stats.py

forgot an underspace...

---------

Co-authored-by: Vlad Savelyev <vladislav.sav@gmail.com>
  • Loading branch information
lindenb and vladsavelyev committed Aug 24, 2023
1 parent fe1fbb6 commit 965fbc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- Fix a bug happening when both `region` and `global` coverage histograms for a sample are available (i.e. when mosdepth was run with `--by`, see [mosdepth docs](https://github.com/brentp/mosdepth#usage)). In this case, data was effectively merged. Instead, summarise it separately and add a separate report section for the region-based coverage data.
- **RSeQC**
- Fix "max() arg is an empty sequence" error ([#1985](https://github.com/ewels/MultiQC/issues/1985))
- **Samtools**
- Stats: fix "Percent Mapped" plot when samtools was run with read filtering ([#1971](https://github.com/ewels/MultiQC/issues/1971))

## [MultiQC v1.15](https://github.com/ewels/MultiQC/releases/tag/v1.15) - 2023-08-04

Expand Down
2 changes: 1 addition & 1 deletion multiqc/modules/samtools/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def alignment_section(self, samples_data):
bedgraph_data = {}
for sample_id, data in samples_data.items():
expected_total = data["raw_total_sequences"]
read_sum = data["reads_mapped"] + data["reads_unmapped"]
read_sum = data["reads_mapped"] + data["reads_unmapped"] + data["filtered_sequences"]
if read_sum == expected_total:
bedgraph_data[sample_id] = data
else:
Expand Down

0 comments on commit 965fbc0

Please sign in to comment.