Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Russel committed May 29, 2018
1 parent bfacd90 commit 76a7334
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 4 additions & 4 deletions R/DA.llm2.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/DA.ltt.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions R/DA.per.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ 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)

# 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]
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.onLoad <- function(libname, pkgname){
message("DAtest version 2.7.9")
message("DAtest version 2.7.10")
}

0 comments on commit 76a7334

Please sign in to comment.