luke831215 / SQUAT

a Sequencing Quality Assessment Tool
GNU General Public License v3.0
18 stars 5 forks source link

ValueError: Number of rows must be a postive integer #11

Closed lpipes closed 2 years ago

lpipes commented 2 years ago

I am getting this error when I run the program

Start examining all
sampling 1000000 out of 3463092 records
BWA read mapping
BWA - MEM
BWA - backtrack
Evaluate genome assemblies
Generate pre-assembly reports
Generate post-assembly reports
Generate label distribution graph
Traceback (most recent call last):
  File "/space/s1/lenore/software/SQUAT/library/gen_report.py", line 336, in <module>
    draw_label_dis(label_distribution, aln_tool_list, src_dir, data, read_size, ecv_fpath, plot_figures)
  File "/space/s1/lenore/software/SQUAT/library/gen_report.py", line 170, in draw_label_dis
    plotter.do_label_piechart(label_distribution, src_dir, aln_tool_list, plot_figures)
  File "/space/s1/lenore/software/SQUAT/library/plotter.py", line 545, in do_label_piechart
    ax = fig.add_subplot(len(aln_tool_list) / 2, 2, i+1)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/figure.py", line 749, in add_subplot
    ax = subplot_class_factory(projection_class)(self, *args, **pkw)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/axes/_subplots.py", line 36, in __init__
    self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args))
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 599, in _from_subplot_args
    gs = GridSpec._check_gridspec_exists(figure, rows, cols)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 225, in _check_gridspec_exists
    return GridSpec(nrows, ncols, figure=figure)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 387, in __init__
    super().__init__(nrows, ncols,
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 49, in __init__
    raise ValueError(
ValueError: Number of rows must be a positive integer, not 1.0
Compress reports into zip
cp: cannot stat 'all.html': No such file or directory
lpipes commented 2 years ago

I'm not able to successfully run the example either

squat.sh SQUAT/example/SEQ.fastq -r SQUAT/example/ASSEMBLY.fasta -o example_out
Start examining SEQ
No. of reads: 25000
BWA read mapping
BWA - MEM
BWA - backtrack
Evaluate genome assemblies
Generate pre-assembly reports
Generate post-assembly reports
Generate label distribution graph
Traceback (most recent call last):
  File "/space/s1/lenore/software/SQUAT/library/gen_report.py", line 336, in <module>
    draw_label_dis(label_distribution, aln_tool_list, src_dir, data, read_size, ecv_fpath, plot_figures)
  File "/space/s1/lenore/software/SQUAT/library/gen_report.py", line 170, in draw_label_dis
    plotter.do_label_piechart(label_distribution, src_dir, aln_tool_list, plot_figures)
  File "/space/s1/lenore/software/SQUAT/library/plotter.py", line 545, in do_label_piechart
    ax = fig.add_subplot(len(aln_tool_list) / 2, 2, i+1)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/figure.py", line 749, in add_subplot
    ax = subplot_class_factory(projection_class)(self, *args, **pkw)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/axes/_subplots.py", line 36, in __init__
    self.set_subplotspec(SubplotSpec._from_subplot_args(fig, args))
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 599, in _from_subplot_args
    gs = GridSpec._check_gridspec_exists(figure, rows, cols)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 225, in _check_gridspec_exists
    return GridSpec(nrows, ncols, figure=figure)
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 387, in __init__
    super().__init__(nrows, ncols,
  File "/home/lenore/.local/lib/python3.10/site-packages/matplotlib-3.6.0.dev2731+g2dcc824ec8-py3.10-linux-x86_64.egg/matplotlib/gridspec.py", line 49, in __init__
    raise ValueError(
ValueError: Number of rows must be a positive integer, not 1.0
Compress reports into zip
cp: cannot stat 'SEQ.html': No such file or directory
lpipes commented 2 years ago

I fixed this by changing this

ax = fig.add_subplot(int(len(aln_tool_list) / 2), 2, i+1)