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

Whatshap: robust to stdout appended to TSV #2360

Closed
maurya-anand opened this issue Feb 21, 2024 · 3 comments
Closed

Whatshap: robust to stdout appended to TSV #2360

maurya-anand opened this issue Feb 21, 2024 · 3 comments
Labels
waiting: response Waiting for more information from user

Comments

@maurya-anand
Copy link

HG002_variant_phasing.tsv.zip

──────── Oops! The 'whatshap' MultiQC module broke...────────
Please copy this log and report it at https://github.com/MultiQC/MultiQC/issues
Please attach a file that triggers the error. The last file found was: 04_phaseVars/HG002_variant_phasing.tsv

Traceback (most recent call last):
File "/home/anand/miniforge3/envs/multiqc/lib/python3.11/site-packages/multiqc/multiqc.py", line 712, in run
output = mod()
^^^^^
File "/home/anand/miniforge3/envs/multiqc/lib/python3.11/site-packages/multiqc/modules/whatshap/whatshap.py", line 40, in init
sample, data = self.parse_whatshap_stats(f)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anand/miniforge3/envs/multiqc/lib/python3.11/site-packages/multiqc/modules/whatshap/whatshap.py", line 109, in parse_whatshap_stats
chromosome = data.pop("chromosome")
^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'chromosome'

@vladsavelyev
Copy link
Member

vladsavelyev commented Feb 21, 2024

Thank you @maurya-anand for submitting the issue!

I looked into that, and turns out, the MultiQC module didn't expect the "Phasing statistics for sample HG002 from file" section below the table. I wonder if it was appended later to the file. I'm looking into the whatshap code and it looks like it would write the TSV contents to --tsv, and the rest it would write to stdout. So I'm wondering how the two outputs got mixed up. Perhaps --tsv can take stdout as an argument?

Would you be able to give some detail about the version of whatshap, and how exactly it was called to generate the output? That would help us adjust the module properly.

Thank you and sorry about the issue!

@vladsavelyev vladsavelyev added bug: module Bug in a MultiQC module waiting: response Waiting for more information from user labels Feb 21, 2024
@maurya-anand
Copy link
Author

Thank you very much, @vladsavelyev for the clarification. I made a mistake by appending the stdout to the same file.

Cheers!

@vladsavelyev vladsavelyev removed the bug: module Bug in a MultiQC module label Feb 21, 2024
@vladsavelyev vladsavelyev changed the title whatshap module - KeyError Whatshap: robust to stdout appended to TSV Feb 21, 2024
@vladsavelyev
Copy link
Member

No problem @maurya-anand! I just made the module robust to this kind of situation, so your issue was helpful anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting: response Waiting for more information from user
Projects
None yet
Development

No branches or pull requests

2 participants