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

How to do Hierarchical Clustering in R like use web results? #10

Open
yubau1112 opened this issue Feb 22, 2022 · 1 comment
Open

How to do Hierarchical Clustering in R like use web results? #10

yubau1112 opened this issue Feb 22, 2022 · 1 comment

Comments

@yubau1112
Copy link

yubau1112 commented Feb 22, 2022

Hi, I used

morpheus
https://software.broadinstitute.org/morpheus/

It's a good tool to make heatmap!

but I need to automatically generate pictures.

So, I used

Morpheus.js-based heat map widget in R.
https://github.com/cmap/morpheus.R

but how to do "Hierarchical Clustering" in R

I want to use
Hierarchical Clustering

1. Metric One minus spearman rank correlation 
2. Linkage method Complete 
3. Cluster Columns and Rows

My command:

myfun <- function(x) hclust(as.dist(1-cor(t(as.matrix(x)),
                                          method = "spearman")), method = "complete")

morpheus(x, colorScheme=list(scalingMode="relative", colors=c('blue','White','red')),
         dendrogram = 'both',
         rowSize = 6,
         columnSize = 6,
         hclustfun = myfun),
         #tools=list(list(name='Hierarchical Clustering',
         #               params=list(group_rows_by=list('annotation2'), cluster='Rows and columns'))),
         columnAnnotations =columnAnnotations , overrideRowDefaults=FALSE,
         rows=list(list(field=list('annotation1'), highlightMatchingValues=FALSE, display=list('color'))))

But heatmap different with web results

how to do Hierarchical Clustering in R like use web model results?

thanks!

yubau

@yubau1112 yubau1112 changed the title How to do Hierarchical Clustering in R like use web model results? How to do Hierarchical Clustering in R like use web results? Feb 22, 2022
@joshua-gould
Copy link
Contributor

Morpheus.R uses R code to perform clustering so the results will differ from the website which uses JavaScript. If you want identical clustering results to the JavaScript implementation, please use https://github.com/cmap/morpheus-export

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