scFEA
scFEA copied to clipboard
TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool.
Hi, I met a wrong when I run the mouse data. My input data is in .csv format. When it runs into this step, occurred some wrongs.
Starting load data...
Calculating MAGIC...
Running MAGIC on 51914 cells and 22382 genes.
Calculating graph and diffusion operator...
Calculating PCA...
Calculated PCA in 39.08 seconds.
Calculating KNN search...
Calculated KNN search in 493.08 seconds.
Calculating affinities...
Calculated affinities in 490.14 seconds.
Calculated graph and diffusion operator in 1027.61 seconds.
Running MAGIC with solver='exact'
on 22382-dimensional data may take a long time. Consider denoising specific genes with genes=<list-like>
or using solver='approximate'
.
Calculating imputation...
Calculated imputation in 104.30 seconds.
Calculated MAGIC in 1135.44 seconds.
Traceback (most recent call last):
File "scFEA/./src/scFEA.py", line 370, in
Please help me! Thanks.
I met same problem but in
X = geneExprDf.values.T
X = torch.FloatTensor(X).
Change code to:
X = geneExprDf.values.T.astype(np.float32)
X = torch.FloatTensor(X).
can solve the problem
Maybe the problem comes from the expression matrix, I title the header of the gene name column with "index", and it runs well.
I encountered this error when I wrongly inputted the mouse module files like the parameter of stoichiometry_matrix or module gene file, to the calculation of human transcriptomes. So you may check this to see whether it is the reason, i.e., unmatched gene symbols