clusVarAnalysis(icaSet, params, resClus, keepVar, keepComp, funClus = "", adjustBy = c("none", "component", "variable"), method = "BH", doPlot = FALSE, cutoff = params["pvalCutoff"], path = paste(resPath(params), "clus2var/", sep = ""), onlySign = TRUE, typeImage = "png", testBy = c("variable", "level"), filename)
IcaSet
MineICAParams
providing the parameters of the analysisicaSet
. The
names of the list must correspond to the component
indices.varLabels(icaSet)
.indComp(icaSet)
to be considered, if missing all
components are used."none"
if no p-value correction has to be
done, "component"
if the p-values have to be
corrected by component, "variable"
if the p-values
have to be corrected by variable."variable"
(one test by
variable, default) or by variable "level"
(as many
tests as there are annotation levels).p.adjust
for details, default if
"BH"
for Benjamini & Hochberg.doPlot=TRUE
will be an HTML file else will be a
'txt' file. If missing when doPlot=TRUE
, will be
"clusVar".doPlot=TRUE
, default is
'cluster2annot/'
.doPlot=TRUE
, this function writes an HTML
file containing the results of the tests as a table of
dimension 'variable levels x components' which contains
the p-values of the tests. When a p-value is considered
as significant according to the threshold cutoff
,
it is written in bold and filled with a link pointing to
the corresponding barplot displaying the distribution of
the clusters across the levels of the variables. One image is created by plot and located into the
sub-directory "plots/" of path
. Each image is
named by index-of-component_var.png
clusterSamplesByComp
## load an example of IcaSet
data(icaSetCarbayo)
## build object of class MineICAParams
params <- buildMineICAParams(resPath="carbayo/")
## cluster samples according to the columns of the mixing matrix A with kmeans in 2 groups
resClus <- clusterSamplesByComp(icaSet=icaSetCarbayo, params=params, funClus="kmeans",
clusterOn="A", nbClus=2)$clus
## specify directory for the function outputs (here same directory as the default one)
## this directory will be created by the function in resPath(params)
dir <- "clus2var/"
## compute chi-square tests of association, p-value are not adjusted (adjustBy="none"),
# test results are written in txt format (doPlot=FALSE and filename not missing)
resChi <- clusVarAnalysis(icaSet=icaSetCarbayo, params=params, resClus=resClus, funClus="kmeans",
adjustBy="none", doPlot=FALSE, path=dir, filename="clusVarTests")
## Not run:
# ## compute chi-square tests of association, p-value are not adjusted (adjustBy="none"),
# # write results and plots in HTML files (doPlot=TRUE)
# resChi <- clusVarAnalysis(icaSet=icaSetCarbayo, params=params, resClus=resClus, funClus="kmeans",
# path=dir, adjustBy="none", doPlot=TRUE, filename="clusVarTests")
#
# ## compute chi-square tests of association by only considering a subset of components and variables,
# # adjust p-values by component (adjustBy="component"),
# # do not write results (doPlot=FALSE and filename is missing).
# resChi <- clusVarAnalysis(icaSet=icaSetCarbayo, params=params, resClus=resClus, keepComp = 1:10,
# keepVar=c("GENDER","STAGE"), funClus="kmeans", adjustBy="none",
# doPlot=FALSE)
# ## End(Not run)
Run the code above in your browser using DataLab