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
424 stars 179 forks source link

arboreto_with_multiprocessing.py fails for every target #564

Open noranekonobokkusu opened 1 month ago

noranekonobokkusu commented 1 month ago

Hi,

arboreto_with_multiprocessing.py doesn't see any targets, which I was able to reproduce on a test 10x dataset.

Steps to reproduce the behavior

  1. In Jupyter notebook, I created 10x_test.loom file on a test dataset following this tutorial

  2. Running pyscenic from within Jupyter notebook crashes for me (as in this issue), so I tried running the command line:

arboreto_with_multiprocessing.py --num_worker 4 --sparse --method grnboost2 -o 10x_test.adj.csv 10x_test.loom /path/to/allTFs_hg38.txt

The output produces warning for every single gene in the object, starting as

Loaded expression matrix of 11769 cells and 33538 genes in 7.553167104721069 seconds...
Loaded 1892 TFs...
starting grnboost2 using 4 processes...
  0%|                                                                                                                             | 0/33538 [00:00<?, ?it/s]'WARNING: infer_data failed for target MIR1302-2HG' Retry (1/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (2/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (3/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (4/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (5/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (6/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (7/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (8/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (9/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target MIR1302-2HG' Retry (10/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
  0%|                                                                                                                  | 1/33538 [00:03<34:40:56,  3.72s/it]'WARNING: infer_data failed for target FAM138A' Retry (1/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (2/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (3/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (4/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (5/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (6/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (7/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (8/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (9/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
'WARNING: infer_data failed for target FAM138A' Retry (10/10). Failure caused by AttributeError("'csc_matrix' object has no attribute 'A'").
  0%|                                                                                                                  | 2/33538 [00:04<16:41:08,  1.79s/it]

Expected behavior I expected a non-empty output of this command. My output is a single line in 10x_test.adj.csv: TF,target,importance

Please complete the following information:

ghuls commented 1 month ago

Install an earlier version of scipy than 1.14.0:

Several previously deprecated methods for sparse arrays were removed: asfptype, getrow, getcol, get_shape, getmaxprint, set_shape, getnnz, and getformat. Additionally, the .A and .H attributes were removed.

https://docs.scipy.org/doc/scipy/release/1.14.0-notes.html