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

picard hs_metrics: Handle null (0 int) values #1296

Closed
tomSimonet opened this issue Sep 18, 2020 · 2 comments
Closed

picard hs_metrics: Handle null (0 int) values #1296

tomSimonet opened this issue Sep 18, 2020 · 2 comments
Assignees
Labels
bug: module Bug in a MultiQC module

Comments

@tomSimonet
Copy link

tomSimonet commented Sep 18, 2020

Hello,

just a really minor issue: the picard module broke, analysing hs_metrics, when one metric file was produced from a failed sequencing, with a lot of null values;
I think the probkem may come from a ? value in the FOLD_80_BASE_PENALTY field, which could not be computed in this case

with the hs_metrics file from the failed sequencing :

$ python3 -m multiqc -o Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23 Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23/
[INFO   ]         multiqc : This is MultiQC v1.9
[INFO   ]         multiqc : Template    : default
[INFO   ]         multiqc : Searching   : /home/thomas/Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23
Searching 5 files..  [####################################]  100%          
[ERROR  ]         multiqc : Oops! The 'picard' MultiQC module broke... 
  Please copy the following traceback and report it at https://github.com/ewels/MultiQC/issues 
  If possible, please include a log file that triggers the error - the last file found was:
    Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23/Z338_umiFlt_hs_metric.txt
============================================================
Module picard raised an exception: Traceback (most recent call last):
  File "/home/thomas/progr/Anaconda/lib/python3.6/site-packages/multiqc/multiqc.py", line 569, in run
    output = mod()
  File "/home/thomas/progr/Anaconda/lib/python3.6/site-packages/multiqc/modules/picard/picard.py", line 65, in __init__
    n['HsMetrics'] = HsMetrics.parse_reports(self)
  File "/home/thomas/progr/Anaconda/lib/python3.6/site-packages/multiqc/modules/picard/HsMetrics.py", line 182, in parse_reports
    plot = table.plot(data, _get_table_headers(data))
  File "/home/thomas/progr/Anaconda/lib/python3.6/site-packages/multiqc/plots/table.py", line 49, in plot
    return make_table ( dt )
  File "/home/thomas/progr/Anaconda/lib/python3.6/site-packages/multiqc/plots/table.py", line 139, in make_table
    val = header['modify'](val)
  File "/home/thomas/progr/Anaconda/lib/python3.6/site-packages/multiqc/modules/picard/HsMetrics.py", line 279, in <lambda>
    headers[h]['modify'] = lambda x: x * config.base_count_multiplier
TypeError: can't multiply sequence by non-int of type 'float'
============================================================
[WARNING]         multiqc : No analysis results found. Cleaning up..
[INFO   ]         multiqc : MultiQC complete`

after removing this null-values containing hs_metrics file from the directory:

$ python3 -m multiqc -o Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23 Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23/
[INFO   ]         multiqc : This is MultiQC v1.9
[INFO   ]         multiqc : Template    : default
[INFO   ]         multiqc : Searching   : /home/thomas/Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23
Searching 4 files..  [####################################]  100%          
[INFO   ]          picard : Found 4 HsMetrics reports
[INFO   ]         multiqc : Compressing plot data
[INFO   ]         multiqc : Report      : Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23/multiqc_report.html
[INFO   ]         multiqc : Data        : Bureau/MBarito/Qiaseq-Multimodal/DNA/umi_Flt_bam/hs_metrics_v2.23/multiqc_data
[INFO   ]         multiqc : MultiQC complete`

Example outputs:

E10981_umiFlt_hs_metric.txt
E11642_umiFlt_hs_metric.txt

@ewels ewels added the bug: module Bug in a MultiQC module label Dec 28, 2020
@ewels
Copy link
Member

ewels commented Dec 28, 2020

Thanks for reporting this and supplying example data @tomSimonet - should be simple enough to fix 👍🏻

@ewels ewels changed the title picard hs_metrics module broke if not float value? picard hs_metrics: Handle null (0 int) values Dec 28, 2020
ErikDanielsson added a commit to ErikDanielsson/MultiQC_TestData that referenced this issue Jun 30, 2021
ewels added a commit to MultiQC/test-data that referenced this issue Jun 30, 2021
@ewels
Copy link
Member

ewels commented Jun 30, 2021

Fixed in #1471 by @ErikDanielsson, will be including in the upcoming v1.11 release.

Thanks for reporting @tomSimonet - shout if any part of it doesn't work how you expect :)

@ewels ewels closed this as completed Jun 30, 2021
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

No branches or pull requests

3 participants