ELELAB / mutatex

scripts and facilities for in-silico mutagenesis with FoldX
GNU General Public License v3.0
51 stars 8 forks source link

ValueError: negative dimensions are not allowed - when running ddg2logo #164

Closed amardeepranu closed 1 year ago

amardeepranu commented 1 year ago

Stacktrace below:

/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/Bio/PDB/Polypeptide.py:147: BiopythonDeprecationWarning: 'three_to_one' will be deprecated in a future release of Biopython in favor of 'Bio.PDB.Polypeptide.protein_letters_3to1'.
  BiopythonDeprecationWarning,
Traceback (most recent call last):
  File "/home/ec2-user/.local/envs/foldx/bin/ddg2logo", line 415, in <module>
    fig.savefig("%d_%s" %(i, options.outfile), dpi=options.dpi)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/figure.py", line 3058, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2325, in print_figure
    **kwargs)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 1648, in wrapper
    return func(*args, **kwargs)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/_api/deprecation.py", line 389, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/backends/backend_pdf.py", line 2790, in print_pdf
    self.figure.draw(renderer)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/artist.py", line 74, in draw_wrapper
    result = draw(artist, renderer, *args, **kwargs)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/figure.py", line 2846, in draw
    renderer, self, artists, self.suppressComposite)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 3092, in draw
    renderer, self, artists, self.figure.suppressComposite)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 156, in _draw_list_compositing_images
    flush_images()
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 142, in flush_images
    data, l, b = composite_images(image_group, renderer, mag)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 90, in composite_images
    data, x, y, trans = image.make_image(renderer, magnification)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 957, in make_image
    magnification, unsampled=unsampled)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 556, in _make_image
    self, A[..., 3], out_shape, t, alpha=alpha)
  File "/home/ec2-user/.local/envs/foldx/lib/python3.7/site-packages/matplotlib/image.py", line 190, in _resample
    out = np.zeros(out_shape + data.shape[2:], data.dtype)  # 2D->2D, 3D->3D.
ValueError: negative dimensions are not allowed
mtiberti commented 1 year ago

hi @amardeepranu , can you please tell us what were you trying to do exactly, for instance the command line you were using? We would be able to reproduce your error to try and fix it. Thanks!

amardeepranu commented 1 year ago

Sure! This is the command:

ddg2logo -p $results_dir/"$pdb_name"_model0_checked.pdb \
-l $HOME/proteins/optimization/foldx/default_mutation_list.txt \
-d $results_dir/results/mutation_ddgs/"$pdb_name"_model0_checked_Repair \
-s 25 -D -100 \
-T -1.2

Just trying to output a logo plot from my results. ddg2heatmap and ddg2excel works without issue. I'm using Python 3.7.12 and matplotlib 3.5.3

mtiberti commented 1 year ago

@amardeepranu I've been trying to look into your problem and I think it is due to using option -D with a negative number (you have -D -100 in your command line). Option -D is the resolution of the output figure, so it should always be positive. If I change that number to positive (and after fixing #165) it works for me. Can you give it a try? I will still add a check in the script that detects this condition

amardeepranu commented 1 year ago

Thanks @mtiberti works now!

mtiberti commented 1 year ago

closing as resolved