n_clusters parameter
Thank you for providing this analysis tool!
I am using the latest version of rastermap (in jupyter notebook) and I'm wondering if the option for 'n_clusters = None' is still available for sorting individual neurons? In the demo notebook (google collab) it works, but I get the following error when I set to 'None' or '0' for my analysis (values 1-200 work fine for me, but I'd like to sort individually for some of my smaller datasets).
ValueError Traceback (most recent call last) Cell In[12], line 9 6 from rastermap import Rastermap, utils 8 #defaults based on large recording >30,000 neurons ----> 9 model = Rastermap(n_clusters=None, #default = 100 10 n_PCs=64, # default = 128 number of PCs to use; use fewer than # neurons 11 locality=0.1, # locality (this is a value from 0-1) 12 grid_upsample=0, # default value = 10 13 time_lag_window=5 # time at which to correlate clusters (at 0 = instantaneous, or if clusters are better correlated in sequence) 14 ).fit(dFdivF0_z) 15 cc_nodes = model.cc.copy() # Extract node positions 16 y = model.embedding # neurons x 1
File ~\anaconda3\envs\rastermap\lib\site-packages\rastermap\rastermap.py:364, in Rastermap.fit(self, data, Usv, Vsv, U_nodes, itrain, compute_X_embedding, BBt) 362 imax = np.arange(0, U_nodes.shape[0]) 363 elif self.n_clusters is None: --> 364 raise ValueError("n_clusters set to None") 365 elif self.n_clusters >= 200: 366 raise ValueError("n_clusters cannot be greater than 200")
ValueError: n_clusters set to None
This might because of the orignal cluster number is larger than 200 and in this case, rastermap suggests to cluster first