... | ... |
@@ -77,7 +77,7 @@ |
77 | 77 |
This function plots the positions of groups of samples |
78 | 78 |
formed by the variables (i.e the sample annotations) |
79 | 79 |
across all the components of an object of class |
80 |
- \code{\link[MineICA:IcaSet-class]{icaSet}}. For each |
|
80 |
+ \code{\link[MineICA:class-IcaSet]{icaSet}}. For each |
|
81 | 81 |
variable level (e.g for each tumor stage) this function |
82 | 82 |
plots the positions of the corresponding samples (e.g the |
83 | 83 |
subset of samples having this tumor stage) within the |
git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/MineICA@73179 bc3139a8-67e5-0310-9ffc-ced21a209358
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,130 @@ |
1 |
+\name{plotPosAnnotInComp} |
|
2 |
+\alias{plotPosAnnotInComp} |
|
3 |
+\title{Histograms of sample contributions for each annotation level} |
|
4 |
+\usage{ |
|
5 |
+ plotPosAnnotInComp(icaSet, params, |
|
6 |
+ keepVar = varLabels(icaSet), |
|
7 |
+ keepComp = indComp(icaSet), |
|
8 |
+ keepSamples = sampleNames(icaSet), pathPlot = NULL, |
|
9 |
+ breaks = 20, colAll = "grey74", colSel, resClus, |
|
10 |
+ funClus = c("Mclust", "kmeans"), nbClus = 2, |
|
11 |
+ by = c("annot", "component"), |
|
12 |
+ typeImage = c("pdf", "png", "none"), ...) |
|
13 |
+} |
|
14 |
+\arguments{ |
|
15 |
+ \item{icaSet}{An object of class \code{IcaSet}} |
|
16 |
+ |
|
17 |
+ \item{params}{A \code{MineICAParams} object} |
|
18 |
+ |
|
19 |
+ \item{keepVar}{The variable labels to be considered, i.e |
|
20 |
+ a subset of the column labels of the pheno data of icaSet |
|
21 |
+ available in (\code{varLabels(icaSet)})} |
|
22 |
+ |
|
23 |
+ \item{keepComp}{A subset of components available in |
|
24 |
+ \code{indComp(icaSet)}; by default, all components are |
|
25 |
+ used} |
|
26 |
+ |
|
27 |
+ \item{keepSamples}{A subset of samples, must be available |
|
28 |
+ in \code{sampleNames(icaSet)}; by default, all samples |
|
29 |
+ are used} |
|
30 |
+ |
|
31 |
+ \item{pathPlot}{A character specifying the path where the |
|
32 |
+ plots will be saved} |
|
33 |
+ |
|
34 |
+ \item{breaks}{The number of breaks to be used in the |
|
35 |
+ histograms} |
|
36 |
+ |
|
37 |
+ \item{colSel}{The colour of the histogram of the group of |
|
38 |
+ interest, default is "red"} |
|
39 |
+ |
|
40 |
+ \item{colAll}{The colour of the global histogram, default |
|
41 |
+ is "grey74"} |
|
42 |
+ |
|
43 |
+ \item{resClus}{A list containing the outputs of function |
|
44 |
+ \code{clusterSamplesByComp}, which consists of sample |
|
45 |
+ clustering applied to matrix A of argument \code{icaSet}. |
|
46 |
+ If missing, the clustering is performed by the function.} |
|
47 |
+ |
|
48 |
+ \item{funClus}{The clustering method to be used, either |
|
49 |
+ \code{"Mclust"} or \code{"kmeans"}. If \code{resClus} is |
|
50 |
+ not missing, equals \code{resClus$funClus}.} |
|
51 |
+ |
|
52 |
+ \item{nbClus}{If \code{resClus} is missing, it provides |
|
53 |
+ the number of clusters to be computed by \code{funClus}, |
|
54 |
+ default is 2} |
|
55 |
+ |
|
56 |
+ \item{by}{Either \code{"annot"} to plot the histograms of |
|
57 |
+ each variable across all components, or |
|
58 |
+ \code{"component"} to plot the histograms for each |
|
59 |
+ component across variables. When \code{by="annot"} one |
|
60 |
+ pdf file is created by variable name, while when |
|
61 |
+ \code{annot="component"}, one pdf file is created by |
|
62 |
+ component.} |
|
63 |
+ |
|
64 |
+ \item{typeImage}{The type of image to be created, either |
|
65 |
+ "pdf" (default) or "png". "png" is not recommended, |
|
66 |
+ unless there are at the most 4 histograms to be plotted, |
|
67 |
+ because it does not allow to deal with multiple pages of |
|
68 |
+ plots.} |
|
69 |
+ |
|
70 |
+ \item{...}{Additional parameters for function |
|
71 |
+ \code{\link{hist}}} |
|
72 |
+} |
|
73 |
+\value{ |
|
74 |
+ NULL |
|
75 |
+} |
|
76 |
+\description{ |
|
77 |
+ This function plots the positions of groups of samples |
|
78 |
+ formed by the variables (i.e the sample annotations) |
|
79 |
+ across all the components of an object of class |
|
80 |
+ \code{\link[MineICA:IcaSet-class]{icaSet}}. For each |
|
81 |
+ variable level (e.g for each tumor stage) this function |
|
82 |
+ plots the positions of the corresponding samples (e.g the |
|
83 |
+ subset of samples having this tumor stage) within the |
|
84 |
+ histogram of the global sample contributions. The plots |
|
85 |
+ are saved in pdf file, one file is created per variable. |
|
86 |
+ The pdf files are names 'variable.pdf' and save either in |
|
87 |
+ \code{pathPlot} if specified or the current directory. |
|
88 |
+} |
|
89 |
+\details{ |
|
90 |
+ The plotted values are the sample contributions across |
|
91 |
+ the components, i.e across the columns of |
|
92 |
+ \code{A(icaSet)}. |
|
93 |
+ |
|
94 |
+ If argument \code{resClus} is missing, the function |
|
95 |
+ computes the clustering of the samples on each component |
|
96 |
+ (i.e on each column of \code{A(icaSet)}) using |
|
97 |
+ \code{funClus} and \code{nbClus}. |
|
98 |
+ |
|
99 |
+ The association between the clusters and the considered |
|
100 |
+ sample group is tested using a chi-square test. The |
|
101 |
+ p-values of these tests are available in the title of |
|
102 |
+ each plot. |
|
103 |
+ |
|
104 |
+ When \code{by="annot"} this function plots the histograms |
|
105 |
+ of each variable across all components, to plot the |
|
106 |
+ histograms for each component across variables, please |
|
107 |
+ use \code{by="component"}. |
|
108 |
+} |
|
109 |
+\examples{ |
|
110 |
+\dontrun{ |
|
111 |
+## load an example of IcaSet |
|
112 |
+data(icaSetCarbayo) |
|
113 |
+ |
|
114 |
+## Use icaSetCarbayo, look at the available annotations |
|
115 |
+varLabels(icaSetCarbayo) |
|
116 |
+ |
|
117 |
+## Plot positions of samples in components according to annotations 'SEX' and 'STAGE' |
|
118 |
+# plots are saved in files SEX.pdf and STAGE.pdf created in the current directory |
|
119 |
+plotPosAnnotInComp(icaSet=icaSetCarbayo, keepVar=c("SEX","STAGE"), keepComp=1:2, funClus="Mclust") |
|
120 |
+# specifiy arg 'pathPlot' to save the pdf in another directory, but make sure it exists before |
|
121 |
+# specifiy arg 'by="comp"' to create one pdf file per component |
|
122 |
+} |
|
123 |
+} |
|
124 |
+\author{ |
|
125 |
+ Anne Biton |
|
126 |
+} |
|
127 |
+\seealso{ |
|
128 |
+ \code{\link{plotPosSamplesInComp}}, \code{chisq.test} |
|
129 |
+} |
|
130 |
+ |