-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors encountered when running the function sciPENN_API(...) #4
Comments
Before encountering this error, I already had all the dependencies installed the same version as the software requirement written on your github. Also, the active kernel I use is: The reported error is encountered based on these settings. |
I am also experiencing this error using a conda env built from the .yaml provided. |
For future reference, I have gotten the software working by doing the following. It appears updating numba to a higher version than indicated in the dependencies is required. To do this I created a conda env from this .yml file which simply sets up the env with a suitable version of python and pip
and then ran the following package installation commands in terminal
Not the most elegant solution, but the sciPENN_API function does now run as expected. |
Is there any other solution? |
Hi, I followed your tutorial "tutorial.ipynb" at your website https://drive.google.com/drive/folders/1iY4s76UYNMFvF6v3XN4JxD9gM77NIxoH. However, I got an error when running the following function:
sciPENN = sciPENN_API(gene_trainsets = [adata_gene_train], protein_trainsets = [adata_protein_train],
gene_test = adata_gene_test, train_batchkeys = ['donor'], test_batchkey = 'donor',
type_key = 'celltype.l3')
I got the following error:
TypeError Traceback (most recent call last)
TypeError: expected dtype object, got 'numpy.dtype[float64]'
The above exception was the direct cause of the following exception:
SystemError Traceback (most recent call last)
/var/folders/vn/xxwlw_f508gclgvh8ldr47sw0000gn/T/ipykernel_72171/2889813855.py in
1 sciPENN = sciPENN_API(gene_trainsets = [adata_gene_train], protein_trainsets = [adata_protein_train],
2 gene_test = adata_gene_test, train_batchkeys = ['donor'], test_batchkey = 'donor',
----> 3 type_key = 'celltype.l3')
~/opt/anaconda3/envs/scipennenv/lib/python3.7/site-packages/sciPENN/sciPENN_API.py in init(self, gene_trainsets, protein_trainsets, gene_test, gene_list, select_hvg, train_batchkeys, test_batchkey, type_key, cell_normalize, log_normalize, gene_normalize, min_cells, min_genes, batch_size, val_split, use_gpu)
35 gene_list, select_hvg, cell_normalize, log_normalize, gene_normalize, min_cells, min_genes)
36
---> 37 genes, proteins, genes_test, bools, train_keys, categories = preprocess(*preprocess_args)
38
39 self.proteins = proteins
~/opt/anaconda3/envs/scipennenv/lib/python3.7/site-packages/sciPENN/Preprocessing.py in preprocess(gene_trainsets, protein_trainsets, gene_test, train_batchkeys, test_batchkey, type_key, gene_list, select_hvg, cell_normalize, log_normalize, gene_normalize, min_cells, min_genes)
145
146 sc.pp.highly_variable_genes(tmp, min_mean = 0.0125, max_mean = 3, min_disp = 0.5,
--> 147 n_bins = 20, subset = False, batch_key = 'batch', n_top_genes = 1000)
148 hvgs = tmp.var.index[tmp.var['highly_variable']].copy()
149 tmp = None
~/opt/anaconda3/envs/scipennenv/lib/python3.7/site-packages/scanpy/preprocessing/_highly_variable_genes.py in highly_variable_genes(adata, layer, n_top_genes, min_disp, max_disp, min_mean, max_mean, span, n_bins, flavor, subset, inplace, batch_key, check_values)
472 n_top_genes=n_top_genes,
473 n_bins=n_bins,
--> 474 flavor=flavor,
475 )
476
~/opt/anaconda3/envs/scipennenv/lib/python3.7/site-packages/scanpy/preprocessing/_highly_variable_genes.py in _highly_variable_genes_single_batch(adata, layer, min_disp, max_disp, min_mean, max_mean, n_top_genes, n_bins, flavor)
200 X = np.expm1(X)
201
--> 202 mean, var = materialize_as_ndarray(_get_mean_var(X))
203 # now actually compute the dispersion
204 mean[mean == 0] = 1e-12 # set entries equal to zero to small value
~/opt/anaconda3/envs/scipennenv/lib/python3.7/site-packages/scanpy/preprocessing/_utils.py in _get_mean_var(X, axis)
6 def _get_mean_var(X, *, axis=0):
7 if sparse.issparse(X):
----> 8 mean, var = sparse_mean_variance_axis(X, axis=axis)
9 else:
10 mean = np.mean(X, axis=axis, dtype=np.float64)
~/opt/anaconda3/envs/scipennenv/lib/python3.7/site-packages/scanpy/preprocessing/_utils.py in sparse_mean_variance_axis(mtx, axis)
40 )
41 else:
---> 42 return sparse_mean_var_minor_axis(mtx.data, mtx.indices, *shape, np.float64)
43
44
SystemError: CPUDispatcher(<function sparse_mean_var_minor_axis at 0x7fa7200328c8>) returned a result with an error set.
The text was updated successfully, but these errors were encountered: