R: Histograms of sample contributions for each annotation level
plotPosAnnotInComp
R Documentation
Histograms of sample contributions for each annotation level
Description
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.
The variable labels to be considered, i.e
a subset of the column labels of the pheno data of icaSet
available in (varLabels(icaSet))
keepComp
A subset of components available in
indComp(icaSet); by default, all components are
used
keepSamples
A subset of samples, must be available
in sampleNames(icaSet); by default, all samples
are used
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
clusterSamplesByComp, which consists of sample
clustering applied to matrix A of argument icaSet.
If missing, the clustering is performed by the function.
funClus
The clustering method to be used, either
"Mclust" or "kmeans". If resClus is
not missing, equals resClus$funClus.
nbClus
If resClus is missing, it provides
the number of clusters to be computed by funClus,
default is 2
by
Either "annot" to plot the histograms of
each variable across all components, or
"component" to plot the histograms for each
component across variables. When by="annot" one
pdf file is created by variable name, while when
annot="component", one pdf file is created by
component.
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
hist
Details
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".
Value
NULL
Author(s)
Anne Biton
See Also
plotPosSamplesInComp, chisq.test
Examples
## 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)