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

bcftools: TypeError #2052

Closed
4 tasks done
ewels opened this issue Sep 18, 2023 · 2 comments · Fixed by #2056
Closed
4 tasks done

bcftools: TypeError #2052

ewels opened this issue Sep 18, 2023 · 2 comments · Fixed by #2056
Assignees
Labels
bug: module Bug in a MultiQC module

Comments

@ewels
Copy link
Member

ewels commented Sep 18, 2023

Description of bug

From Slack:


Hi, I am new to MultiQC. I am running testfull profile on nf-core Sarek pipeline v3.2.3. The whole pipeline (including MultiQC v1.14) worked well before, but I am recently encountering an issue. Is there any possible way to fix this? Sincerely thank you for your support!

File that triggers the error

HCC1395N.tiddit.bcftools_stats.txt

MultiQC Error log

Oops! The 'bcftools' MultiQC module broke... ────────────────╮
  │ Please copy this log and report it at                                        │
  │ https://github.com/ewels/MultiQC/issues                                      │
  │ Please attach a file that triggers the error. The last file found was:       │
  │ ./37/HCC1395N.tiddit.bcftools_stats.txt                                      │
  │                                                                              │
  │ Traceback (most recent call last):                                           │
  │   File "/usr/local/lib/python3.11/site-packages/multiqc/multiqc.py", line 65 │
  │     output = mod()                                                           │
  │              ^^^^^                                                           │
  │   File "/usr/local/lib/python3.11/site-packages/multiqc/modules/bcftools/bcf │
  │     n["stats"] = self.parse_bcftools_stats()                                 │
  │                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                 │
  │   File "/usr/local/lib/python3.11/site-packages/multiqc/modules/bcftools/sta │
  │     self.add_data_source(f, s_name, section="stats")                         │
  │   File "/usr/local/lib/python3.11/site-packages/multiqc/modules/base_module. │
  │     source = os.path.abspath(os.path.join(f["root"], f["fn"]))               │
  │                                           ~^^^^^^^^                          │
  │ TypeError: string indices must be integers, not 'str'

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.
@ewels ewels added the bug: module Bug in a MultiQC module label Sep 18, 2023
@vladsavelyev
Copy link
Member

vladsavelyev commented Sep 19, 2023

That's the result of a funny combination of a potential bug in the module, and two bcftools outputs seemingly merged into one file (for HCC1395T_vs_HCC1395N.strelka.somatic_indels.vcf.gz and HCC1395T_vs_HCC1395N.manta.somatic_sv.vcf.gz):

# This file was produced by bcftools stats (1.17+htslib-1.17) and can be plotted using plot-vcfstats.
# The command line was:	bcftools stats  HCC1395T_vs_HCC1395N.strelka.somatic_indels.vcf.gz
#
# Definition of sets:
# ID	[2]id	[3]tab-separated file names
ID	0	HCC1395T_vs_HCC1395N.strelka.somatic_indels.vcf.gz
<...>
# DP	[2]id	[3]bin	[4]number of genotypes	[5]fraction of genotypes (%)	[6]number of sites	[7]fraction of sites (%)

# This file was produced by bcftools stats (1.17+htslib-1.17) and can be plotted using plot-vcfstats.
# The command line was:	bcftools stats  HCC1395T_vs_HCC1395N.manta.somatic_sv.vcf.gz
#
# Definition of sets:
# ID	[2]id	[3]tab-separated file names
ID	0	HCC1395T_vs_HCC1395N.manta.somatic_sv.vcf.gz
<...>

I wonder if it's an expected behaviour? Need to look more into Sarek.

@vladsavelyev
Copy link
Member

Ah, figured it's an expected behaviour for bcftools, as I can take multiple VCFs. And the module already supports it, though with a bug. I'll add a fix now and will add the example into the test data.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants