Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate the clusters from degPatterns #49

Open
lgallegovillar opened this issue Nov 10, 2021 · 2 comments
Open

Validate the clusters from degPatterns #49

lgallegovillar opened this issue Nov 10, 2021 · 2 comments

Comments

@lgallegovillar
Copy link

Dear Lorena,

I am testing degPatterns() to identify gene clusters exhibiting particular patterns across samples of RNA seq data. I would like to validate the clusters identified by computing silhouette. The results from degPatterns identified 9 clusters. I extracted hr, cutree, and looked at the size of the clusters. However, the sizes of the clusters are different from df. Shouldn´t be equal?
I tried to compute silhouette and the results showed a low ave.sil.width. How would you compute silhouette? I appreciate very much any suggestion.

results_degpatterns <- degPatterns(mydatamatrix, metadata= colData,
time= "Time", plot=T, col="Treatment",
reduce=TRUE, minc = 1)
df <- results_degpatterns$df
table(df$cluster)
1 2 3 4 5 6 7 8 9
1516 1616 68 108 11 135 23 5 6

hr <- results_degpatterns$hr
h_hr = hr$dc
grp <- cutree(as.hclust(hr), h=h_hr)
table(grp)
grp
1 2 3 4 5 6 7 8 9
1581 1645 73 116 13 145 26 6 6

m= 1-cor(t(mydatamatrix), method="kendal")
d= as.dist(m^2)
sihr <- silhouette(cutree(as.hclust(hr), h=h_hr),dist=d)
fviz_silhouette(sihr) #library(factoextra)

cluster size ave.sil.width
1 1 1581 0.15
2 2 1645 0.08
3 3 73 0.19
4 4 116 0.33
5 5 13 0.22
6 6 145 0.24
7 7 26 0.18
8 8 6 0.15
9 9 6 0.12

Thank you in advance,
Lorena Gallego

@lpantano
Copy link
Owner

Hi,
sorry for the delay. Busy week. Can you try with reduce=FALSE, after clustering, there is a function that will reduce outliers over the mean of the cluster expression pattern. For now, that is the one I can think of. Let me know.

@lgallegovillar
Copy link
Author

Thanks a lot, it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants