califano-lab / acdc_py

scanpy-compatible suite for automated clustering of scRNA-seq data in python
https://acdc.readthedocs.io/
MIT License
0 stars 0 forks source link

Be able to visualize #clusts vs metric like follows #3

Closed alexanderlewis99 closed 1 month ago

alexanderlewis99 commented 1 month ago

ss = np.zeros(16) k = 0 for i in np.arange(2,18): ss[k] = np.round(acdc.get_opt.GS_metric_value(adata, n_clusts=i),7) k+=1

import seaborn as sns

df = pd.DataFrame({"n_clusts":np.arange(2,18),"ss":ss})

plt.figure(figsize=(8, 6)) sns.scatterplot(x='n_clusts', y='ss', data=df, color='blue', s=100) # Scatter plot plt.plot(df['n_clusts'], df['ss'], color='blue') # Line plot

Add labels and title

plt.xlabel('Number of Clusters') plt.ylabel('SS (Silhouette Score)')

Show the plot

plt.show()

download-1

alexanderlewis99 commented 1 month ago

Resolved by commit c3f5c57