... | ... |
@@ -225,12 +225,10 @@ anno_simple = function(x, col, na_col = "grey", |
225 | 225 |
n = length(index) |
226 | 226 |
y = (n - seq_len(n) + 0.5) / n |
227 | 227 |
if(is.matrix(value)) { |
228 |
+ |
|
228 | 229 |
nc = ncol(value) |
229 |
- if(is.matrix(pch)){ |
|
230 |
- pch = pch[index, , drop = FALSE] |
|
231 |
- } else if(is.vector(pch)) { |
|
232 |
- stop_wrap(paste0("Since annotation is a matrix, pch should also be a matrix") |
|
233 |
- } |
|
230 |
+ pch = pch[index, , drop = FALSE] |
|
231 |
+ |
|
234 | 232 |
for(i in seq_len(nc)) { |
235 | 233 |
fill = map_to_colors(color_mapping, value[index, i]) |
236 | 234 |
grid.rect(x = (i-0.5)/nc, y, height = 1/n, width = 1/nc, |
... | ... |
@@ -262,13 +260,9 @@ anno_simple = function(x, col, na_col = "grey", |
262 | 260 |
n = length(index) |
263 | 261 |
x = (seq_len(n) - 0.5) / n |
264 | 262 |
if(is.matrix(value)) { |
263 |
+ |
|
265 | 264 |
nc = ncol(value) |
266 |
- |
|
267 |
- if(is.matrix(pch)){ |
|
268 |
- pch = pch[index, , drop = FALSE] |
|
269 |
- } else if(is.vector(pch)) { |
|
270 |
- stop_wrap(paste0("Since annotation is a matrix, pch should also be a matrix") |
|
271 |
- } |
|
265 |
+ pch = pch[index, , drop = FALSE] |
|
272 | 266 |
|
273 | 267 |
for(i in seq_len(nc)) { |
274 | 268 |
fill = map_to_colors(color_mapping, value[index, i]) |