plotPosSamplesInComp {MineICA} | R Documentation

## Histograms of sample subsets

### Description

This function plots the positions of several groups of samples across all the components of an `icaSet` object.

### Usage

      plotPosSamplesInComp(samplesByGroup, labGroups = NULL,
        icaSet, keepComp = indComp(icaSet), file = NULL,
        breaks = 20, colAll = "grey74", colSel = "red",
        titlesup = "", resClus,
        funClus = c("Mclust", "kmeans"), ...)

### Arguments

`samplesByGroup` | A list whose elements are vector of sample names, these sample names must be available in `sampleNames(icaSet)`. The list should be indexed by the name of the corresponding groups.
`labGroups` | A vector of group names, will be used to add names to `sampleByGroup` if `names(samplesByGroup)` is NULL.
`icaSet` | An object of class `IcaSet`
`keepComp` | A subset of components available in `indComp(icaSet)`, if NULL (default) all components are used
`file` | A pdf file
`breaks` | The number of breaks to be used in the histograms
`colSel` | The colour of the histogram of the group of interest, default is "red"
`colAll` | The colour of the global histogram, default is "grey74"
`resClus` | A list containing the outputs of function `clusterSamplesByComp`, which consists of results of clustering applied to matrix A of argument `icaSet`.
`funClus` | Specifies the clustering method used, either `"Mclust"` or `"kmeans"`. If `resClus` is not missing, equals `resClus$funClus`.
`titlesup` | Additional title for the histograms
`...` | Additional parameters for function `hist`

### Details

For each subgroup of samples this function plots their positions within the histogram of the global sample contributions.

The values of interest are the sample contributions across the components, i.e across the columns `A(icaSet)`.

If argument `resClus` is not missing, the association between the clusters and the sub-groups of samples is tested using a chi-square test. The p-values of these tests are available in the title of each plot.

### Value

NULL

### Author(s)

Anne Biton

### See Also

`hist`, `IcaSet`

### Examples

    ## Not run:
    ## load an example of IcaSet
    data(icaSetCarbayo)

    ## selection of sample groups according to annotations STAGE
    samplesByGroup <- lapply(split(pData(icaSetCarbayo),pData(icaSetCarbayo)[c("STAGE")]), rownames)
    # select groups including at least 2 samples
    samplesByGroup <- samplesByGroup[which(unlist(lapply(samplesByGroup,length))>1)]

    ## clustering of samples according to A using Mclust imposing two Gaussian
    resClus <- clusterSamplesByComp(icaSet=icaSetCarbayo,funClus="Mclust", nbClus=2, clusterOn="A")

    ## Plot positions of the groups in 5th component
    pdf(file="stageOnIC5.pdf", height = 8.267717, width = 29.7/2.54, paper = 'a4r', title="stageOnIC5")
    plotPosSamplesInComp(samplesByGroup=samplesByGroup, icaSet=icaSetCarbayo, funClus="Mclust",
                         resClus = resClus, keepComp=5)
    dev.off()

    ## End(Not run)

[Package MineICA version 1.30.0 Index]