UMAP
This commit is contained in:
parent
fb9b7b8e5e
commit
42ce871e52
@ -106,3 +106,23 @@ TOMplot(g1.TOM, lap_tree1, main=paste(g1.netname, " Heatmap Plot"))
|
|||||||
TOMplot(g2.TOM, lap_tree2, main=paste(g2.netname, " Heatmap Plot"))
|
TOMplot(g2.TOM, lap_tree2, main=paste(g2.netname, " Heatmap Plot"))
|
||||||
|
|
||||||
################################ Part 5: UMAP ################################
|
################################ Part 5: UMAP ################################
|
||||||
|
g1.dist2 <- 1- as.matrix(g1.adj)
|
||||||
|
g2.dist2 <- 1- as.matrix(g2.adj)
|
||||||
|
|
||||||
|
# first cluster with hierarchical clustering
|
||||||
|
|
||||||
|
g1.tree2 <- hclust(as.dist(g1.dist2), method = "average")
|
||||||
|
g2.tree2 <- hclust(as.dist(g2.dist2), method = "average")
|
||||||
|
|
||||||
|
g1.tree2.2clust <- cutree(g1.tree2,k=2) # predicted 2-clusters
|
||||||
|
g2.tree2.2clust <- cutree(g2.tree2,k=2) # predicted 2-clusters
|
||||||
|
|
||||||
|
#g1.tree2$labels <- V(g1)[Faction] # true clusters
|
||||||
|
#g2.tree2$labels <- V(g2)[Faction] # true clusters
|
||||||
|
g1.tree2$labels <- g1.tree2.2clust
|
||||||
|
g2.tree2$labels <- g2.tree2.2clust
|
||||||
|
|
||||||
|
# if you want to label tree with predicted clusters
|
||||||
|
plot(g1.tree2, main = paste(g1.netname, " HClust"))
|
||||||
|
plot(g2.tree2, main = paste(g2.netname, " HClust"))
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user