colomemaria / epiScanpy

Episcanpy: Epigenomics Single Cell Analysis in Python
BSD 3-Clause "New" or "Revised" License
139 stars 33 forks source link

binarize issues #44

Closed dawe closed 4 years ago

dawe commented 4 years ago

I've encountered an issue when trying to binarize data. Specifically, if the data matrix is sparse, the instruction

admatrix = np.where(admatrix>threshold, upper, lower)

raises sequence error. This solution may be applied preserving the type of datamatrix:

admatrix = (adata.X > threshold).astype(float)
DaneseAnna commented 4 years ago

Thanks!

Indeed, this is an important issue. We fixed it a few days ago. If you try to use the latest GitHub version you should not have this problem. I like the suggestion you've made, so I might update the function one more time with your fix.

We are also updating the website and releasing new tutorials this week. If you want, you can already access the tutorial to process ATAC count matrices here: https://nbviewer.jupyter.org/github/colomemaria/epiScanpy/blob/master/docs/tutorials/Tutorial_Hackathon_Buenrostro_2.html