-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hi,
I followed the spatial dm example but I keep getting errors when running spatialdm_local.
Below is the code I am running.
start = time.time()
sdm.spatialdm_local(adata, n_perm=1000, method='both', specified_ind=None, nproc=1) # local spot selection
sdm.sig_spots(adata, method='permutation', fdr=False, threshold=0.1) # significant local spots
print("%.3f seconds" %(time.time()-start))
And here is the error I am getting.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[47], line 2
1 start = time.time()
----> 2 sdm.spatialdm_local(adata, n_perm=1000, method='both', specified_ind=None, nproc=1) # local spot selection
3 sdm.sig_spots(adata, method='permutation', fdr=False, threshold=0.1) # significant local spots
4 print("%.3f seconds" %(time.time()-start))
File /n/data1/mgh/neuro/petti/lab/Users/khan.saad/Conda_envs/python_3.10/lib/python3.10/site-packages/spatialdm/main.py:275, in spatialdm_local(adata, n_perm, method, specified_ind, nproc, scale_X)
273 ## different approaches
274 with threadpool_limits(limits=nproc, user_api='blas'):
--> 275 spot_selection_matrix(adata, ligand, receptor, ind, n_perm, method, scale_X)
File /n/data1/mgh/neuro/petti/lab/Users/khan.saad/Conda_envs/python_3.10/lib/python3.10/site-packages/spatialdm/utils.py:179, in spot_selection_matrix(adata, ligand, receptor, ind, n_perm, method, scale_X)
176 def spot_selection_matrix(adata, ligand, receptor, ind, n_perm, method, scale_X=True):
177 # local variables (only live in this function scope)
178 # normalize raw counts
--> 179 raw_norm = adata.raw.to_adata()
180 raw_norm.X = csr_matrix([norm_max(X) for X in raw_norm.X.T]).T
181 import scanpy as sc
AttributeError: 'NoneType' object has no attribute 'to_adata'
Metadata
Metadata
Assignees
Labels
No labels