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

UnboundLocalError sorted_pct in kraken module #1877

Closed
4 tasks done
Midnighter opened this issue Mar 8, 2023 · 1 comment · Fixed by #2230
Closed
4 tasks done

UnboundLocalError sorted_pct in kraken module #1877

Midnighter opened this issue Mar 8, 2023 · 1 comment · Fixed by #2230
Labels
bug: module Bug in a MultiQC module

Comments

@Midnighter
Copy link

Description of bug

The kraken module fails with the below error. I think it's because the taxonomic ranks in my file are U, R, R1-7 rather than the typical U, R, P, C, etc.

File that triggers the error

kraken2.report.txt

MultiQC Error log

multiqc kraken2.report.txt                                                                                                                                                               ─╯

  /// MultiQC 🔍 | v1.14

|           multiqc | Search path : /tmp/kraken2.report.txt
|         searching | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 1/1
|            kraken | Found 1 reports
╭────────────────────────────────────────────────────────── Oops! The 'kraken' 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: kraken2.report.txt                                                                       │
│                                                                                                                                                                 │
│ Traceback (most recent call last):                                                                                                                              │
│   File "/home/moritz/.local/share/mambaforge/envs/tax/lib/python3.11/site-packages/multiqc/multiqc.py", line 654, in run                                        │
│     output = mod()                                                                                                                                              │
│              ^^^^^                                                                                                                                              │
│   File "/home/moritz/.local/share/mambaforge/envs/tax/lib/python3.11/site-packages/multiqc/modules/kraken/kraken.py", line 77, in __init__                      │
│     self.top_five_duplication_heatmap()                                                                                                                         │
│   File "/home/moritz/.local/share/mambaforge/envs/tax/lib/python3.11/site-packages/multiqc/modules/kraken/kraken.py", line 445, in top_five_duplication_heatmap │
│     for classif, pct_sum in sorted_pct:                                                                                                                         │
│                             ^^^^^^^^^^                                                                                                                          │
│ UnboundLocalError: cannot access local variable 'sorted_pct' where it is not associated with a value                                                            │
│                                                                                                                                                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|           multiqc | No analysis results found. Cleaning up..
|           multiqc | MultiQC complete

Before submitting

  • I have read the troubleshooting documentation.
  • I am using the latest release of MultiQC.
  • I have included a full MultiQC log, not truncated.
  • I have attached an input file (.zip if necessary) that triggers the error.
@ewels ewels added the bug: module Bug in a MultiQC module label Mar 22, 2023
@vladsavelyev
Copy link
Member

Sorry about this issue and it took so long to resolve!

Should be fixed now with #2230

@vladsavelyev vladsavelyev added this to the MultiQC v1.19 milestone Dec 14, 2023
vladsavelyev added a commit to MultiQC/test-data that referenced this issue Dec 14, 2023
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.

3 participants