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

TypeError with Table #1091

Closed
whottel opened this issue Jan 7, 2020 · 2 comments
Closed

TypeError with Table #1091

whottel opened this issue Jan 7, 2020 · 2 comments
Labels
bug: core Bug in the main MultiQC code
Milestone

Comments

@whottel
Copy link

whottel commented Jan 7, 2020

Description of bug:
Get TypeError when sample names are heterogeneous when visualizing results in a table. For example two samples named 123 and 456-abc.

MultiQC Error log:

Module custom_content raised an exception: Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/multiqc-1.8.dev0-py3.6.egg/EGG-INFO/scripts/multiqc", line 440, in multiqc
    output = mod()
  File "/usr/lib/python3.6/site-packages/multiqc-1.8.dev0-py3.6.egg/multiqc/modules/custom_content/custom_content.py", line 226, in custom_module_classes
    parsed_modules.append( MultiqcModule(module_id, mod) )
  File "/usr/lib/python3.6/site-packages/multiqc-1.8.dev0-py3.6.egg/multiqc/modules/custom_content/custom_content.py", line 272, in __init__
    self.write_data_file( mod['data'], "multiqc_{}".format(modname.lower().replace(' ', '_')) )
  File "/usr/lib/python3.6/site-packages/multiqc-1.8.dev0-py3.6.egg/multiqc/modules/base_module.py", line 332, in write_data_file
    util_functions.write_data_file(data, fn, sort_cols, data_format)
  File "/usr/lib/python3.6/site-packages/multiqc-1.8.dev0-py3.6.egg/multiqc/utils/util_functions.py", line 78, in write_data_file
    for sn in sorted(data.keys()):
TypeError: '<' not supported between instances of 'str' and 'float'

File that triggers the error:
#contrived example, but should replicate error
example.txt

MultiQC run details (please complete the following):
Using singularity for docker image of multiqc found here https://hub.docker.com/r/staphb/multiqc
Run on HPC cluster running CentOS Linux

Additional note
Issue seems to be unique to table as using other formats, such as bargraph does not produce this error with the same sample names.
Also error resolved if first name changed to 123-abc

@ewels ewels added the bug: core Bug in the main MultiQC code label Mar 29, 2020
@ewels ewels added this to the MultiQC v1.9 milestone Mar 29, 2020
@ewels
Copy link
Member

ewels commented Mar 29, 2020

Thanks for reporting this @whottel - looks like I'm being a bit too clever with casting variable types in the code somewhere. Should be fixable by forcing strings for the sort step. I'll look into it when I get a chance 👍

Phil

@ewels ewels closed this as completed in 3195bc9 May 26, 2020
ewels added a commit to MultiQC/test-data that referenced this issue May 26, 2020
@ewels
Copy link
Member

ewels commented May 26, 2020

Fixed, will go out in v1.9 shortly. Thanks for reporting! Let me know if you spot any problems with it still.

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