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,146 @@ |
1 |
+\name{plot_heatmapsOnSel} |
|
2 |
+\alias{plot_heatmapsOnSel} |
|
3 |
+\title{Plot heatmap associated with each component} |
|
4 |
+\usage{ |
|
5 |
+ plot_heatmapsOnSel(icaSet, selCutoff = 4, |
|
6 |
+ level = c("features", "genes"), samplesOrder, |
|
7 |
+ featuresOrder, selectionByComp, keepVar, |
|
8 |
+ keepComp = indComp(icaSet), doSamplesDendro = TRUE, |
|
9 |
+ doGenesDendro = TRUE, |
|
10 |
+ heatmapCol = maPalette(low = "blue", high = "red", mid = "yellow", k = 44), |
|
11 |
+ file = "", path = "", annot2col, ...) |
|
12 |
+} |
|
13 |
+\arguments{ |
|
14 |
+ \item{icaSet}{The IcaSet object} |
|
15 |
+ |
|
16 |
+ \item{selCutoff}{A numeric threshold used to select the |
|
17 |
+ contributing genes based on their projection values. Must |
|
18 |
+ be either of length 1 and the same treshold is applied to |
|
19 |
+ all components, or of length equal to the number of |
|
20 |
+ components and one specific threshold is used for each |
|
21 |
+ component.} |
|
22 |
+ |
|
23 |
+ \item{samplesOrder}{A list providing the order of the |
|
24 |
+ samples, per component, to be used in the heatmaps. If |
|
25 |
+ missing, the contribution values of the samples are used |
|
26 |
+ to rank the columns of the heatmaps.} |
|
27 |
+ |
|
28 |
+ \item{featuresOrder}{A list providing the order of the |
|
29 |
+ genes, per component, to be used in the heatmaps. If |
|
30 |
+ missing, the projection values of the genes are used to |
|
31 |
+ rank the rows of the heatmaps.} |
|
32 |
+ |
|
33 |
+ \item{selectionByComp}{A list of gene projections per |
|
34 |
+ component already restricted to the contributing genes, |
|
35 |
+ if missing is computed by the function.} |
|
36 |
+ |
|
37 |
+ \item{level}{A character indicating which data level is |
|
38 |
+ used to plot the heatmaps: either \code{'features'} to |
|
39 |
+ represent the data at the feature levels (e.g expression |
|
40 |
+ profiles of probe sets), or \code{'genes'} to represent |
|
41 |
+ the data at the annotated-features level (e.g gene |
|
42 |
+ expression profiles).} |
|
43 |
+ |
|
44 |
+ \item{keepVar}{The variable labels to be considered, i.e |
|
45 |
+ a subset of the column labels of the pheno data of icaSet |
|
46 |
+ available in (\code{varLabels(icaSet)})} |
|
47 |
+ |
|
48 |
+ \item{keepComp}{A subset of components, must be included |
|
49 |
+ in \code{indComp(icaSet)}. By default, all components are |
|
50 |
+ used.} |
|
51 |
+ |
|
52 |
+ \item{doSamplesDendro}{A logical indicating whether a |
|
53 |
+ hierarchical clustering has to be performed on the data |
|
54 |
+ matrix restricted to the contributing features/genes, and |
|
55 |
+ whether the corresponding dendrogram has to be plotted, |
|
56 |
+ default is TRUE.} |
|
57 |
+ |
|
58 |
+ \item{doGenesDendro}{A logical indicating if the |
|
59 |
+ dendrogram of features/genes has to be plotted, default |
|
60 |
+ is FALSE.} |
|
61 |
+ |
|
62 |
+ \item{heatmapCol}{A list of colors used to for heatmap |
|
63 |
+ coloring (see argument \code{col} of the function |
|
64 |
+ \code{image}).} |
|
65 |
+ |
|
66 |
+ \item{file}{A character to add to each pdf file name. |
|
67 |
+ This function creates one file by component named |
|
68 |
+ "index-of-component_\code{file}.pdf" .} |
|
69 |
+ |
|
70 |
+ \item{path}{A directory for the output pdf files, must |
|
71 |
+ end with "/". Default is current directory.} |
|
72 |
+ |
|
73 |
+ \item{annot2col}{A vector of colours indexed by the |
|
74 |
+ levels of the variables of \code{icaSet} (i.e all the |
|
75 |
+ annotation values available in \code{pData(icaSet)}). If |
|
76 |
+ missing the colours are generated automatically using the |
|
77 |
+ function \code{annot2Color}} |
|
78 |
+ |
|
79 |
+ \item{...}{Additional parameters for function |
|
80 |
+ \code{heatmap.plus}} |
|
81 |
+} |
|
82 |
+\value{ |
|
83 |
+ A list with one element per component, each of them being |
|
84 |
+ a list consisting of three elements: |
|
85 |
+ \describe{\item{x}{the matrix represented by the |
|
86 |
+ heatmap},\item{breaks}{the breaks used for the colours of |
|
87 |
+ the heatmap},\item{dendro}{the dendrogram}.} |
|
88 |
+} |
|
89 |
+\description{ |
|
90 |
+ This function plots the heatmaps representing the |
|
91 |
+ measured values of the contributing features/genes on |
|
92 |
+ each component. It also plots the sample annotations |
|
93 |
+ above each heatmap using colours. |
|
94 |
+} |
|
95 |
+\details{ |
|
96 |
+ This function restricts the data matrix of an |
|
97 |
+ \code{\link{IcaSet}} object to the contributing |
|
98 |
+ genes/features, and order features/genes and samples |
|
99 |
+ either as asked by the user or according to their values |
|
100 |
+ in the ICA decomposition. |
|
101 |
+ |
|
102 |
+ The heatmap is plotted using a slightly modified version |
|
103 |
+ of the function \code{heatmap.plus} from the package of |
|
104 |
+ the same name. By default in this function, the |
|
105 |
+ hierarchical clustering is calculated using the function |
|
106 |
+ \code{\link[cluster]{agnes}} with euclidean metric and |
|
107 |
+ Ward's method. |
|
108 |
+} |
|
109 |
+\examples{ |
|
110 |
+\dontrun{ |
|
111 |
+## load an example of IcaSet object |
|
112 |
+data(icaSetCarbayo) |
|
113 |
+ |
|
114 |
+## check which variables you would like to use in the heatmap |
|
115 |
+varLabels(icaSetCarbayo) |
|
116 |
+keepVar <- c("STAGE","SEX") |
|
117 |
+## Use only component 1 |
|
118 |
+keepComp <- 1 |
|
119 |
+ |
|
120 |
+## For each component, select contributing *genes* using a threshold of 2 on the absolute projection values, |
|
121 |
+## and plot heatmaps of these contributing genes by ordering genes and samples according to their contribution values |
|
122 |
+plot_heatmapsOnSel(icaSet = icaSetCarbayo, selCutoff = 2, level = "genes", keepVar = keepVar, |
|
123 |
+ keepComp=1, doSamplesDendro = TRUE, doGenesDendro = TRUE, |
|
124 |
+ heatmapCol = maPalette(low = "blue",high = "red", mid = "yellow", k=44), |
|
125 |
+ file = "heatmapWithoutDendro_zval3.pdf") |
|
126 |
+ |
|
127 |
+## For each considered component, select contributing *features* using a threshold of 2 on the absolute projection values, |
|
128 |
+## and plot heatmaps of these contributing genes with dendrograms |
|
129 |
+plot_heatmapsOnSel(icaSet = icaSetCarbayo, selCutoff = 2, level = "features", keepVar = keepVar, |
|
130 |
+ keepComp=1, doSamplesDendro = TRUE, doGenesDendro = TRUE, |
|
131 |
+ heatmapCol = maPalette(low = "blue",high = "red", mid = "yellow", k=44), |
|
132 |
+ file = "heatmapWithDendro_zval3.pdf") |
|
133 |
+ |
|
134 |
+ |
|
135 |
+ |
|
136 |
+} |
|
137 |
+} |
|
138 |
+\author{ |
|
139 |
+ Anne Biton |
|
140 |
+} |
|
141 |
+\seealso{ |
|
142 |
+ \code{heatmap.plus}, \code{\link{image}}, |
|
143 |
+ \code{\link{annot2Color}}, |
|
144 |
+ \code{\link{build_sortHeatmap}} |
|
145 |
+} |
|
146 |
+ |