diff --git a/DESCRIPTION b/DESCRIPTION index 3aa92b2..024319a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: exSTRa Type: Package Title: Expanded STR algorithm: detecting expansions in Illumina sequencing data -Version: 0.88.0 -Date: 2018-08-31 +Version: 0.88.2 +Date: 2018-09-02 Author: Rick Tankard Maintainer: Rick Tankard Description: Detecting expansions with paired-end Illumina sequencing data. diff --git a/R/private_functions.R b/R/private_functions.R index 5d43973..b493b75 100644 --- a/R/private_functions.R +++ b/R/private_functions.R @@ -383,7 +383,7 @@ make_quantiles_matrix <- function(strscore, loc = TRUE, sample = NULL, read_coun } assert("Cannot set both probs and n.quantiles", is.null(probs) || is.null(n.quantiles)) if(is.null(probs) && is.null(n.quantiles)) { - n.quantiles <- loc_data[, .N, by = sample][, quantile(N, read_count_quant, names = FALSE)] %>% round + n.quantiles <- round(loc_data[, .N, by = sample][, quantile(N, read_count_quant, names = FALSE)]) } method <- tolower(method) if(method == "al1" || method == "al1_all") { @@ -403,7 +403,7 @@ make_quantiles_matrix <- function(strscore, loc = TRUE, sample = NULL, read_coun stop('"Please choose type for quantile with method = "quantile#"') } if(grepl("^quantile\\d", method)) { - quantile_type <- sub("quantile", "", method) %>% as.numeric() + quantile_type <- as.numeric(sub("quantile", "", method)) method <- "quantile" } assert("samples is not the key of strscore$samples", key(strscore$samples)[1] == "sample") @@ -440,7 +440,7 @@ make_quantiles_matrix <- function(strscore, loc = TRUE, sample = NULL, read_coun } v <- sort(v) } else if(method == "al1_all") { - v <- munoz_rueda_al1(y, n.quantiles) %>% sort + v <- sort(munoz_rueda_al1(y, n.quantiles)) } else { stop("Undefined method ", method) } @@ -448,7 +448,7 @@ make_quantiles_matrix <- function(strscore, loc = TRUE, sample = NULL, read_coun } rownames(quant.matrix) <- sample # remove NA rows - low.count.samples <- apply(quant.matrix, 1, function(x) { is.na(x) %>% all }) + low.count.samples <- apply(quant.matrix, 1, function(x) { all(is.na(x)) }) quant.matrix <- quant.matrix[!low.count.samples, ] list(x = probs, y.mat = quant.matrix, low.count = names(low.count.samples[low.count.samples])) } diff --git a/R/tsum_test.R b/R/tsum_test.R index 74a7f1a..60ae998 100644 --- a/R/tsum_test.R +++ b/R/tsum_test.R @@ -303,7 +303,7 @@ tsum_statistic_1locus <- function( sqm <- t (replicate(N, rnorm(M, mu_vec, se_vec))) # as this means the quantiles of a sample are no longer ordered, we sort for(i in seq_len(N)) { - sqm[i, ] <- sort.int(sqm[i, ]) + sqm[i, ] <- sort.int(sqm[i, ], method = "shell") } sqm }