K-means clustering needs a given number of groups, which is difficult to
guess in most of the cases. This function calculates the Figure of
Merit values for different number of groups and generates the FOM
plot (FOM value versus number of groups). Lower FOM value means
better grouping. User can decide the number of groups in kmeans
cluster based on that result.
Usage
fom(anovaobj, idx.gene, term, ngroups)
Arguments
anovaobj
An object of class maanova.
idx.gene
The index of genes to be clustered.
term
The factor (in formula) used in clustering. The expression
level for this term will be used in clustering. This term has to
correspond to the gene list, e.g, idx.gene in this function. The
gene list should be the significant hits in testing this term.
ngroups
The number of groups for K-means cluster. This could be
a vector or an integer.
Value
A vector of FOM values for the given number of groups
Author(s)
Hao Wu
References
Yeung, K.Y., D.R. Haynor, and W.L.Ruzzo (2001). Validating clustering
for gene expression data. Bioinformatics, 17:309-318.
See Also
macluster,
consensus,
kmeans
Examples
# load in data
data(abf1)
# fit the anova model
## Not run:
fit.fix = fitmaanova(abf1,formula = ~Strain)
# test Strain effect
test.fix = matest(abf1, fit.fix, term="Strain",n.perm= 1000)
# pick significant genes - pick the genes selected by Fs test
idx <- volcano(test.fix)$idx.Fs
# generate FOM
m <- fom(fit.fix, idx, "Strain", 10)
## End(Not run)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(maanova)
Attaching package: 'maanova'
The following object is masked from 'package:base':
norm
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/maanova/fom.Rd_%03d_medium.png", width=480, height=480)
> ### Name: fom
> ### Title: Figure of Merit
> ### Aliases: fom
> ### Keywords: models
>
> ### ** Examples
>
> # load in data
> data(abf1)
> # fit the anova model
> ## Not run:
> ##D fit.fix = fitmaanova(abf1,formula = ~Strain)
> ##D # test Strain effect
> ##D test.fix = matest(abf1, fit.fix, term="Strain",n.perm= 1000)
> ##D # pick significant genes - pick the genes selected by Fs test
> ##D idx <- volcano(test.fix)$idx.Fs
> ##D # generate FOM
> ##D m <- fom(fit.fix, idx, "Strain", 10)
> ## End(Not run)
>
>
>
>
>
> dev.off()
null device
1
>