MaayanLab/appyter-catalog

[Augmented_Pathway_Enrichment_Analysis] OSError: [Errno 22] Invalid argument

heartonbit opened this issue · 0 comments

Hello. Below error is occurring on Augmented_Pathway_Enrichment_Analysis.
Possibly, data file is missing. Please check. Thanks.

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/PIL/Image.py in save(self, fp, format, **params)
   2239         try:
-> 2240             save_handler(self, fp, filename)
   2241         finally:

/usr/local/lib/python3.8/dist-packages/PIL/PngImagePlugin.py in _save(im, fp, filename, chunk, save_all)
   1361     if hasattr(fp, "flush"):
-> 1362         fp.flush()
   1363 

OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
/tmp/ipykernel_18/1098048833.py in <module>
      9         library_data, pathways, items = load(file, items, separate=True)
     10         results, pvals, results_df = enrichment_analysis(items, library_data, pathways)
---> 11         enrichr_figure(results, pvals, results_df["q value"].tolist(), final_output_file_names, [file], plasma(i*0.25), topk)
     12         display(Markdown(f"*Figure {i+1}. Bar chart of the top {topk} enriched terms in {file.replace('_', ' ')} based on p-values, along with their corresponding q-values (written). Colored bars correspond to terms with significant p-values (<0.05). An asterisk next to a q-value indicates the term also has a significant q-value (<0.05)*"))
     13         # Download Bar Chart

/tmp/ipykernel_18/3204716763.py in enrichr_figure(all_terms, all_pvalues, all_qvalues, plot_names, all_libraries, bar_color, topk)
     38     # Save results
     39     for plot_name in plot_names:
---> 40         plt.savefig(plot_name, bbox_inches = 'tight')
     41 
     42     # Show plot

/usr/local/lib/python3.8/dist-packages/matplotlib/pyplot.py in savefig(*args, **kwargs)
    956 def savefig(*args, **kwargs):
    957     fig = gcf()
--> 958     res = fig.savefig(*args, **kwargs)
    959     fig.canvas.draw_idle()   # need this if 'transparent=True' to reset colors
    960     return res

/usr/local/lib/python3.8/dist-packages/matplotlib/figure.py in savefig(self, fname, transparent, **kwargs)
   3010                         ax.patch._cm_set(facecolor='none', edgecolor='none'))
   3011 
-> 3012             self.canvas.print_figure(fname, **kwargs)
   3013 
   3014     def ginput(self, n=1, timeout=30, show_clicks=True,

/usr/local/lib/python3.8/dist-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
   2312                 # force the figure dpi to 72), so we need to set it again here.
   2313                 with cbook._setattr_cm(self.figure, dpi=dpi):
-> 2314                     result = print_method(
   2315                         filename,
   2316                         facecolor=facecolor,

/usr/local/lib/python3.8/dist-packages/matplotlib/backend_bases.py in wrapper(*args, **kwargs)
   1641             kwargs.pop(arg)
   1642 
-> 1643         return func(*args, **kwargs)
   1644 
   1645     return wrapper

/usr/local/lib/python3.8/dist-packages/matplotlib/_api/deprecation.py in wrapper(*inner_args, **inner_kwargs)
    410                          else deprecation_addendum,
    411                 **kwargs)
--> 412         return func(*inner_args, **inner_kwargs)
    413 
    414     DECORATORS[wrapper] = decorator

/usr/local/lib/python3.8/dist-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, metadata, pil_kwargs, *args)
    539         """
    540         FigureCanvasAgg.draw(self)
--> 541         mpl.image.imsave(
    542             filename_or_obj, self.buffer_rgba(), format="png", origin="upper",
    543             dpi=self.figure.dpi, metadata=metadata, pil_kwargs=pil_kwargs)

/usr/local/lib/python3.8/dist-packages/matplotlib/image.py in imsave(fname, arr, vmin, vmax, cmap, format, origin, dpi, metadata, pil_kwargs)
   1673         pil_kwargs.setdefault("format", format)
   1674         pil_kwargs.setdefault("dpi", (dpi, dpi))
-> 1675         image.save(fname, **pil_kwargs)
   1676 
   1677 

/usr/local/lib/python3.8/dist-packages/PIL/Image.py in save(self, fp, format, **params)
   2242             # do what we can to clean up
   2243             if open_fp:
-> 2244                 fp.close()
   2245 
   2246     def seek(self, frame):

OSError: [Errno 22] Invalid argument