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

sentieon module doesn't handle "total_pairs" being 0 #1420

Closed
Jessime opened this issue Apr 29, 2021 · 3 comments · Fixed by #1467
Closed

sentieon module doesn't handle "total_pairs" being 0 #1420

Jessime opened this issue Apr 29, 2021 · 3 comments · Fixed by #1467
Assignees
Labels
bug: module Bug in a MultiQC module waiting: example data Needs example data before we can proceed

Comments

@Jessime
Copy link

Jessime commented Apr 29, 2021

Description of bug:

The title pretty much says it all. We sometimes have samples with 0 reads, which multiqc doesn't handle gracefully.

MultiQC Error log:

[ERROR  ]         multiqc : Oops! The 'sentieon' 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:
    ./SQ42003/sentieon/SQ42003_insert_size_metrics.txt
============================================================
Module sentieon raised an exception: Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/multiqc/multiqc.py", line 594, in run
    output = mod()
  File "/usr/local/lib/python3.8/site-packages/multiqc/modules/sentieon/sentieon.py", line 52, in __init__
    n["InsertSizeMetrics"] = InsertSizeMetrics.parse_reports(self)
  File "/usr/local/lib/python3.8/site-packages/multiqc/modules/sentieon/InsertSizeMetrics.py", line 110, in parse_reports
    self.sentieon_insertSize_samplestats[s_name]["summed_mean"] = v["meansum"] / v["total_pairs"]
ZeroDivisionError: division by zero

File that triggers the error:

#SentieonCommandLine: /locus/data/external_data/research_experiments/wgs_resources/bin/sentieon/sentieon_current/libexec/driver -i SQ42027/SQ42027_aligned.deduped.sort.bam -r /locus/data/external_data/research_experiments/wgs_resources/data/reference/human/human_g1k_v37_modified.fasta/human_g1k_v37_modified.fasta --algo InsertSizeMetricAlgo SQ42027/sentieon/SQ42027_insert_size_metrics.txt
MEDIAN_INSERT_SIZE      MEDIAN_ABSOLUTE_DEVIATION       MIN_INSERT_SIZE MAX_INSERT_SIZE MEAN_INSERT_SIZE        STANDARD_DEVIATION      READ_PAIRS      PAIR_ORIENTATION        WIDTH_OF_10_PERCENT     WIDTH_OF_20_PERCENT     WIDTH_OF_30_PERCENT     WIDTH_OF_40_PERCENT     WIDTH_OF_50_PERCENT     WIDTH_OF_60_PERCENT     WIDTH_OF_70_PERCENT     WIDTH_OF_80_PERCENT     WIDTH_OF_90_PERCENT     WIDTH_OF_99_PERCENT

insert_size

MultiQC run details (please complete the following):

  • Command used to run MultiQC: multiqc .
  • MultiQC Version: multiqc, version 1.10.1
  • Operating System: singularity
  • Python Version: Python 3.8.9
  • Method of MultiQC installation: pip

Additional context

I'm not sure if multiqc has standard policies around representing null values. But it seems easy enough to add a quick check and set to something like np.nan if v["total_pairs"] == 0

@ewels ewels added the bug: module Bug in a MultiQC module label Apr 30, 2021
@ewels
Copy link
Member

ewels commented Apr 30, 2021

Thanks for reporting!

Null values can be a little tricky as they have to work with downstream JavaScript code, so stuff like np.nan can be tricky (honestly, I can't remember if that one works or not). My gut feeling is that None should work, but I'd need to try again to be sure. And I prefer to catch the ZeroDivisionError rather than testing for 0 reads generally.

Side note - if you can attach files instead of pasting contents in the future that would be great, as the copy+paste can mangle whitespace sometimes which can be important for parsing (can zip files if the extension is rejected by GitHub).

@ewels
Copy link
Member

ewels commented Apr 30, 2021

Yeah, I get a different error with your file (ValueError: 'PAIR_ORIENTATION' is not in list) which I guess is because it's missing tabs. Is it easy for you to attach the raw zipped file please?

@ewels ewels added the waiting: example data Needs example data before we can proceed label Jun 15, 2021
@ewels
Copy link
Member

ewels commented Jun 15, 2021

@Jessime - please can you attach the original file that triggers this error so that I can replicate it?

Thanks!

ErikDanielsson added a commit to ErikDanielsson/MultiQC_TestData that referenced this issue Jun 29, 2021
ewels added a commit to MultiQC/test-data that referenced this issue Jun 29, 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 waiting: example data Needs example data before we can proceed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants