plotDensAllAnnotInAllComp {MineICA} | R Documentation

## Tests if groups of samples are differently distributed on the components according and do the corresponding plots.

### Description

This function tests if the groups of samples formed by the variables (i.e sample annotations) are differently distributed on the components, in terms of contribution value (i.e of values in matrix `A(icaSet)`). The distribution of the groups on the components are represented using density plots. It is possible to restrict the tests and the plots to a subset of samples and/or components.

### Usage

      plotDensAllAnnotInAllComp(icaSet, params, path,
        keepVar = NULL, keepComp, samples,
        legend.title_list = NULL,
        colours = params["annot2col"], doPlot = TRUE,
        pval.cutoff = params["pvalCutoff"], typeImage = "png",
        filename = NULL, onlySign = TRUE)

### Arguments

`icaSet` | an object of class `IcaSet`
`params` | An object of the class `MineICAParams` containing the parameters of the analysis
`path` | the directory where the plots will be located
`keepVar` | The variable labels to be considered, i.e a subset of (`varLabels(icaSet)`)
`samples` | a subset of sample names available in `samplenames(icaSet)`, if NULL (default) all samples are used
`keepComp` | a subset of components available in `indComp(icaSet)`, if NULL (default) all components are used
`legend.title_list` | A list of titles for each component, indexed by elements of argument `keepVar`, default is NULL
`colours` | A vector of colours indexed by the variable levels, if missing the colours are automatically generated using `annot2Color`
`doPlot` | if TRUE (default), the plots are drawn, else if FALSE only the tests are performed
`pval.cutoff` | The threshold p-value for statistical significance
`typeImage` | The type of image file where each plot is saved
`filename` | A file where the results will be displayed in format HTML, if NULL no file is created
`onlySign` | if TRUE (default), only the significant results are plotted

### Details

This function writes an HTML file containing the results of the tests and links to the corresponding density plots. One png image is created by plot and located in the sub-directory plots of `path`. Each image is named by index-of-component_var.png. Wilcoxon or Kruskal-Wallis tests are applied depending on the number of groups of interest from the considered annotation (argument `keepLev`).

### Value

Returns a data.frame of dimensions 'components x variables' containing the p-values of the non-parametric tests (Wilcoxon or Kruskal-Wallis tests) wich test if the samples groups defined by each variable are differently distributed on the components

### Author(s)

Anne Biton

### See Also

`wilcoxOrKruskalOnA`, `writeHtmlResTestsByAnnot`, `plotDensOneAnnotInAllComp`

### Examples

    ## Not run:
    ## load an example of IcaSet
    data(icaSetCarbayo)
    ## have a look at the sample annotations which are available
    varLabels(icaSetCarbayo)
    ## create parameters, specifying the result path
    params <- buildMineICAParams(resPath="carbayo/")

    ## trace the contributions of the samples according to their cancer stages and gender on the components
    ## make sure the arg 'path' exists in the directory contained in resPath(params)!
    restests <- plotDensAllAnnotInAllComp(icaSet=icaSetCarbayo, keepVar=c("stage","SEX"),
                                          params=params, path="testPlotDens")

    ## End(Not run)

[Package MineICA version 1.34.0 Index]