Browse code

Compile and pass check

nilseling authored on 10/03/2020 18:08:10
Showing 5 changed files

... ...
@@ -61,4 +61,5 @@ importFrom(methods,validObject)
61 61
 importFrom(raster,as.raster)
62 62
 importFrom(tools,file_ext)
63 63
 importFrom(utils,packageVersion)
64
+importFrom(viridis,inferno)
64 65
 importFrom(viridis,viridis)
... ...
@@ -5,27 +5,24 @@
5 5
 \title{Function to visualize cell-level information on segmentation masks}
6 6
 \usage{
7 7
 plotCells(
8
-  object,
9 8
   mask,
10
-  cell_id,
11
-  img_id,
9
+  object = NULL,
10
+  cell_id = NULL,
11
+  img_id = NULL,
12 12
   colour_by = NULL,
13 13
   outline_by = NULL,
14 14
   exprs_values = "counts",
15 15
   subset_images = NULL,
16 16
   colour = NULL,
17
-  missing_colour = "gray",
18
-  scale_bar = list(length = 20, label = NULL, cex = 1, lwd = 2, colour = "white", margin = c(10,10)),
19
-  image_title = list(text =  NULL, position = "top", cex = 1, colour = "white", margin = 10, font = 2),
20 17
   ...
21 18
 )
22 19
 }
23 20
 \arguments{
24
-\item{object}{a \code{\linkS4class{SingleCellExperiment}} object.}
25
-
26 21
 \item{mask}{an \code{\linkS4class{ImageList}} object single-channel
27 22
 \code{\linkS4class{Image}} objects (see Details)}
28 23
 
24
+\item{object}{a \code{\linkS4class{SingleCellExperiment}} object.}
25
+
29 26
 \item{cell_id}{character specifying the \code{colData(object)}, in which the
30 27
 integer cell IDs are stored}
31 28
 
... ...
@@ -41,11 +38,7 @@ integer cell IDs are stored}
41 38
 
42 39
 \item{colour}{TODO}
43 40
 
44
-\item{missing_colour}{TODO}
45
-
46
-\item{scale_bar}{TODO}
47
-
48
-\item{...}{TODO}
41
+\item{...}{Further arguments passed to  \code{?"\link{plotting-param}"}}
49 42
 }
50 43
 \value{
51 44
 TODO
... ...
@@ -11,12 +11,10 @@ plotPixels(
11 11
   cell_id = NULL,
12 12
   img_id = NULL,
13 13
   colour_by = NULL,
14
+  bcg = NULL,
14 15
   outline_by = NULL,
15 16
   subset_images = NULL,
16 17
   colour = NULL,
17
-  missing_colour = "gray",
18
-  scale_bar = list(length = 20, label = NULL, cex = 1, lwd = 2, colour = "white", margin = c(10,10)),
19
-  image_title = list(text =  NULL, position = "top", cex = 1, colour = "white", margin = 10, font = 2),
20 18
   ...
21 19
 )
22 20
 }
... ...
@@ -36,17 +34,15 @@ integer cell IDs are stored}
36 34
 
37 35
 \item{colour_by}{TODO}
38 36
 
37
+\item{bcg}{brightness/contrast/gamma list("H3" = c(0,1,1))}
38
+
39 39
 \item{outline_by}{(optional)}
40 40
 
41
-\item{subset_images}{TODO}
41
+\item{subset_images}{TODO Note that Masks and Images need to have same names or same IDs}
42 42
 
43 43
 \item{colour}{TODO}
44 44
 
45
-\item{missing_colour}{TODO}
46
-
47
-\item{scale_bar}{TODO}
48
-
49
-\item{...}{TODO}
45
+\item{...}{Further arguments passed to  \code{?"\link{plotting-param}"}}
50 46
 }
51 47
 \value{
52 48
 TODO
... ...
@@ -4,17 +4,11 @@
4 4
 \alias{plotting-param}
5 5
 \title{Further plotting parameters for the SingleCellMapper package}
6 6
 \arguments{
7
-\item{legend_size}{TODO}
7
+\item{missing_colour}{TODO}
8 8
 
9
-\item{title_size}{TODO}
9
+\item{scale_bar}{TODO}
10 10
 
11
-\item{title_colour}{TODO}
12
-
13
-\item{return_plot}{TODO}
14
-
15
-\item{return_images}{TODO}
16
-
17
-\item{save_images}{TODO}
11
+\item{image_title}{TODO}
18 12
 }
19 13
 \value{
20 14
 TODO
... ...
@@ -25,6 +19,10 @@ TODO
25 19
 \section{Setting further parameters}{
26 20
 
27 21
 TODO
22
+# legend list(title, size) also allow NULL
23
+# return_plot TODO
24
+# return_images TODO
25
+# save_images TODO
28 26
 }
29 27
 
30 28
 \examples{
... ...
@@ -197,6 +197,7 @@ test_that("plotPixels: Cells can be outlined correctly.", {
197 197
 test_that("plotPixels: images can be correctly subsetted.", {
198 198
   data("pancreasSCE")
199 199
   data("pancreasMasks")
200
+  data("pancreasImages")
200 201
 
201 202
   # Works
202 203
   expect_silent(plotPixels(image = pancreasImages,
... ...
@@ -230,7 +231,7 @@ test_that("plotPixels: images can be correctly subsetted.", {
230 231
   expect_silent(plotPixels(image = pancreasImages,
231 232
                            mask = pancreasMasks,
232 233
                            object = pancreasSCE,
233
-                           img_id = "ImageName",
234
+                           img_id = "ImageNb",
234 235
                            cell_id = "CellNb",
235 236
                            colour_by = "SMA",
236 237
                            outline_by = "CellType",
... ...
@@ -367,7 +368,7 @@ test_that("plotPixels: Size of images can be changed.", {
367 368
   # Decreasing the size
368 369
   cur_masks <- pancreasMasks
369 370
   setImages(cur_masks, "A02_mask") <- cur_masks[[1]][1:50, 1:50,,drop=FALSE]
370
-  expect_error(plotPixels(object = cur_sce,
371
+  expect_error(plotPixels(object = pancreasSCE,
371 372
                            image = pancreasImages,
372 373
                            mask = cur_masks, img_id = "ImageNb",
373 374
                            cell_id = "CellNb",
... ...
@@ -379,12 +380,12 @@ test_that("plotPixels: Size of images can be changed.", {
379 380
   cur_images <- pancreasImages
380 381
   setImages(cur_images, "A02_imc") <- cur_images[[1]][1:50, 1:50,,drop=FALSE]
381 382
 
382
-  expect_silent(plotPixels(object = cur_sce,
383
+  expect_silent(plotPixels(object = pancreasSCE,
383 384
                            image = cur_images,
384 385
                            mask = cur_masks, img_id = "ImageNb",
385 386
                            cell_id = "CellNb",
386 387
                            colour_by = "H3", outline_by = "CellType"))
387
-  expect_silent(plotPixels(object = cur_sce,
388
+  expect_silent(plotPixels(object = pancreasSCE,
388 389
                            image = cur_images,
389 390
                            mask = cur_masks, img_id = "ImageNb",
390 391
                            cell_id = "CellNb",