Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastQC KeyError for reports with zero reads #1533

Closed
ec-ho-ra-mos opened this issue Aug 18, 2021 · 4 comments · Fixed by #1535
Closed

FastQC KeyError for reports with zero reads #1533

ec-ho-ra-mos opened this issue Aug 18, 2021 · 4 comments · Fixed by #1535
Labels
bug: module Bug in a MultiQC module

Comments

@ec-ho-ra-mos
Copy link

ec-ho-ra-mos commented Aug 18, 2021

Description of bug

I am running MultiQC (from DockerHub) version 1.11. For some reason, I am getting the error "Sample had zero reads". Am I doing something wrong? My input files are 2 FastQC output folders (test run). Each output folder contains the following: icons and images for the 2 folders, and fastqc.fo, fastqc_data.txt, fastqc_report.html, and summary.txt for the files.

File that triggers the error

fastqc_data.txt

MultiQC Error log

My run commands are just:

multiqc <directory>

This is the error message:

/// MultiQC � | v1.11

| multiqc | Search path : 15_fastqc

| fastqc | Found 2 reports

| fastqc | Sample had zero reads: 'F1-1A_S1_R1_001'

| fastqc | Sample had zero reads: 'F1-1A_S1_R2_001'

╭───────────────── Oops! The 'fastqc' MultiQC module broke... ─────────────────╮

│ Please copy this log and report it at │

│ https://github.com/ewels/MultiQC/issues│

│ Please attach a file that triggers the error. The last file found was: 15_f │

│ astqc/F1-1A_S1_R2_001_fastqc/fastqc_data.txt │

│ │

│ Traceback (most recent call last): │

│ File "/usr/lib/python3.8/site-packages/multiqc/multiqc.py", line 624, in r │

│ output = mod() │

│ File "/usr/lib/python3.8/site-packages/multiqc/modules/fastqc/fastqc.py", │

│ self.sequence_content_plot() │

│ File "/usr/lib/python3.8/site-packages/multiqc/modules/fastqc/fastqc.py", │

│ for b in data[s_name]: │

│ KeyError: 'F1-1A_S1_R1_001' │

│ │

╰──────────────────────────────────────────────────────────────────────────────╯

| multiqc | No analysis results found. Cleaning up..

| multiqc | MultiQC complete
ErikDanielsson added a commit to ErikDanielsson/MultiQC_TestData that referenced this issue Aug 19, 2021
@ErikDanielsson ErikDanielsson mentioned this issue Aug 19, 2021
2 tasks
@ewels ewels added the bug: module Bug in a MultiQC module label Aug 25, 2021
@ewels ewels reopened this Aug 25, 2021
@ewels ewels changed the title How to use MultiQC? I am trying to run it to compile the summary from my FASTQC but I keep getting the "Sample has no read" error. FastQC KeyError for reports with zero reads Aug 25, 2021
@ewels
Copy link
Member

ewels commented Aug 25, 2021

Hi @ec-ho-ra-mos,

Thanks for opening this issue. The "Sample has no reads" error is what it sounds like - your FastQC report was generated for an empty FastQ file that has no reads. So there is nothing to generate QC for.

However, MultiQC should handle this gracefully without the python error traceback that you saw. @ErikDanielsson has spotted this error and opened #1535 to fix it, which I will review soon.

Thanks for reporting!

Phil

ewels added a commit to MultiQC/test-data that referenced this issue Nov 9, 2021
@ewels
Copy link
Member

ewels commented Nov 9, 2021

Hi @ec-ho-ra-mos,

Finally got to this PR to take a look. I owe you an apology - when I ran your supplied report it's clear that your sample did have reads. This was a nasty subtle bug where the read counts were being overwritten because MultiQC assumed some values would be there. I guess you ran FastQC with several sections skipped: those missing values were incorrectly interpreted as zero reads and a bunch of values overwritten with zeros.

Anyway, long story short - should now be fixed in #1535. Let me know how you get on with it.

Thanks for reporting!

Phil

@ec-ho-ra-mos
Copy link
Author

ec-ho-ra-mos commented Nov 9, 2021 via email

@ewels
Copy link
Member

ewels commented Nov 15, 2021

Ok great - well either way, you discovered a genuine bug even if it was an edge case :) MultiQC should now work properly with the old version of FastQC as well as the newer version.

vladsavelyev pushed a commit to vladsavelyev/MultiQC_TestData that referenced this issue Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: module Bug in a MultiQC module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants