Description Usage Arguments Value See Also Examples
The data for the specified gene is retrieved from
emdobj$data
. outcomes
is used to divide the data into
distributions for each group, which are then visualized as
density distributions. The calculated EMD score for the specified gene is
displayed in the plot title.
1 | plot_emd_density(emdobj, gene_name)
|
emdobj |
An |
gene_name |
The gene to visualize. The name should be defined as a row
name in |
A ggplot
object is returned. If the value is
not assigned, a plot will be drawn.
1 2 3 4 5 6 7 8 9 10 11 | # 100 genes, 100 samples
dat <- matrix(rnorm(10000), nrow=100, ncol=100)
rownames(dat) <- paste("gene", 1:100, sep="")
colnames(dat) <- paste("sample", 1:100, sep="")
# "A": first 50 samples; "B": next 30 samples; "C": final 20 samples
outcomes <- c(rep("A",50), rep("B",30), rep("C",20))
names(outcomes) <- colnames(dat)
results <- calculate_emd(dat, outcomes, nperm=10, parallel=FALSE)
plot_emd_density(results, "gene5")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.