open2c / coolpuppy

A versatile tool to perform pile-up analysis on Hi-C data in .cool format.
MIT License
77 stars 11 forks source link

ImportError: cannot import name 'snipping' from 'cooltools' #87

Closed Irenexzwen closed 2 years ago

Irenexzwen commented 2 years ago

Hi! I just installed the latest version of cooltools (cooltools-0.5.1) and coolpuppy (coolpuppy-0.9.5), however when I tried coolpup.py -h from CLI, it throws this error: ImportError: cannot import name 'snipping' from 'cooltools'. Is there any mismatch between the current coolpuppy and cooltools lastest version? I also tried to install cooltools==0.5.0, same problem.

I might have missed something, but look for any advice, thank you!

Phlya commented 2 years ago

Please try installing coolpuppy from the master branch, it should work then.

Irenexzwen commented 2 years ago

Thanks for your suggestion, the master branch version indeed work!

However, when I applied the coolpup.py to generate a loop pileup, I got an auto named output file with .clpy suffix. I could not find any documentation related what this format is and how to read it. I expected to get a matrix in any format. Could you suggest how to import and extract the final matrix from the output?

Thanks again.

Phlya commented 2 years ago

You are right, this is not (yet) properly explained. Most people seem to simply use plotpup.py to visualize the output and don't read in the output themselves.

You need this function: https://coolpuppy.readthedocs.io/en/latest/modules.html#coolpuppy.coolpup.load_pileup_df

It will load the file into a pandas dataframe with the same format as output of pileup functions in the tutorial, e.g. here: https://coolpuppy.readthedocs.io/en/latest/Examples/Walkthrough_API.html#on-diagonal-pileup

Hope this helps, please feel free to ask again if anything is unclear!

Irenexzwen commented 2 years ago

Thank you again! I also just located to this function. I'll close this branch now.