-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The higher dimensions of LMDS have a higher scale in comparison to MDS and PCA. Determine whether this is a problem and whether it needs to be solved.
Example code
library(tidyverse)
library(dyno)
data("fibroblast_reprogramming_treutlein")
expr <- fibroblast_reprogramming_treutlein$expression
rownames(expr) <- colnames(expr) <- NULL
pca <- prcomp(expr, rank. = 40)$x %>% dynutils::scale_uniform()
pheatmap::pheatmap(pca, border_color = NA, cluster_cols = FALSE)
mds <- cmdscale(dynutils::calculate_distance(expr, method = "spearman"), k = 40) %>%
dynutils::scale_uniform()
pheatmap::pheatmap(mds, border_color = NA, cluster_cols = FALSE)
lmds <- lmds::lmds(expr, distance_method = "spearman", ndim = 40, num_landmarks = 100) %>%
dynutils::scale_uniform()
pheatmap::pheatmap(lmds, border_color = NA, cluster_cols = FALSE)
colnames(pca) <- colnames(mds) <- colnames(lmds) <- NULL
df <- bind_rows(
pca %>% reshape2::melt(varnames = c("row", "comp")) %>% mutate(dimred = "PCA"),
mds %>% reshape2::melt(varnames = c("row", "comp")) %>% mutate(dimred = "MDS"),
lmds %>% reshape2::melt(varnames = c("row", "comp")) %>% mutate(dimred = "LMDS")
)
ggplot(df) +
geom_point(aes(comp, value, colour = dimred)) +
facet_wrap(~dimred) +
theme_bw()
ggsave("~/plot.png", width = 12, height = 4)
Metadata
Metadata
Assignees
Labels
No labels