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 HsMetrics module to show usable bases as percentages #1212

Closed
jamigo opened this issue May 31, 2020 · 1 comment
Closed

Picard HsMetrics module to show usable bases as percentages #1212

jamigo opened this issue May 31, 2020 · 1 comment
Labels
bug: core Bug in the main MultiQC code

Comments

@jamigo
Copy link

jamigo commented May 31, 2020

Description of bug:
PCT_USABLE_BASES_ON_BAIT and PCT_USABLE_BASES_ON_TARGET columns in Picard HsMetrics are being processed as bases rather than percentages by MultiQC.

MultiQC run details (please complete the following):

  • Command used to run MultiQC: multiqc .
  • MultiQC Version: MultiQC v1.9
  • Operating System: Red Hat Enterprise Linux 7.5
  • Python Version: Python 3.8.1
  • Method of MultiQC installation: manual

Additional context
The issue is understandable, since Picard descriptions on these columns are:
"The number of aligned, de-duped, on-bait bases out of the PF bases available."
"The number of aligned, de-duped, on-target bases out of the PF bases available."
although these columns report percentages (values from 0 to 1) rather than number of bases (as one may deduct from the PCT_ column name).
https://broadinstitute.github.io/picard/javadoc/picard/picard/analysis/directed/HsMetrics.html

What works from me
I've edited HsMetrics.py module as follows, in case you want to consider something similar. I've included a few lines after line 277 to detect those columns and manually change their content:

            elif h.find("BASES") > -1:
                if h.startswith("PCT_USABLE"):
                    headers[h]['title'] = headers[h]['title'].replace("Pct u", "U")
                    headers[h]['modify'] = lambda x: x * 100
                    headers[h]['max'] = 100
                    headers[h]['suffix'] = '%'
                    headers[h]['shared_key'] = 'percentage'
                else:
                    headers[h]['title'] = "{} {}".format(config.base_count_prefix, headers[h]['title'])
                    headers[h]['modify'] = lambda x: x * config.base_count_multiplier
                    headers[h]['shared_key'] = 'base_count'
@ewels ewels added the bug: core Bug in the main MultiQC code label Jun 1, 2020
@ewels ewels closed this as completed in a5168f8 Jun 1, 2020
@ewels
Copy link
Member

ewels commented Jun 1, 2020

Great spot, thanks @jamigo!

I did a bit of extra tidying whilst I was digging around with the code, so hopefully a few of the column titles should look nicer now too.

Fixed in v1.10dev.

Phil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: core Bug in the main MultiQC code
Projects
None yet
Development

No branches or pull requests

2 participants