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

[BUG]export2loom IndexError: index 0 is out of bounds for axis 0 with size 0 #313

Closed Biglinboy closed 3 years ago

Biglinboy commented 3 years ago

Describe the bug A clear and concise description of what the bug is. IndexError: index 0 is out of bounds for axis 0 with size 0 Steps to reproduce the behavior

  1. Command run when the error occurred:

    ...
  2. Error encountered:

    
    xl = left_touchpoints[d_left == left_diffs][0]
    IndexError: index 0 is out of bounds for axis 0 with size 0

...


**Expected behavior**
A clear and concise description of what you expected to happen.

**Please complete the following information:**
- pySCENIC version: [e.g. 0.10.0, use `pyscenic -h` at the command line]
- Installation method: [e.g. Conda, Pip, Docker, Singularity]
- Run environment: [e.g. Jupyter notebook, CLI, Nextflow, HPC script]
- OS: [e.g. Ubuntu]
- Package versions: [obtain using `pip freeze`, `conda list`, or skip this if using Docker/Singularity]:
<!-- Put your package version list in this code block (if applicable, else delete the block): -->

pySCENIC version: v0.10.1 Installation method: Conda Run environment: Jupyter

...

Biglinboy commented 3 years ago

Hi, I have a problem after running pyscenic workflow, like this

export2loom(ex_mtx = ex_matrix, auc_mtx = auc_mtx, regulons = regulons, out_fname = "ALL.loom")

 File "/home/sy/miniconda3/envs/jupyter20200827/lib/python3.7/site-packages/pyscenic/diptest.py", line 115, in dip_fn
    xl = left_touchpoints[d_left == left_diffs][0]
IndexError: index 0 is out of bounds for axis 0 with size 0

Error happend,I want to save the loom file into R environment. Please help me,thanks~

cflerin commented 3 years ago

There's not a lot to go on here. Could one of your objects be empty? Expression matrix, auc matrix, regulons? Try again in a clean environment, update to the latest pyscenic version, etc.

honghh2018 commented 2 years ago

Hi @Biglinboy @cflerin I got the same error when running on step export2loom(ex_mtx = df.T, auc_mtx = auc, regulons = regulons, out_fname = LOOMF) IndexError: index 0 is out of bounds for axis 0 with size 0

but i check the object that i inputed in export2loom was not empty,like below:

regulons: gene2occurrence=<frozendict {}>, transcription_factor='Egr4', context=frozenset({'taipale__Egr1_mouse_DBD_mutant_DBD_NNMCGCCCMCTCANNN.png', 'activating'}), score=1.9574552992609546, nes=0.0, orthologous_identity=0.0, similarity_qvalue=0.0, annotation=''), Regulon(name='Ehf (84g)', gene2weight=<frozendict {'Strn': 0.6434892926059127, 'Slc39a9': 1.1370013330590356, 'Nfkbie': 0.7144217773691882, 'Etv3': 1.9423757731268585, 'Rasgrp3': 0.4258135655399629, 'Plxnb2': 2.492783986834508, 'Tsg101': 1.2997996022758198, 'Dusp16': 0.43718699372661546, 'Bmf': 1.6430705972774204, 'Lad1': 3.654371067195772, 'Hipk1': 1.820656986438919, 'Mapre2': 0.5079281776614671, 'Fam49a': 2.1550004722356078, 'Hpgds': 1.971151348185936, 'Tgif1': 0.9684413175507228, 'Mrc2': 3.4129712993758266, 'Cask': 0.8354117035401416, 'Ttn': 1.2382318236385257, 'Zfp629': 0.4779918768238665, 'Lrrk1': 0.4106051245351407, 'Baz2b': 3.4129712993758266

auc 1810024B03Rik (44g) Aire (5g) ... Zkscan14 (11g) Zmiz1 (1145g) Cell ...
AAACCCAAGAAGTGTT-1 0.000000 0.000000 ... 0.000000 0.044130 AAACCCAAGGGCAGTT-1 0.000000 0.000000 ... 0.065118 0.045972 AAACCCAAGTCTTGGT-1 0.007616 0.000000 ... 0.000000 0.057088 AAACCCACACGGCCAT-1 0.004657 0.000000 ... 0.000000 0.043263 AAACCCACACGGCGTT-1 0.004087 0.000000 ... 0.000000 0.042507 ... ... ... ... ... ... TTTGTTGGTATCCTTT-1 0.027952 0.000000 ... 0.000000 0.063995 TTTGTTGGTATTTCCT-1 0.027854 0.000000 ... 0.061210 0.032506 TTTGTTGTCAGTCATG-1 0.000000 0.000000 ... 0.031502 0.045082 TTTGTTGTCGAGATAA-1 0.021225 0.000000 ... 0.000000 0.073350 TTTGTTGTCGGACTGC-1 0.064399 0.090487 ... 0.027197 0.046040

[28846 rows x 402 columns]

df.T Mrpl15 Lypla1 Gm37988 Tcea1 ... A330032B11Rik Loxl4 Nkx2-3 Gm29261 AAACCCAAGAAGTGTT-1 0.973337 0.000000 0.0 2.968860 ... 0.0 0.0 0.0 0.0 AAACCCAAGGGCAGTT-1 0.000000 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 AAACCCAAGTCTTGGT-1 0.000000 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 AAACCCACACGGCCAT-1 0.000000 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 AAACCCACACGGCGTT-1 0.976047 0.979167 0.0 1.971616 ... 0.0 0.0 0.0 0.0 ... ... ... ... ... ... ... ... ... ... TTTGTTGGTATCCTTT-1 0.000000 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 TTTGTTGGTATTTCCT-1 0.000000 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 TTTGTTGTCAGTCATG-1 1.977875 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 TTTGTTGTCGAGATAA-1 0.000000 0.000000 0.0 0.000000 ... 0.0 0.0 0.0 0.0 TTTGTTGTCGGACTGC-1 0.000000 0.991163 0.0 0.000000 ... 0.0 0.0 0.0 0.0

pyscenic version: pyscenic 0.10.3

i can not install the latest in the conda environment, it would be install the same version 0.10.3 when i run pip install pyscenic.

how can i install the latest pyscenic, and wonder that can exactly solve this issue? Best, Hope you reply soon hanhuihong