vaquerizaslab / tadtool

TADtool is an interactive tool for the identification of meaningful parameters in TAD-calling algorithms for Hi-C data.
MIT License
43 stars 13 forks source link

Sugget to add python2.7 to documentation #25

Open qiyubio opened 3 years ago

qiyubio commented 3 years ago

Hi,

We found that tadtool installed using python3 will give error “colorbar” had no attribute “set_clim”. This error is from matplotlib3, could be solved by installing tadtool in python2.7 environment. So to avoid similar problem in other user, I suggest to add something like 'tadtool is a Python 2 compatibility package' in README.

Best, Qi

rayoq2021 commented 3 years ago

Hello Qi, Can you post the steps you performed to enable TADtool to run on python2.7? I am very much interested in running TADtool and would be greatfull to see the steps and the installation of the other required packages like Numpy, Matplotlib, etc.

Thanks in advance for your assistance, Ray

kaukrise commented 3 years ago

Hey guys,

sorry, I'm still technically in holiday, and I'll attempt to fix this properly once I return. For now, downgrading matplotlib should also work, maybe you can give that a try first?

pip install matplotlib==3.2.2
kaukrise commented 3 years ago

Never mind, the fix was not all that complicated, it seems. I pushed a new version to Pypi (0.8.2) which restores matplotlib 3.3 compatibility and it works fine in my tests in Python 3. There is a nasty deprecation warning though, which I will have to attend to at some point, but everything seems to work as expected. Please let me know if you run into any additional issues!

rayoq2021 commented 3 years ago

Hello,     I did the DeprecationWarning as mentioned but the plot did not generate.  I received the following errors when running the sample: 

tadtool plot examples/chr12_20-35Mb.matrix.txt examples/chr12_20-35Mb_regions.bed chr12:31000000-33000000 2021-01-07 14:30:10,372 INFO Loading regions... 2021-01-07 14:30:10,373 INFO Checking plotting region in matrix... 2021-01-07 14:30:10,373 INFO Loading matrix... 2021-01-07 14:30:10,551 INFO Getting window sizes... 2021-01-07 14:30:10,552 INFO Calculating index... 100% (100 of 100) |####################################################################################| Elapsed Time: 0:00:07 Time: 0:00:07 2021-01-07 14:30:17,943 INFO Done. Showing plot... /usr/local/lib/python3.8/dist-packages/tadtool/plot.py:356: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3. Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading']. This will become an error two minor releases later. self.mesh = self.ax.pcolormesh(x, y, da_sub_masked, cmap=self.colormap, vmax=self.vmax) Traceback (most recent call last): File "/usr/local/bin/tadtool", line 447, in TADtool() File "/usr/local/bin/tadtool", line 44, in init getattr(self, args.command)() File "/usr/local/bin/tadtool", line 207, in plot fig, axes = tad_plot.plot(plotting_region) File "/usr/local/lib/python3.8/dist-packages/tadtool/plot.py", line 686, in plot self.data_slider_update(init_value_data) File "/usr/local/lib/python3.8/dist-packages/tadtool/plot.py", line 559, in data_slider_update self.data_plot.set_clim(self.min_value_data, val) File "/usr/local/lib/python3.8/dist-packages/tadtool/plot.py", line 367, in set_clim self.colorbar.set_clim(vmin=vmin, vmax=vmax) AttributeError: 'Colorbar' object has no attribute 'set_clim'

Thanks for your assistance in advance. Ray Oquendo

kaukrise commented 3 years ago

Hey, you need the latest version of tadtool with the fix I implemented.

pip install --upgrade tadtool

PS: If possible, please reply in GitHub and not via email. The formatting in your last post was all screwed up and there was a lot of nonsensical text in there which I had to remove before even finding your message. Thanks!