No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
a328d3d
... +18 ...
330fd39
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
3 | 3 | #' Given the index and the data of the samples append the batch assignment |
|
4 | 4 | #' @param i List of indices of samples per batch |
|
5 | 5 | #' @param pheno Data.frame with the sample information. |
|
6 | - | #' @param omit Name of the columns of the `pheno` that will be omitted |
|
6 | + | #' @param omit Name of the columns of the `pheno` that will be omitted. |
|
7 | + | #' @param index_name Column name of the index of the resulting data.frame. |
|
7 | 8 | #' @return The data.frame with a new column batch with the name of the batch the sample goes to. |
|
8 | 9 | #' @export |
|
9 | 10 | #' @examples |
13 | 14 | #' iterations = 10) |
|
14 | 15 | #' batches <- inspect(index, survey[, columns]) |
|
15 | 16 | #' head(batches) |
|
16 | - | inspect <- function(i, pheno, omit = NULL) { |
|
17 | + | inspect <- function(i, pheno, omit = NULL, index_name = "batch") { |
|
17 | 18 | batch <- batch_names(i) |
|
19 | + | i <- unlist(i, FALSE, FALSE) |
|
20 | + | i <- sort(i) |
|
21 | + | pheno <- pheno[i, ] |
|
18 | 22 | ||
19 | 23 | # Omit columns |
|
20 | 24 | if (!is.null(omit)) { |
23 | 27 | pheno_o <- pheno |
|
24 | 28 | } |
|
25 | 29 | ||
26 | - | cbind(pheno_o, batch) |
|
30 | + | out <- cbind(pheno_o, batch) |
|
31 | + | colnames(out)[ncol(out)] <- index_name |
|
32 | + | out |
|
27 | 33 | } |
|
28 | 34 | ||
29 | 35 |
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 | 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 | 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 | 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 |
---|---|
QC.R | 90.70% |
designer.R | -1.43% 85.42% |
entropy.R | 100.00% |
evaluate.R | 97.96% |
evaluate_category.R | 100.00% |
evaluate_num.R | 100.00% |
indexing.R | 82.14% |
optimum.R | 86.67% |
reporting.R | +4.46% 85.71% |
spatial.R | 0.82% 81.25% |
utils.R | 83.78% |
Folder Totals (11 files) | 89.18% |
Project Totals (11 files) | 89.18% |
330fd39
e94ad8d
ba28dae
decafbd
185846f
22a18cb
57ea5f6
20c7340
74addd3
e159d41
ad4dd54
f92ecdd
394e9cb
b7ccc59
fea526a
5ec2008
4d41c73
bf39282
8d2f200
a328d3d