atarashansky / SAMap

SAMap: Mapping single-cell RNA sequencing datasets from evolutionarily distant organisms.
MIT License
66 stars 19 forks source link

Issue running recent SAMap_vignette #58

Closed itliao closed 3 years ago

itliao commented 3 years ago

Hi!

I was trying to run the most recent SAMap_vignette, and I ran into this issue that I could not figure out how to resolve. I updated sam-algorithm to 0.8.7, but that didn't seem to work, and I'm not sure if I need to update any other packages.

I'm running Mac OS Catalina 10.15.7.

Let me know if there is any other information I can provide.

Thank you for your help!

Best, Irene

TypeError                                 Traceback (most recent call last)
/var/folders/1y/50t5_k054252fqb5fv948mb00000gn/T/ipykernel_1612/2005335749.py in <module>
      3 sm = SAMAP(
      4         sams,
----> 5         f_maps = 'example_data/maps/',
      6     )

~/Dropbox (Personal)/UCLA/Scripts/SAMap/samap_directory_v0.3.4/samap/mapping.py in __init__(self, sams, f_maps, names, keys, resolutions, gnnm, save_processed)
    152 
    153             if "PCs_SAMap" not in sam.adata.varm.keys():
--> 154                 prepare_SAMap_loadings(sam)
    155 
    156             if save_processed and isinstance(data,str):

~/Dropbox (Personal)/UCLA/Scripts/SAMap/samap_directory_v0.3.4/samap/mapping.py in prepare_SAMap_loadings(sam, npcs)
   1277         sparse_pca=True,
   1278         update_manifold=False,
-> 1279         weight_mode='dispersion'
   1280     )
   1281     sam.adata.varm["PCs_SAMap"] = A

~/opt/anaconda3/envs/SAMap/lib/python3.7/site-packages/samalg/__init__.py in calculate_nnm(self, n_genes, preprocessing, npcs, num_norm_avg, weight_PCs, sparse_pca, update_manifold, weight_mode, seed, components, first)
   1149                 m = self.adata.var['means'].values[gkeep]*W[gkeep]
   1150                 no = (m/v**0.5) if preprocessing=='StandardScaler' else D_sub.mean(0).A.flatten()
-> 1151                 output = ut._pca_with_sparse(D_sub, npcs,mu = (no)[None,:], seed = seed)
   1152                 self.components = output['components']
   1153                 g_weighted = output['X_pca']

~/opt/anaconda3/envs/SAMap/lib/python3.7/site-packages/samalg/utilities.py in _pca_with_sparse(X, npcs, solver, mu, seed)
     83         shape=X.shape,
     84         rmatvec=rmatvec,
---> 85         rmatmat=rmatmat,
     86     )
     87 

TypeError: __init__() got an unexpected keyword argument 'rmatmat'
itliao commented 3 years ago

Hi again - I think I might have had issue in my previous virtual environment, so I just recreated a separate environment and reinstalled everything, and the error went away.