JonathanShor / DoubletDetection

Doublet detection in single-cell RNA-seq data.
https://doubletdetection.readthedocs.io/en/stable/
MIT License
81 stars 23 forks source link

got "list index out of range" error #132

Closed jchenpku closed 3 years ago

jchenpku commented 4 years ago

count = pd.read_csv("exprs.txt", sep="\t", index_col = 0, skiprows =1 ) count.shape (43243, 10949) labels = clf.fit(count).predict() Traceback (most recent call last): File "", line 1, in | 0/25 [00:00<?, ?it/s] File "/software/miniconda3/envs/py3/lib/python3.7/site-packages/doubletdetection/doubletdetection.py", line 248, in fit self.allscores[i], self.all_log_pvalues[i] = self._one_fit() File "/software/miniconda3/envs/py3/lib/python3.7/site-packages/doubletdetection/doubletdetection.py", line 351, in _one_fit aug_counts.obsm["X_pca"], **self.phenograph_parameters File "/software/miniconda3/envs/py3/lib/python3.7/site-packages/phenograph/cluster.py", line 124, in cluster communities, Q = runlouvain(uid, tol=q_tol, time_limit=louvain_time_limit) File "/software/miniconda3/envs/py3/lib/python3.7/site-packages/phenograph/core.py", line 266, in runlouvain if q[-1] - Q > tol: IndexError: list index out of range

adamgayoso commented 3 years ago

Hi, I'm not sure if you've figured out the solution to your issue, but please do let me know.

duocang commented 3 years ago

Update:

It is still the problem of use_phenograph. I set to False, no issue anymore.

Hi, @adamgayoso @jchenpku

I met the same error, do you have any idea?

import doubletdetection
import numpy as np
from scipy.sparse import csr_matrix

read_count = np.genfromtxt("../data/read_count_temp.csv", delimiter=",")
read_count = csr_matrix(read_count, dtype=np.float)

clf = doubletdetection.BoostClassifier()
labels = clf.fit(read_count).predict()

The example is very tiny, you can try it if you need it. https://1drv.ms/u/s!AtjLM4-mbBLkx88A8tjOpeoOLocJCA?e=3RaDK8