Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/functions_comp2annot.R
This function plots the positions of groups of samples
formed by the variables (i.e the sample annotations)
across all the components of an object of class
icaSet
. For each
variable level (e.g for each tumor stage) this function
plots the positions of the corresponding samples (e.g the
subset of samples having this tumor stage) within the
histogram of the global sample contributions. The plots
are saved in pdf file, one file is created per variable.
The pdf files are names 'variable.pdf' and save either in
pathPlot
if specified or the current directory.
1 2 3 4 5 6 7 8 | plotPosAnnotInComp(icaSet, params,
keepVar = varLabels(icaSet),
keepComp = indComp(icaSet),
keepSamples = sampleNames(icaSet), pathPlot = NULL,
breaks = 20, colAll = "grey74", colSel, resClus,
funClus = c("Mclust", "kmeans"), nbClus = 2,
by = c("annot", "component"),
typeImage = c("pdf", "png", "none"), ...)
|
icaSet |
An object of class |
params |
A |
keepVar |
The variable labels to be considered, i.e
a subset of the column labels of the pheno data of icaSet
available in ( |
keepComp |
A subset of components available in
|
keepSamples |
A subset of samples, must be available
in |
pathPlot |
A character specifying the path where the plots will be saved |
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
|
funClus |
The clustering method to be used, either
|
nbClus |
If |
by |
Either |
typeImage |
The type of image to be created, either "pdf" (default) or "png". "png" is not recommended, unless there are at the most 4 histograms to be plotted, because it does not allow to deal with multiple pages of plots. |
... |
Additional parameters for function
|
The plotted values are the sample contributions across
the components, i.e across the columns of
A(icaSet)
.
If argument resClus
is missing, the function
computes the clustering of the samples on each component
(i.e on each column of A(icaSet)
) using
funClus
and nbClus
.
The association between the clusters and the considered sample group is tested using a chi-square test. The p-values of these tests are available in the title of each plot.
When by="annot"
this function plots the histograms
of each variable across all components, to plot the
histograms for each component across variables, please
use by="component"
.
NULL
Anne Biton
plotPosSamplesInComp
, chisq.test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
## load an example of IcaSet
data(icaSetCarbayo)
## Use icaSetCarbayo, look at the available annotations
varLabels(icaSetCarbayo)
## Plot positions of samples in components according to annotations 'SEX' and 'STAGE'
# plots are saved in files SEX.pdf and STAGE.pdf created in the current directory
plotPosAnnotInComp(icaSet=icaSetCarbayo, keepVar=c("SEX","STAGE"), keepComp=1:2, funClus="Mclust")
# specifiy arg 'pathPlot' to save the pdf in another directory, but make sure it exists before
# specifiy arg 'by="comp"' to create one pdf file per component
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.