aertslab / pySCENIC

pySCENIC is a lightning-fast python implementation of the SCENIC pipeline (Single-Cell rEgulatory Network Inference and Clustering) which enables biologists to infer transcription factors, gene regulatory networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
420 stars 179 forks source link

recursion depth: sns.clustermap(auc_mtx, figsize=(8,8)) #10

Closed dschrein closed 6 years ago

dschrein commented 6 years ago

sorry to keep bombarding you!

>>> sns.clustermap(auc_mtx, figsize=(8,8))
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2651, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2651, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2651, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  [Previous line repeated 993 more times]
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2618, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2530, in _dendrogram_calculate_info
    leaf_label_func, i, labels)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2403, in _append_singleton_leaf_node
    ivl.append(str(int(i)))
RecursionError: maximum recursion depth exceeded while getting the str of an object
>>> auc_mtx.shape
(11750, 253)
bramvds commented 6 years ago

Dear,

This is an issue outside the scope of pyscenic: please have a look at:

  1. https://github.com/mwaskom/seaborn/issues/1152
  2. https://github.com/scipy/scipy/issues/7271

It maybe helpful to first inspect the auc_mtx dataframe, e.g. display it with the simple heatmap function also available in the seaboard package.

Kr, Bram

dschrein commented 6 years ago

thanks a lot. could this be related to the fact that my auc_mtx is composed completely of 0.0? (and would you know what that might signify?) should i be subsetting?

>>> ex_matrix.shape
(11750, 14742)
bramvds commented 6 years ago

Only zeros in the AUC matrix is mark of the fact that are is a mismatch between the name of the genes in your derived regulons and the name of the genes in your expression matrix. If the targets in the regulons look ok then make sure the expression matrix you supply to aucell is properly oriented (genes should be in the column index of the dataframe that represents the expression matrix). Do a .T (transpose) operation on the matrix if necessary.