cruizperez / MicrobeAnnotator

Pipeline for metabolic annotation of microbial genomes
Artistic License 2.0
139 stars 27 forks source link

Error with qt #11

Closed sarah872 closed 3 years ago

sarah872 commented 3 years ago

Hi, I am running MicrobeAnnotator but encountered the following error:

---- This is MicrobeAnnotator ----
I will process a total of 1 files. Of these, I will run 1 in parallel with 7 threads per file.
For this run I will use KOFamscan and the Swissprot database to annotate your proteins.
When I'm done I will plot the metabolism summaries using metabolic_summary_ as file name prefix using no clustering.
---------

Restarting from last checkpoint
2
The light run of MicrobeAnnotator had finished succesfully!
Summarizing those results...
Extracting ko numbers and summarizing results...
Importing data... Done!
Mapping entries... Done!

Creating output_file matrix and heatmap...
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted

UPDATE: When I run export QT_QPA_PLATFORM=offscreen, I get another one:

Creating output_file matrix and heatmap...
Traceback (most recent call last):
  File "06_MicrobeAnnotator/microbeannotator.py", line 735, in <module>
    main()
  File "06_MicrobeAnnotator/microbeannotator.py", line 729, in main
    metabolism_matrix_dropped_relabel, module_colors = ko_mapper.create_output_files(metabolic_annotation, metabolism_matrix, module_information, cluster, prefix)
  File "/scratch/06_MicrobeAnnotator/independent_scripts/ko_mapper.py", line 566, in create_output_files
    cbar_kws= {'orientation': 'horizontal', 'label': 'Module Completeness (%)'}, dendrogram_ratio=0.1)
  File "/home/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 1301, in clustermap
    **kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 1139, in plot
    self.plot_matrix(colorbar_kws, xind, yind, **kws)
  File "/home/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 1114, in plot_matrix
    xticklabels=xtl, yticklabels=ytl, **kws)
  File "/home/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 528, in heatmap
    plotter.plot(ax, cbar_ax, kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 284, in plot
    cmap=self.cmap, **kws)
  File "/home/py3-venv/lib/python3.7/site-packages/matplotlib/__init__.py", line 1447, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 6103, in pcolormesh
    **kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/matplotlib/collections.py", line 1919, in __init__
    Collection.__init__(self, **kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/matplotlib/collections.py", line 213, in __init__
    self.update(kwargs)
  File "/home/py3-venv/lib/python3.7/site-packages/matplotlib/artist.py", line 996, in update
    raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'QuadMesh' object has no property 'cbar_pos'

Looks like an incompatibility with my current matplotlib... which version do you suggest to use?

cruizperez commented 3 years ago

Which version do you have?

sarah872 commented 3 years ago

matplotlib-3.4.1

cruizperez commented 3 years ago

I am using the same version and it seems to be working fine for me. Could you send me the output of conda list so I can compare package versions?

cruizperez commented 3 years ago

Could you also try installing the latest version of the tool? v2.0.5?

sarah872 commented 3 years ago

There are some neat but major upgrades to 2.05 so I will have to re-do the database, apparently. Thank you for your support, I will get back to you as soon as it has finished!

cruizperez commented 3 years ago

Yes! It is no longer using kofamscan so it needs to build that part of the database. If you built the full database you might be able to run only steps 1 and 2 to avoid downloading swissprot and the rest. If you built the 'light' version it should be quick either way.

sarah872 commented 3 years ago

database creation finished, but the AttributeError still persists:

2021-05-01 07:53:21,146 [INFO]:  ---- This is MicrobeAnnotator v2.0.5 ----
2021-05-01 07:53:21,147 [INFO]: Validating user inputs
2021-05-01 07:53:21,149 [INFO]: Passed
2021-05-01 07:53:21,150 [INFO]: Processing 1 files. I will run 1 files in parallel with 8 threads per file.
2021-05-01 07:53:22,047 [INFO]: Searching proteins against KOfam profiles
2021-05-01 07:53:22,048 [INFO]: Parsing HMM profile metadata
2021-05-01 07:56:08,008 [INFO]: Filtering and saving results...
2021-05-01 07:56:08,090 [INFO]: Search against KOfam done!
2021-05-01 07:56:08,345 [INFO]: Searching proteins against Swissprot
2021-05-01 07:56:22,589 [INFO]: Extracting Swissprot annotation data
2021-05-01 07:56:24,936 [INFO]: Searching proteins against RefSeq
2021-05-01 08:15:33,229 [INFO]: Extracting RefSeq annotation data
2021-05-01 08:15:42,447 [INFO]: Searching proteins against Trembl
2021-05-01 08:40:28,725 [INFO]: Extracting Trembl annotation data
2021-05-01 08:40:28,867 [INFO]: Extracting ko numbers and summarizing results
Importing data... Finished
Mapping entries... Finished

Creating output_file matrix and heatmap...
Traceback (most recent call last):
  File "/home/user/py3-venv/bin/microbeannotator", line 981, in <module>
    main()
  File "/home/user/py3-venv/bin/microbeannotator", line 971, in main
    metabolism_matrix_dropped_relabel, module_colors = ko_mapper.create_output_files(metabolic_annotation, metabolism_matrix, module_information, cluster, prefix)
  File "/home/user/py3-venv/lib/python3.7/site-packages/microbeannotator/pipeline/ko_mapper.py", line 568, in create_output_files
    cbar_kws= {'orientation': 'horizontal', 'label': 'Module Completeness (%)'}, dendrogram_ratio=0.1)
  File "/home/user/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 1301, in clustermap
    **kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 1139, in plot
    self.plot_matrix(colorbar_kws, xind, yind, **kws)
  File "/home/user/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 1114, in plot_matrix
    xticklabels=xtl, yticklabels=ytl, **kws)
  File "/home/user/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 528, in heatmap
    plotter.plot(ax, cbar_ax, kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/seaborn/matrix.py", line 284, in plot
    cmap=self.cmap, **kws)
  File "/home/user/py3-venv/lib/python3.7/site-packages/matplotlib/__init__.py", line 1352, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 6173, in pcolormesh
    **kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/matplotlib/collections.py", line 1996, in __init__
    super().__init__(**kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/matplotlib/_api/deprecation.py", line 431, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/matplotlib/collections.py", line 217, in __init__
    self.update(kwargs)
  File "/home/user/py3-venv/lib/python3.7/site-packages/matplotlib/artist.py", line 1062, in update
    raise AttributeError(f"{type(self).__name__!r} object "
AttributeError: 'QuadMesh' object has no property 'cbar_pos'

Also, some pickle files that come with MicrobeAnnotator couldn't be found at my install location. I could easily resolve this by manually coping them. I installed the software with git clone https://github.com/cruizperez/MicrobeAnnotator && cd MicrobeAnnotator && pip install .

2021-04-30 17:43:57,548 [INFO]: Extracting ko numbers and summarizing results
Importing data... Traceback (most recent call last):
  File "/home/user/py3-venv/bin/microbeannotator", line 981, in <module>
    main()
  File "/home/user/py3-venv/bin/microbeannotator", line 969, in main
    module_information, metabolism_matrix, module_group_matrix = ko_mapper.module_information_importer(annotation_files)
  File "/home/user/py3-venv/lib/python3.7/site-packages/microbeannotator/pipeline/ko_mapper.py", line 93, in module_information_importer
    regular_modules = import_module_dict(data_folder / "01.KEGG_Regular_Module_Information.pickle")
  File "/home/user/py3-venv/lib/python3.7/site-packages/microbeannotator/pipeline/ko_mapper.py", line 83, in import_module_dict
    pickle_in = open(dictionary_location,"rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/py3-venv/lib/python3.7/site-packages/microbeannotator/data/01.KEGG_Regular_Module_Information.pickle'
cruizperez commented 3 years ago

Hi @sarah872! Thanks for testing again, would you mind sending me the output of conda list to see the whole list of packages you are using and also your OS?

sarah872 commented 3 years ago

Good news: It ran without throwing an error with the conda installation. There just seems to be something wrong with the pip install. Thanks for your help!