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

Issue with parsing fastp json file #1652

Closed
danfulop opened this issue Mar 21, 2022 · 1 comment
Closed

Issue with parsing fastp json file #1652

danfulop opened this issue Mar 21, 2022 · 1 comment
Labels
bug: module Bug in a MultiQC module

Comments

@danfulop
Copy link

danfulop commented Mar 21, 2022

Description of bug

I got this error regarding fastp's JSON file:

File that triggers the error

5fastp.json.zip

MultiQC Error log

/// MultiQC 🔍 | v1.12

  |           multiqc | Search path : /home/ubuntu/git.repos/pipeline-bacteria-rnaseq/work/8e/cd577ca94335fa95c4214d9b2d4307
  |             rseqc | Found 3 read_distribution reports
  |             rseqc | Found 3 gene_body_coverage reports
  |             rseqc | Found 3 inner_distance reports
  |             rseqc | Found 3 read_gc reports
  |             rseqc | Found 3 read_duplication reports
  |             rseqc | Found 3 infer_experiment reports
  |             rseqc | Found 3 bam_stat reports
  |            salmon | Found 3 fragment length distributions
  |              star | Found 6 reports
  ╭────────────────────────────────────────────────────── Oops! The 'fastp' 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: ./fastp/5fastp.json                                                             │
  │                                                                                                                                                        │
  │ Traceback (most recent call last):                                                                                                                     │
  │   File "/home/ubuntu/miniconda3/envs/pipeline-salmon-rna-seq/lib/python3.9/site-packages/multiqc/multiqc.py", line 651, in run                         │
  │     output = mod()                                                                                                                                     │
  │   File "/home/ubuntu/miniconda3/envs/pipeline-salmon-rna-seq/lib/python3.9/site-packages/multiqc/modules/fastp/fastp.py", line 48, in __init__         │
  │     self.parse_fastp_log(f)                                                                                                                            │
  │   File "/home/ubuntu/miniconda3/envs/pipeline-salmon-rna-seq/lib/python3.9/site-packages/multiqc/modules/fastp/fastp.py", line 162, in parse_fastp_log │
  │     cmd = parsed_json["command"].split()                                                                                                               │
  │ TypeError: 'int' object is not subscriptable                                                                                                           │
  │                                                                                                                                                        │
  ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
  |           multiqc | Compressing plot data
  |           multiqc | Report      : multiqc_report.html
  |           multiqc | Data        : multiqc_data
  |           multiqc | MultiQC complete
@ewels ewels added the bug: module Bug in a MultiQC module label Apr 4, 2022
ewels added a commit to MultiQC/test-data that referenced this issue Jan 7, 2023
@ewels ewels closed this as completed in 66ef069 Jan 7, 2023
@ewels
Copy link
Member

ewels commented Jan 7, 2023

Thanks @danfulop!

The reason that MultiQC wasn't working is because your JSON file is not what MultiQC (or, I guess, you) is expecting:

30596

This is technically valid JSON, so the existing check that the JSON file can be parsed went through ok. However, as soon as the code tried to load anything in the file it crashed.

I've updated MultiQC to check that at least one expected key is present. Now instead of a hard crash you get an error message that the log file could not be parsed.

Thanks!

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

No branches or pull requests

2 participants