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

Custom content being rendered as barplot even though table specified in config #1205

Closed
drpatelh opened this issue May 27, 2020 · 4 comments
Closed
Milestone

Comments

@drpatelh
Copy link
Contributor

Even though I am explicitly specifying plot_type: 'table' in my config file one of the tsv files is being added to the report as a bargraph. The rest of the config associated with that section seems to be rendered as defined except for the plot_type. Something is being overriden somewhere it seems but I cant put my finger on it.

[INFO   ]  custom_content : summary_variants_metrics: Found 2 samples (bargraph)
[INFO   ]  custom_content : summary_assembly_metrics: Found 2 samples (table)

I have attached a minimal test example to reproduce the error below:
test_multiqc.tar.gz

Tested on v1.9.dev0

@ewels ewels modified the milestones: MultiQC v1.10, MultiQC v1.9 May 29, 2020
@ewels ewels closed this as completed in 3f9be2a May 29, 2020
@ewels
Copy link
Member

ewels commented May 29, 2020

Ok, after a bit of fiddling I got to the bottom of this. There was some functionality essentially missing from MultiQC to allow you to configure _mqc.tsv files from the custom_data configuration, which I've addressed (I think it would have been fine if you'd put the config in the file headers?). There was also a bit of over-configuration going on.

Here's my working version of your config file:

report_comment: >
    This report has been generated by the <a href="https://github.com/nf-core/viralrecon" target="_blank">nf-core/viralrecon</a>
    analysis pipeline. For information about how to interpret these results, please see the
    <a href="https://github.com/nf-core/viralrecon" target="_blank">documentation</a>.

data_format: 'yaml'

run_modules:
    - custom_content

custom_data:
    summary_variants_metrics:
        section_name: 'Variant calling metrics'
        description: 'generated by the nf-core/viralrecon pipeline'
        plot_type: 'table'
        pconfig:
            id: 'summary_variants_metrics_plot'
            table_title: 'Variant calling metrics'
            namespace: 'Variant calling metrics'
    summary_assembly_metrics:
        section_name: 'De novo assembly metrics'
        description: 'generated by the nf-core/viralrecon pipeline'
        plot_type: 'table'
        pconfig:
            id: 'summary_assembly_metrics_plot'
            table_title: 'De novo assembly metrics'
            namespace: 'De novo assembly metrics'

Changes:

  • Removed the sp section - it wasn't needed as the filenames already end _mqc.tsv
  • Removed id and file_format as they are the same as the filename, so not needed
  • Changed the plot id so that it is unique and not the same as the section id
  • Added table_title for the nice table configuration modal windows
  • Removed path_filters as they weren't doing anything

I think that was it.. Good bug hunting though, thanks! Hopefully you'll have more luck with this now.

Phil

@drpatelh
Copy link
Contributor Author

Love it and it works now and thank you!

@ewels
Copy link
Member

ewels commented May 29, 2020

Ok, I just added a new table config option only_defined_headers so now you can override table wide defaults without losing the other columns. Your config above now looks like this:

custom_data:
    summary_variants_metrics:
        section_name: 'Variant calling metrics'
        description: 'generated by the nf-core/viralrecon pipeline'
        plot_type: 'table'
        pconfig:
            id: 'summary_variants_metrics_plot'
            table_title: 'Variant calling metrics'
            namespace: 'Variant calling metrics'
            format: '{:.0f}'
            only_defined_headers: false
        headers:
            '% Mapped reads (viral)':
                suffix: '%'
    summary_assembly_metrics:
        section_name: 'De novo assembly metrics'
        description: 'generated by the nf-core/viralrecon pipeline'
        plot_type: 'table'
        pconfig:
            id: 'summary_assembly_metrics_plot'
            table_title: 'De novo assembly metrics'
            namespace: 'De novo assembly metrics'
            format: '{:.0f}'

And your tables look like this:

image

(NB: % Mapped reads (viral) now has a percentage symbol suffix to each value).

ewels added a commit to MultiQC/test-data that referenced this issue May 29, 2020
@drpatelh
Copy link
Contributor Author

BOOOOOOMMMM!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants