Description Usage Arguments Value Examples
A function to take a matrix/dataframe of gene expression data and return a dataframe suitable for plotting as an MDS plot with ggplot2
1 | mdsArrange(d, isAlreadyScaled = FALSE)
|
d |
is a dataframe of gene expression data |
isAlreadyScaled |
Logical value for whether d is already scaled |
A dataframe compatible with ggplot2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #Using the NKI dataset
library(breastCancerNKI)
library(Biobase)
data(nki)
mtx <- exprs(nki)
#Calculate PCs 1 & 2
mds_dfr <- mdsArrange(d = mtx, isAlreadyScaled = TRUE)
#Merge with phenotypic data for plotting
mds_mrg <- merge(mds_dfr, pData(nki), by = 0)
#Plot MDS and colour by estrogen receptor positivity
library(ggplot2)
ggplot(mds_mrg, aes(x = x, y = y, colour = as.factor(er))) +
geom_point()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.