llrs / experDesign
Showing 2 of 2 files from the diff.

@@ -20,10 +20,17 @@
Loading
20 20
#' index
21 21
design <- function(pheno, size_subset, omit = NULL, iterations = 500,
22 22
                   name = "SubSet") {
23 +
  stopifnot(is.numeric(size_subset) && is.finite(size_subset))
24 +
  stopifnot(length(dim(pheno)) == 2)
25 +
  stopifnot(is.numeric(iterations) && is.finite(iterations))
26 +
  stopifnot(is.character(name))
23 27
  opt <- Inf
24 28
25 29
  # Calculate batches
26 30
  size_data <- nrow(pheno)
31 +
  if (size_subset >= size_data) {
32 +
    stop("All the data can be done in one batch.", call. = FALSE)
33 +
  }
27 34
  batches <- optimum_batches(size_data, size_subset)
28 35
29 36
  if (!valid_sizes(size_data, size_subset, batches)) {
@@ -86,9 +93,14 @@
Loading
86 93
#' head(index)
87 94
replicates <- function(pheno, size_subset, controls, omit = NULL,
88 95
                       iterations = 500){
89 -
  stopifnot(is.numeric(size_subset))
90 -
  stopifnot(is.numeric(controls))
96 +
  stopifnot(is.numeric(size_subset) && is.finite(size_subset))
97 +
  stopifnot(length(dim(pheno)) == 2)
98 +
  stopifnot(is.numeric(iterations) && is.finite(iterations))
91 99
100 +
  size_data <- nrow(pheno)
101 +
  if (size_subset >= size_data) {
102 +
    stop("All the data can be done in one batch.", call. = FALSE)
103 +
  }
92 104
  if (size_subset < controls) {
93 105
    stop("The controls are technical controls for the batches.\n\t",
94 106
         "They cannot be above the number of samples per batch.", call. = FALSE)

@@ -19,6 +19,9 @@
Loading
19 19
spatial <- function(index, pheno, omit = NULL, remove_positions = NULL, rows = LETTERS[1:5],
20 20
         columns = 1:10, iterations = 500) {
21 21
22 +
  stopifnot(length(dim(pheno)) == 2)
23 +
  stopifnot(is.numeric(iterations) && is.finite(iterations))
24 +
22 25
  nrow <- length(rows)
23 26
  ncol <- length(columns)
24 27
@@ -33,6 +36,7 @@
Loading
33 36
         "\n\tPlease check the rows and columns or how you created the index.",
34 37
         call. = FALSE)
35 38
  }
39 +
36 40
  plate <- matrix(nrow = nrow, ncol = ncol, dimnames = list(rows, columns))
37 41
  positions <- position_name(rows, columns)
38 42
  if (any(!remove_positions %in% positions$name)) {
Files Coverage
R 89.04%
Project Totals (11 files) 89.04%
1
comment: false
2

3
coverage:
4
  status:
5
    project:
6
      default:
7
        target: auto
8
        threshold: 1%
9
    patch:
10
      default:
11
        target: auto
12
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading