colomemaria / epiScanpy

Episcanpy: Epigenomics Single Cell Analysis in Python
BSD 3-Clause "New" or "Revised" License
140 stars 33 forks source link

Bug in silhouette score calculation #134

Open dhananjay-srivastava opened 1 year ago

dhananjay-srivastava commented 1 year ago

silhoutte score calculation does nt work, there is a bug in the code, it should be labels not label

epi.tl.silhouette(adata,'louvain')


TypeError Traceback (most recent call last) in ----> 1 epi.tl.silhouette(adata,'louvain')

/usr/local/lib/python3.9/dist-packages/episcanpy/tools/_silhouette.py in silhouette(adata_name, cluster_annot, value, metric, key_added, copy) 46 47 ## also, return sample_silhouette_values as adata.obs['silhouette_samples'] ---> 48 silhouette_avg = silhouette_score(X=X, label=cluster_labels, metric=metric) 49 sample_silhouette_values = silhouette_samples(X=X, label=cluster_labels, metric=metric) 50

TypeError: silhouette_score() missing 1 required positional argument: 'labels'

It should be labels not label in silhouette_score and silhouette_samples