Description Usage Arguments Details Value See Also Examples

Calculate EMD score for a single gene

1 | ```
calculate_emd_gene(vec, outcomes, sample_names, binSize = 0.2)
``` |

`vec` |
A named vector containing data (e.g. expression data) for a single gene. Names ought to correspond to samples. |

`outcomes` |
A vector of group labels for the samples. The names must correspond
to the names of |

`sample_names` |
A character vector with the names of the samples in |

`binSize` |
The bin size to be used when generating histograms for each of the groups. |

All possible combinations of the classes are used as pairwise comparisons.
The data in `vec`

is divided based on class labels based on the `outcomes`

identifiers given. For each pairwise computation, the `hist`

function is
used to generate histograms for the two groups. The densities are then retrieved
and passed to `emd2d`

to compute the pairwise EMD score. The
total EMD score for the given data is the average of the pairwise EMD scores.

The emd score is returned.

1 2 3 4 5 6 7 8 9 10 | ```
# 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)
calculate_emd_gene(dat[1,], outcomes, colnames(dat))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.