-
Notifications
You must be signed in to change notification settings - Fork 602
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
Update fastqc.py #1725
Update fastqc.py #1725
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better, thanks 👍🏻 Just need to fix black code formatting again and add a changelog entry please.
multiqc/modules/fastqc/fastqc.py
Outdated
((100.0 - float(pd["total_deduplicated_percentage"])) / 100.0) * pd["Total Sequences"] | ||
) | ||
pdata[s_name]["Unique Reads"] = pd["Total Sequences"] - pdata[s_name]["Duplicate Reads"] | ||
has_dups = True | ||
except KeyError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit late now sorry, but this would have been a simpler fix 😉
except KeyError: | |
except (KeyError, ValueError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
Hmm, just tested on the example data you provided in #1724 and it does fix the $ multiqc -f .
/// MultiQC 🔍 | v1.13.dev0 (f358065)
| multiqc | Search path : /Users/ewels/GitHub/MultiQC/TestData/data/modules/fastqc/issue_1724
| searching | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1/1
| fastqc | Found 1 reports
╭───────────────────────────── 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: ./fastqc_data.txt │
│ │
│ Traceback (most recent call last): │
│ File "/Users/ewels/GitHub/MultiQC/MultiQC/multiqc/multiqc.py", line 654, in run │
│ output = mod() │
│ File "/Users/ewels/GitHub/MultiQC/MultiQC/multiqc/modules/fastqc/fastqc.py", line 121, in __init__ │
│ self.read_count_plot() │
│ File "/Users/ewels/GitHub/MultiQC/MultiQC/multiqc/modules/fastqc/fastqc.py", line 355, in read_coun │
│ plot=bargraph.plot(pdata, pcats, pconfig), │
│ File "/Users/ewels/GitHub/MultiQC/MultiQC/multiqc/plots/bargraph.py", line 104, in plot │
│ if type(cats[0]) is str or type(cats[0]) is unicode: │
│ IndexError: list index out of range │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯
| multiqc | No analysis results found. Cleaning up..
| multiqc | MultiQC complete This is why I always insist on having example data - very often it's a game of whack-a-mole with these kinds of errors 😄 |
Ok, turns out that my suggestion of simply catching the Thanks for reporting and tracking down the bug! |
CHANGELOG.md
has been updated--lint
flag)docs/README.md
is updated with link to belowdocs/modulename.md
is createdself.add_section
)