wdecoster / NanoPlot

Plotting scripts for long read sequencing data
http://nanoplot.bioinf.be
MIT License
401 stars 48 forks source link

Unexpected keyword argument #362

Closed axelphilip closed 2 months ago

axelphilip commented 3 months ago

Good morning,

I am new to using the MinION sequencing device and am currently exploring various analysis pipelines. Although I am not an experienced coder or bioinformatician, I am eager to learn and expand my skill set.

While attempting to analyze my data using NanoPlot, I encountered an error that I could not resolve through initial searches or checking existing issues on relevant forums. The error message is as follows: TypeError: length_plots() got an unexpected keyword argument 'settings'

Here is the log :

2024-04-12 11:20:40,050 NanoPlot 1.42.0 started with arguments Namespace(N50=False, alength=False, bam=None, barcoded=False, color='#4CB391', colormap='Greens', cram=None, downsample=None, dpi=100, drop_outliers=False, fasta=None, fastq=None, fastq_minimal=None, fastq_rich=None, feather=None, font_scale=1, format=['png'], hide_stats=False, huge=False, info_in_report=False, legacy=None, listcolormaps=False, listcolors=False, loglength=True, maxlength=None, minlength=None, minqual=None, no_N50=False, no_static=False, no_supplementary=False, only_report=False, outdir='summary-plots-log-transformed', path='summary-plots-log-transformed/', percentqual=False, pickle=None, plots=['kde', 'dot'], prefix='', raw=False, readtype='1D', runtime_until=None, store=False, summary=['Bureau/sequencing_summary.txt'], threads=4, title=None, tsv_stats=False, ubam=None, verbose=True)
2024-04-12 11:20:40,050 Python version is: 3.8.10 (default, Mar 15 2022, 12:22:08)  [GCC 9.4.0]
2024-04-12 11:20:40,057 Nanoget: Collecting metrics from summary file Bureau/sequencing_summary.txt for 1D sequencing
2024-04-12 11:20:40,258 Nanoget: Finished collecting statistics from summary file Bureau/sequencing_summary.txt
2024-04-12 11:20:40,275 Reduced DataFrame memory usage from 4.122711181640625Mb to 4.122711181640625Mb
2024-04-12 11:20:40,300 Nanoget: Gathered all metrics of 90062 reads
2024-04-12 11:20:40,336 Calculated statistics
2024-04-12 11:20:40,337 Using sequenced read lengths for plotting.
2024-04-12 11:20:40,337 Using log10 scaled read lengths.
2024-04-12 11:20:40,344 Nanoplotter: Valid color #4CB391.
/usr/lib/python3.8/_collections_abc.py:702: MatplotlibDeprecationWarning: The global colormaps dictionary is no longer considered public API.
  return len(self._mapping)
/usr/lib/python3.8/_collections_abc.py:720: MatplotlibDeprecationWarning: The global colormaps dictionary is no longer considered public API.
  yield from self._mapping
2024-04-12 11:20:40,345 Nanoplotter: Valid colormap Greens.
2024-04-12 11:20:40,350 length_plots() got an unexpected keyword argument 'settings'
Traceback (most recent call last):
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplot/NanoPlot.py", line 110, in main
    plots = make_plots(datadf, settings)
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplot/NanoPlot.py", line 166, in make_plots
    nanoplotter.length_plots(
TypeError: length_plots() got an unexpected keyword argument 'settings'

I would appreciate any guidance or suggestions on how to resolve this error. Thank you in advance for your time and help.

Best,

Axel

wdecoster commented 3 months ago

Odd! Is this a recent NanoPlot installation? How did you install this?

axelphilip commented 3 months ago

It is indeed a recent NanoPlot installation. I installed the software using the following command: using pip install NanoPlot.

Edit : for further context, here is the output of my system's configuration: Linux Inspiron-3501 5.15.0-102-generic #112~20.04.1-Ubuntu SMP Thu Mar 14 14:28:24 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

wdecoster commented 3 months ago

Can you try again after pip uninstall nanoplotter

axelphilip commented 3 months ago

Just uninstalled and installed again, it did not fix my issue unfortunately:

NanoPlot --summary Bureau/sequencing_summary.txt --loglength -o summary-plots-log-transformed --verbose
2024-04-15 09:26:27,536 NanoPlot 1.42.0 started with arguments Namespace(N50=False, alength=False, bam=None, barcoded=False, color='#4CB391', colormap='Greens', cram=None, downsample=None, dpi=100, drop_outliers=False, fasta=None, fastq=None, fastq_minimal=None, fastq_rich=None, feather=None, font_scale=1, format=['png'], hide_stats=False, huge=False, info_in_report=False, legacy=None, listcolormaps=False, listcolors=False, loglength=True, maxlength=None, minlength=None, minqual=None, no_N50=False, no_static=False, no_supplementary=False, only_report=False, outdir='summary-plots-log-transformed', path='summary-plots-log-transformed/', percentqual=False, pickle=None, plots=['kde', 'dot'], prefix='', raw=False, readtype='1D', runtime_until=None, store=False, summary=['Bureau/sequencing_summary.txt'], threads=4, title=None, tsv_stats=False, ubam=None, verbose=True)
2024-04-15 09:26:27,536 Python version is: 3.8.10 (default, Nov 22 2023, 10:22:35)  [GCC 9.4.0]
2024-04-15 09:26:27,544 Nanoget: Collecting metrics from summary file Bureau/sequencing_summary.txt for 1D sequencing
2024-04-15 09:26:27,767 Nanoget: Finished collecting statistics from summary file Bureau/sequencing_summary.txt
2024-04-15 09:26:27,788 Reduced DataFrame memory usage from 4.122711181640625Mb to 4.122711181640625Mb
2024-04-15 09:26:27,813 Nanoget: Gathered all metrics of 90062 reads
2024-04-15 09:26:27,852 Calculated statistics
2024-04-15 09:26:27,852 Using sequenced read lengths for plotting.
2024-04-15 09:26:27,853 Using log10 scaled read lengths.
2024-04-15 09:26:27,861 Nanoplotter: Valid color #4CB391.
/usr/lib/python3.8/_collections_abc.py:702: MatplotlibDeprecationWarning: The global colormaps dictionary is no longer considered public API.
  return len(self._mapping)
/usr/lib/python3.8/_collections_abc.py:720: MatplotlibDeprecationWarning: The global colormaps dictionary is no longer considered public API.
  yield from self._mapping
2024-04-15 09:26:27,862 Nanoplotter: Valid colormap Greens.
2024-04-15 09:26:27,867 length_plots() got an unexpected keyword argument 'settings'
Traceback (most recent call last):
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplot/NanoPlot.py", line 110, in main
    plots = make_plots(datadf, settings)
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplot/NanoPlot.py", line 166, in make_plots
    nanoplotter.length_plots(
TypeError: length_plots() got an unexpected keyword argument 'settings'

If you read this then NanoPlot 1.42.0 has crashed :-(
Please try updating NanoPlot and see if that helps...

If not, please report this issue at https://github.com/wdecoster/NanoPlot/issues
If you could include the log file that would be really helpful.
Thanks!
wdecoster commented 3 months ago

Hrm but you should just uninstall nanoplotter, not install it again. Not sure if that is the cause though, just my first guess.

axelphilip commented 3 months ago

I did uninstall and install it again, my bad. It now reports that it cannot find the 'plotly.graph_objs' module, even though I tried to uninstall and install/upgrade NanoPlot again:

NanoPlot --summary Bureau/sequencing_summary.txt --loglength -o summary-plots-log-transformed --verbose
Traceback (most recent call last):
  File "/home/bforcure/.local/bin/NanoPlot", line 5, in <module>
    from nanoplot.NanoPlot import main
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplot/NanoPlot.py", line 24, in <module>
    from nanoplotter.plot import Plot
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplotter/__init__.py", line 1, in <module>
    from .nanoplotter_main import *
  File "/home/bforcure/.local/lib/python3.8/site-packages/nanoplotter/nanoplotter_main.py", line 26, in <module>
    import plotly.graph_objs as go
ModuleNotFoundError: No module named 'plotly.graph_objs'
wdecoster commented 3 months ago

Hrm. Maybe try uninstalling nanoplot, nanoplotter, nanopack... and install again. I get the idea it is trying to import an old nanoplotter module (which is no longer used by NanoPlot).

axelphilip commented 3 months ago

I tried to uninstall and install again everything, rebooted my computer but still stuck on the ModuleNotFoundError: No module named 'plotly.graph_objs'

wdecoster commented 3 months ago

Does pip install plotly work? If not, maybe try with conda?

axelphilip commented 2 months ago

I uninstalled and installed plotly again, and it finally worked. Thanks for the help !

wdecoster commented 2 months ago

Not sure what was going on, but glad it is solved :)