Skip to content

Commit

Permalink
Don't crash if we don't have any data for the top-5 barplot
Browse files Browse the repository at this point in the history
Fixes #1540
  • Loading branch information
ewels committed Jan 7, 2023
1 parent 83793fb commit 5ddb3d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
- Don't crash for invalid JSON files ([#1652](https://github.com/ewels/MultiQC/issues/1652))
- **FastQC**
- Report median read-length for fastqc in addition to mean ([#1745](https://github.com/ewels/MultiQC/pull/1745))
- **Kaiju**
- Don't crash if we don't have any data for the top-5 barplot ([#1540](https://github.com/ewels/MultiQC/issues/1540))
- **Kallisto**
- Fix `ZeroDivisionError` when a sample has zero reads ([#1746](https://github.com/ewels/MultiQC/issues/1746))
- **Kraken**
Expand Down
6 changes: 5 additions & 1 deletion multiqc/modules/kaiju/kaiju.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def kaiju_stats_table(self):
"scale": "RdYlGn",
}
headers["assigned"] = {
"title": "{} Reads assigned".format(config.read_count_desc),
"title": "{} Reads assigned".format(config.read_count_prefix),
"description": "Number of reads assigned ({}) at {} rank".format(
config.read_count_desc, general_taxo_rank
),
Expand Down Expand Up @@ -273,6 +273,10 @@ def top_five_barplot(self):
cats.append(rank_cats)
pd.append(rank_data)

if len(cats) == 0:
log.debug("No data for Kaiju top five barplot. Skipping.")
return

self.add_section(
name="Top taxa",
anchor="kaiju-topfive",
Expand Down

0 comments on commit 5ddb3d5

Please sign in to comment.