diff --git a/DESCRIPTION b/DESCRIPTION index dc18019..3317328 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: DAtest Title: Comparing Differential Abundance methods -Version: 2.7.9 +Version: 2.7.10 Authors@R: person("Jakob", "Russel", email = "russel2620@gmail.com", role = c("aut", "cre")) Description: What the title says. Depends: R (>= 3.2.5) diff --git a/R/DA.llm2.R b/R/DA.llm2.R index e84d559..642cbf0 100644 --- a/R/DA.llm2.R +++ b/R/DA.llm2.R @@ -130,19 +130,19 @@ DA.llm2 <- function(data, predictor, paired = NULL, covars = NULL, out.all = NUL fit <- lme(as.formula(form), random = ~1|paired, ...), error = function(e) fit <- NULL) } } - return(apply(count_table,1,lmr)) + return(apply(count.rel,1,lmr)) } else { if(out.all){ if(is.null(paired)){ - res <- as.data.frame(do.call(rbind,apply(count_table,1,lmr))) + res <- as.data.frame(do.call(rbind,apply(count.rel,1,lmr))) colnames(res)[1:5] <- c("Df","Sum Sq","Mean Sq","F value","pval") } else { - res <- as.data.frame(do.call(rbind,apply(count_table,1,lmr))) + res <- as.data.frame(do.call(rbind,apply(count.rel,1,lmr))) colnames(res)[1:4] <- c("numDF","denDF","F-value","pval") } res <- as.data.frame(lapply(res, unlist)) } else { - res <- as.data.frame(t(as.data.frame(apply(count_table,1,lmr)))) + res <- as.data.frame(t(as.data.frame(apply(count.rel,1,lmr)))) colnames(res)[ncol(res)] <- "pval" res$log2FC <- log2((res[,coeff.ref]+res[,coeff]) / res[,coeff.ref]) res[res[,coeff.ref] < 0 & !is.na(res[,coeff.ref]), "log2FC"] <- NA diff --git a/R/DA.ltt.R b/R/DA.ltt.R index d2e37a0..ecd3cd6 100644 --- a/R/DA.ltt.R +++ b/R/DA.ltt.R @@ -55,7 +55,7 @@ DA.ltt <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr tryCatch(t.test(x ~ predictor, paired = TRUE, ...), error = function(e){NA}) } } - return(apply(count.rel,1,tt)) + return(apply(count_table,1,tt)) } else { res <- data.frame(pval = apply(count_table,1,tt)) res$pval.adj <- p.adjust(res$pval, method = p.adj) diff --git a/R/DA.per.R b/R/DA.per.R index 04ea9e9..2b5b197 100644 --- a/R/DA.per.R +++ b/R/DA.per.R @@ -62,7 +62,7 @@ DA.per <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr } } - iterations <- nrow(count_table) + iterations <- nrow(count.rel) p <- numeric(iterations) FC <- numeric(iterations) coverage <- numeric(iterations) @@ -70,7 +70,7 @@ DA.per <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr # For each feature for(i in 1:iterations){ - count_row <- as.numeric(count_table[i,]) + count_row <- as.numeric(count.rel[i,]) real_case <- count_row[predictor==1] real_control <- count_row[predictor==0] diff --git a/R/zzz.R b/R/zzz.R index 8430293..64f773f 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,5 +1,5 @@ .onLoad <- function(libname, pkgname){ - message("DAtest version 2.7.9") + message("DAtest version 2.7.10") }