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 works for interactive report but breaks for flat report #2555

Open
4 tasks done
barslmn opened this issue May 13, 2024 · 0 comments
Open
4 tasks done

Comments

@barslmn
Copy link

barslmn commented May 13, 2024

Description of bug

I think problem is caused by giving the x as strings, but difference in the behavior seems like a bug. If this is an expected behavior I would need a way to indicate the x ticks to use the samplenames.

I have the following YAML file:

id: "xhet_section"
section_name: "X heterozygosity"
description: "This plot shows the fraction of heterozygous variants to total variants in X chromosome."
plot_type: "scatter"
pconfig:
  id: "Xhet_plot"
  title: "X heterozygosity plot"
  xlab: "samples"
  ylab: "Xhet"
data:
  150420-HG005-Homogeneity-01-Combined_S1: {x: 150420-HG005-Homogeneity-01-Combined_S1, y: 0.0126928}
  HG002-Run2_S1: {x: HG002-Run2_S1, y: 0.00921452}
  HG003Run03_S1: {x: HG003Run03_S1, y: 0.0128297}
  HG004run02_S1: {x: HG004run02_S1, y: 0.588197}
  NA24694-combined_S1: {x: NA24694-combined_S1, y: 0.00737769}
  NA24695-combined_S1: {x: NA24695-combined_S1, y: 0.532036}

The commands I am using:

  multiqc XhetRel --flat --force --fullnames --dirs --outdir XhetRel/ --filename multiqc_report_flat.html

  multiqc XhetRel --interactive --force --fullnames --dirs --outdir XhetRel/ --filename multiqc_report_interactive.html

Interactive one has the plot and completes without any errors:

/// MultiQC 🔍 | v1.21

| multiqc | Not cleaning sample names
| multiqc | Prepending directory to sample names
| multiqc | Search path : /content/XhetRel
| searching | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 67/67
| custom_content | xhet_section: Found 1 samples (scatter)
| bcftools | Found 13 stats reports
| relatedness2 | Found 1 valid relatedness2 matrices
| multiqc | Report : XhetRel/multiqc_report_interactive.html (overwritten)
| multiqc | Data : XhetRel/multiqc_report_interactive_data (overwritten)
| multiqc | MultiQC complete

Flat report gives an error and doesn't include the scatter plot. Output below.

File that triggers the error

Xhet_mqc.zip

MultiQC Error log

/// MultiQC 🔍 | v1.21

|           multiqc | Not cleaning sample names
|           multiqc | Prepending directory to sample names
|           multiqc | Search path : /content/XhetRel
|         searching | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 67/67  
╭─────────────────────── Oops! The 'custom_content' 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: XhetRel/Xhet_mqc.yaml     │
│                                                                                                  │
│ Traceback (most recent call last):                                                               │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/multiqc.py", line 751, in run            │
│     output = mod()                                                                               │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/modules/custom_content/custom_content.py │
│     parsed_modules[mod_id].add_cc_section(c_id, mod)                                             │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/modules/custom_content/custom_content.py │
│     plot = scatter.plot(mod["data"], pconfig)                                                    │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/plots/scatter.py", line 120, in plot     │
│     return scatter.plot(plotdata, pconfig)                                                       │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/plots/plotly/scatter.py", line 31, in pl │
│     return p.add_to_report(report)                                                               │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/plots/plotly/plot.py", line 248, in add_ │
│     html = self.flat_plot()                                                                      │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/plots/plotly/plot.py", line 298, in flat │
│     self._make_flat_fig(dataset),                                                                │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/plots/plotly/plot.py", line 426, in _mak │
│     return dataset.create_figure(layout, is_log, is_pct)                                         │
│   File "/usr/local/lib/python3.10/dist-packages/multiqc/plots/plotly/scatter.py", line 82, in cr │
│     x_std = np.std(x_values)                                                                     │
│   File "/usr/local/lib/python3.10/dist-packages/numpy/core/fromnumeric.py", line 3645, in std    │
│     return _methods._std(a, axis=axis, dtype=dtype, out=out, ddof=ddof,                          │
│   File "/usr/local/lib/python3.10/dist-packages/numpy/core/_methods.py", line 206, in _std       │
│     ret = _var(a, axis=axis, dtype=dtype, out=out, ddof=ddof,                                    │
│   File "/usr/local/lib/python3.10/dist-packages/numpy/core/_methods.py", line 152, in _var       │
│     arrmean = umr_sum(arr, axis, dtype, keepdims=True, where=where)                              │
│ numpy.core._exceptions._UFuncNoLoopError: ufunc 'add' did not contain a loop with signature matc │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
|          bcftools | Found 13 stats reports
|      relatedness2 | Found 1 valid relatedness2 matrices
|           multiqc | Report      : XhetRel/multiqc_report_flat.html   (overwritten)
|           multiqc | Data        : XhetRel/multiqc_report_flat_data   (overwritten)
|           multiqc | MultiQC complete

Before submitting

  • I have read the troubleshooting documentation.
  • I am using the latest release of MultiQC.
  • I have included a full MultiQC log, not truncated.
  • I have attached an input file (.zip if necessary) that triggers the error.
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

1 participant