gbouras13 / pharokka

fast phage annotation program
MIT License
137 stars 13 forks source link

getting consistent error with pharokka_multiplotter #337

Open JEMINA-JOHN opened 2 months ago

JEMINA-JOHN commented 2 months ago

I was trying to use multiplotter to plot the output of pharokka and phold. In run_pharokka_and_phold.ipynb, i got output from pharokka and phold. I wanted to plot phold output using multiplotter but keep getting this error. I am new to coding so I am not able to understand what exactly is the issue. I am able to understand the fact that its because of the .gbk file. But that was generated by pharokka and phold only. So i am not sure why the structure of file will create an issue.

Am i doing anything wrong? Can someone help? @gbouras13

What I Did

!pharokka_multiplotter.py -g /content/output_phold/phold.gbk -o pharokka_plots_output_directory

2024-04-11 15:15:37.250 | INFO | main::103 - Starting Pharokka v1.7.1 2024-04-11 15:15:37.250 | INFO | main::104 - Running pharokka_multiplotter.py to plot your phages. 2024-04-11 15:15:37.250 | INFO | main::105 - Command executed: Namespace(genbank='/content/output_phold/phold.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-04-11 15:15:37.250 | INFO | main::106 - Repository homepage is https://github.com/gbouras13/pharokka 2024-04-11 15:15:37.250 | INFO | main::107 - Written by George Bouras: george.bouras@adelaide.edu.au 2024-04-11 15:15:37.250 | INFO | main::108 - Checking your inputs. 2024-04-11 15:15:37.251 | INFO | main::194 - All files checked. 2024-04-11 15:15:37.285 | INFO | main::244 - Plotting NODE_10_length_1884_cov_1.569 Traceback (most recent call last): File "/usr/local/bin/pharokka_multiplotter.py", line 246, in create_single_plot( File "/usr/local/bin/plot.py", line 970, in create_single_plot quantile_length = np.quantile(length_list, annotations) File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4543, in quantile return _quantile_unchecked( File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4555, in _quantile_unchecked return _ureduce(a, File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 3823, in _ureduce r = func(a, **kwargs) File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4722, in _quantile_ureduce_func result = _quantile(arr, File "/usr/local/lib/python3.10/site-packages/numpy/lib/function_base.py", line 4831, in _quantile slices_having_nans = np.isnan(arr[-1, ...]) IndexError: index -1 is out of bounds for axis 0 with size 0

output_phold.zip output_pharokka.zip

The gbk file inside these outputs only i used. I unzipped the file and ran the gbk file only. Cannot figure where the issue is.

gbouras13 commented 2 months ago

Hi @JEMINA-JOHN ,

I think the issue is the phold output - there are some differences in how pharokka handles it.

I would simply recommend using phold plot e.g.

phold plot -i /content/output_phold/phold.gbk -o pharokka_plots_output_directory

This by default will plot each entry in the Genbank separately (like pharokka_multiplotter.py)

George