gbouras13 / pharokka

fast phage annotation program
MIT License
146 stars 14 forks source link

Issues with pharokka_multiplotter.py: IndexError: index -1 is out of bounds for axis 0 with size 0 #348

Open aryehjc opened 3 months ago

aryehjc commented 3 months ago

Description

Hello, I ran pharokka on a contigs.fasta file with 55 contigs, this completed successfully. Next I was running pharokka_multiplotter.py on the output pharokka.gbk file, and the command crashed with the following output below. Please help thank you

What I Did


/home/aryeh/pharokka-1.7.2/bin/./pharokka_multiplotter.py -g pharokka.gbk -o pharokka_plots_output_directory
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:103 - Starting Pharokka v1.7.2
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:104 - Running pharokka_multiplotter.py to plot your phages.
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:105 - Command executed: Namespace(genbank='pharokka.gbk', outdir='pharokka_plots_output_directory', force=False, label_hypotheticals=False, remove_other_features_labels=False, title_size='20', label_size='8', interval='5000', truncate='20', dpi='600', annotations='1', plot_title='Phage', label_ids='')
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:106 - Repository homepage is https://github.com/gbouras13/pharokka
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:107 - Written by George Bouras: george.bouras@adelaide.edu.au
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:108 - Checking your inputs.
2024-06-24 13:20:32.493 | INFO     | __main__:<module>:194 - All files checked.
2024-06-24 13:20:32.674 | INFO     | __main__:<module>:244 - Plotting contig_1
2024-06-24 13:20:34.830 | INFO     | __main__:<module>:244 - Plotting contig_10
2024-06-24 13:20:36.539 | INFO     | __main__:<module>:244 - Plotting contig_11
2024-06-24 13:20:38.375 | INFO     | __main__:<module>:244 - Plotting contig_12
2024-06-24 13:20:40.120 | INFO     | __main__:<module>:244 - Plotting contig_13
2024-06-24 13:20:41.692 | INFO     | __main__:<module>:244 - Plotting contig_14
2024-06-24 13:20:43.284 | INFO     | __main__:<module>:244 - Plotting contig_15
2024-06-24 13:20:44.818 | INFO     | __main__:<module>:244 - Plotting contig_16
2024-06-24 13:20:46.423 | INFO     | __main__:<module>:244 - Plotting contig_17
2024-06-24 13:20:48.095 | INFO     | __main__:<module>:244 - Plotting contig_18
2024-06-24 13:20:49.671 | INFO     | __main__:<module>:244 - Plotting contig_19
2024-06-24 13:20:51.247 | INFO     | __main__:<module>:244 - Plotting contig_2
2024-06-24 13:20:53.248 | INFO     | __main__:<module>:244 - Plotting contig_20
2024-06-24 13:20:54.761 | INFO     | __main__:<module>:244 - Plotting contig_21
2024-06-24 13:20:56.273 | INFO     | __main__:<module>:244 - Plotting contig_22
2024-06-24 13:20:57.790 | INFO     | __main__:<module>:244 - Plotting contig_23
2024-06-24 13:20:59.328 | INFO     | __main__:<module>:244 - Plotting contig_24
2024-06-24 13:21:00.970 | INFO     | __main__:<module>:244 - Plotting contig_25
2024-06-24 13:21:02.485 | INFO     | __main__:<module>:244 - Plotting contig_26
2024-06-24 13:21:03.950 | INFO     | __main__:<module>:244 - Plotting contig_27
2024-06-24 13:21:05.499 | INFO     | __main__:<module>:244 - Plotting contig_28

/home/aryeh/.local/lib/python3.10/site-packages/pycirclize/circos.py:888: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`). Consider using `matplotlib.pyplot.close()`.
  fig = plt.figure(figsize=figsize, dpi=dpi, tight_layout=True)

2024-06-24 13:21:07.063 | INFO     | __main__:<module>:244 - Plotting contig_29
2024-06-24 13:21:08.539 | INFO     | __main__:<module>:244 - Plotting contig_3
2024-06-24 13:21:10.432 | INFO     | __main__:<module>:244 - Plotting contig_30
2024-06-24 13:21:11.857 | INFO     | __main__:<module>:244 - Plotting contig_31

Traceback (most recent call last):
  File "/home/aryeh/pharokka-1.7.2/bin/./pharokka_multiplotter.py", line 246, in <module>
    create_single_plot(
  File "/home/aryeh/pharokka-1.7.2/bin/plot.py", line 970, in create_single_plot
    quantile_length = np.quantile(length_list, annotations)
  File "/home/aryeh/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4543, in quantile
    return _quantile_unchecked(
  File "/home/aryeh/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4555, in _quantile_unchecked
    return _ureduce(a,
  File "/home/aryeh/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 3823, in _ureduce
    r = func(a, **kwargs)
  File "/home/aryeh/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4721, in _quantile_ureduce_func
    result = _quantile(arr,
  File "/home/aryeh/.local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4830, in _quantile
    slices_having_nans = np.isnan(arr[-1, ...])
IndexError: index -1 is out of bounds for axis 0 with size 0
gbouras13 commented 2 months ago

Hi @aryehjc ,

Have you tried plotting contig_31 with the regular pharokka plot function? I suspect that it may just have no CDS (and so a plot would be a bit useless :) ). Alternatively, please upload it and I will try and replicate it.

George