Open camim93 opened 4 months ago
Installing the following environment should solve this
mamba env create -f 6-cell-cell_comms/4-tensor/liana_c2c-env.yml
mamba activate liana_c2c-env
or alternatively try this
mamba create -n liana_c2c-env python=3.8
mamba activate liana_c2c-env
mamba install pytorch torchvision torchaudio cpuonly -c pytorch
pip install liana cell2cell decoupler omnipath seaborn==0.11
Now, I got his error :)
{ "name": "UnpicklingError", "message": "pickle data was truncated", "stack": "--------------------------------------------------------------------------- UnpicklingError Traceback (most recent call last) Cell In[6], line 7 2 file_path = os.path.join(data_dir, file_name) 4 # Save 5 # c2c.io.export_variable_with_pickle(tensor, file_path) 6 # Load ----> 7 tensor = unpickle_gpu_tensor(file_path, 'cpu')
Cell In[4], line 17, in unpickle_gpu_tensor(filepath, processing_unit) 15 if processing_unit == 'cpu': 16 with open(filepath, 'rb') as f: ---> 17 tensor = CPU_Unpickler(f).load() 18 elif processing_unit == 'gpu': 19 with open(filepath, 'rb') as f:
UnpicklingError: pickle data was truncated" }
c2c.plotting.factor_plot.context_boxplot(factors['Contexts'], metadict=context_dict, group_label_rotation= 45, nrows=4, figsize=(8, 12), group_order=['healthy_ctrl', 'copd_ctrl', 'healthy_iav', 'copd_iav'], statistical_test='t-test_ind', pval_correction='fdr_bh', verbose=False, cmap='viridis', ylabel="Context Loadings" )
AttributeError Traceback (most recent call last) Cell In[26], line 1 ----> 1 c2c.plotting.factor_plot.context_boxplot(factors['Contexts'], 2 metadict=context_dict, 3 group_label_rotation= 45, 4 nrows=4, 5 figsize=(8, 12), 6 group_order=['healthy_ctrl', 'copd_ctrl', 'healthy_iav', 'copd_iav'], 7 statistical_test='t-test_ind', 8 pval_correction='fdr_bh', 9 verbose=False, 10 cmap='viridis', 11 ylabel="Context Loadings" 12 )
File ~/miniforge3/envs/liana_cuda-env/lib/python3.10/site-packages/cell2cell/plotting/factor_plot.py:175, in context_boxplot(context_loadings, metadict, included_factors, group_order, statistical_test, pval_correction, text_format, nrows, figsize, cmap, title_size, axis_label_size, group_label_rotation, ylabel, dot_color, dot_edge_color, filename, verbose) 172 from itertools import combinations 174 pairs = list(combinations(order, 2)) --> 175 annotator = Annotator(ax=ax, 176 pairs=pairs, 177 data=df, 178 x=x, 179 y=y, 180 order=order) 181 annotator.configure(test=statistical_test, 182 text_format=text_format, 183 loc='inside', 184 comparisons_correction=pval_correction, 185 verbose=verbose 186 ) 187 annotator.apply_and_annotate()
File ~/miniforge3/envs/liana_cuda-env/lib/python3.10/site-packages/statannotations/Annotator.py:106, in Annotator.init(self, ax, pairs, plot, data, x, y, hue, order, hue_order, engine, verbose, plot_params) 104 self._plotter = None 105 else: --> 106 self._plotter = self._get_plotter(engine, ax, pairs, plot, data, 107 x, y, hue, order, hue_order, 108 verbose=verbose, plot_params) 110 self._test = None 111 self.perform_stat_test = None
File ~/miniforge3/envs/liana_cuda-env/lib/python3.10/site-packages/statannotations/Annotator.py:778, in Annotator._get_plotter(engine, *args, *kwargs) 776 if engine_plotter is None: 777 raise NotImplementedError(f"{engine} engine not implemented.") --> 778 return engine_plotter(args, **kwargs)
File ~/miniforge3/envs/liana_cuda-env/lib/python3.10/site-packages/statannotations/_Plotter.py:87, in _SeabornPlotter.init(self, ax, pairs, plot, data, x, y, hue, order, hue_order, verbose, plot_params) 85 self.check_plot_is_implemented(plot) 86 self.plot = plot ---> 87 self.plotter = self._get_plotter(plot, x, y, hue, data, order, 88 hue_order, plot_params) 90 self.group_names, self.labels = self._get_group_names_and_labels() 91 self.groups_positions = _GroupsPositions(self.plotter, 92 self.group_names)
File ~/miniforge3/envs/liana_cuda-env/lib/python3.10/site-packages/statannotations/_Plotter.py:119, in _SeabornPlotter._get_plotter(self, plot, x, y, hue, data, order, hue_order, **plot_params) 116 self.fix_and_warn(dodge, hue, plot) 118 if plot == 'boxplot': --> 119 plotter = sns.categorical._BoxPlotter( 120 121 x, y, hue, data, order, hue_order, 122 orient=plot_params.get("orient"), 123 width=plot_params.get("width", 0.8), 124 dodge=True, 125 fliersize=plot_params.get("fliersize", 5), 126 linewidth=plot_params.get("linewidth"), 127 saturation=.75, color=None, palette=None) 129 elif plot == 'swarmplot': 130 plotter = sns.categorical._SwarmPlotter( 131 x, y, hue, data, order, hue_order, 132 orient=plot_params.get("orient"), 133 dodge=True, color=None, palette=None)
AttributeError: module 'seaborn.categorical' has no attribute '_BoxPlotter'