ratschlab/spladder

seaborn not found

Closed this issue · 3 comments

  • spladder version: 3.0.4
  • Python version: 3.10
  • Operating System: Linux

Description

Trying to use spladder to work on bam files

What I Did

(base) lab_anjohnson@anjohnson-pve-linux:/home/databench/spladder$ spladder build -o output_directory -b bam_file -a /home/databench/Rami_BulkRNA/Drosophila_melanogaster.BDGP6.32.109_UCSC.gtf.g
Traceback (most recent call last):
File "/home/lab_anjohnson/miniconda3/lib/python3.10/site-packages/matplotlib/style/core.py", line 137, in use
style = _rc_params_in_file(style)
File "/home/lab_anjohnson/miniconda3/lib/python3.10/site-packages/matplotlib/init.py", line 866, in _rc_params_in_file
with _open_file_or_url(fname) as fd:
File "/home/lab_anjohnson/miniconda3/lib/python3.10/contextlib.py", line 135, in enter
return next(self.gen)
File "/home/lab_anjohnson/miniconda3/lib/python3.10/site-packages/matplotlib/init.py", line 843, in _open_file_or_url
with open(fname, encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'seaborn'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/lab_anjohnson/miniconda3/bin/spladder", line 33, in
sys.exit(load_entry_point('spladder==3.0.4', 'console_scripts', 'spladder')())
File "/home/lab_anjohnson/miniconda3/bin/spladder", line 25, in importlib_load_entry_point
return next(matches).load()
File "/home/lab_anjohnson/miniconda3/lib/python3.10/importlib/metadata/init.py", line 171, in load
module = import_module(match.group('module'))
File "/home/lab_anjohnson/miniconda3/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/lab_anjohnson/miniconda3/lib/python3.10/site-packages/spladder/spladder.py", line 9, in
from .spladder_viz import spladder_viz
File "/home/lab_anjohnson/miniconda3/lib/python3.10/site-packages/spladder/spladder_viz.py", line 8, in
plt.style.use('seaborn')
File "/home/lab_anjohnson/miniconda3/lib/python3.10/site-packages/matplotlib/style/core.py", line 139, in use
raise OSError(
OSError: 'seaborn' is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in style.available)

how to I fix the seaborn issue? I did test seaborn on python and it worked.

Hey It seems like the issue is caused by spladder using a deprecated matplotlib style "seaborn". I managed to fix this issue by changing line 9 of spladder/spladder_viz.py to
plt.style.use('seaborn-v0_8')
Hope this does't screw up anything, I havent really used the package so far

It's possible that this issue is related to the Python version. You may need to reinstall Seaborn in a Python 3.8 environment and then run Spladder.

Thanks for reporting this and thanks to @Kartoffelecke for the correct suggestion. I have now updated the style string.

Cheers,
Andre