Skip to content

Commit

Permalink
2.7.15 dont export interal functions, fix func name, no gitattributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob Russel committed Mar 15, 2019
1 parent 1fb1312 commit 1a2c513
Show file tree
Hide file tree
Showing 61 changed files with 53 additions and 235 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

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/Expression Methods
Version: 2.7.14
Version: 2.7.15
Authors@R: person("Jakob", "Russel",
email = "[email protected]",
role = c("aut", "cre"))
Expand Down
5 changes: 0 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export(DA.mva)
export(DA.neb)
export(DA.pea)
export(DA.per)
export(DA.phyloseq)
export(DA.poi)
export(DA.qpo)
export(DA.qua)
Expand All @@ -56,17 +55,13 @@ export(DA.zig)
export(DA.znb)
export(DA.zpo)
export(DA.zzz)
export(add.tax.DA)
export(allDA)
export(featurePlot)
export(gm_mean)
export(norm_alr)
export(norm_clr)
export(powerDA)
export(preDA)
export(pruneTests)
export(runtimeDA)
export(spikein)
export(testDA)
export(vennDA)
import(MASS)
Expand Down
2 changes: 1 addition & 1 deletion R/DA.adx.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ DA.adx <- function(data, predictor, ...){
x[!is.na(x$effect) & x$effect < 0,"ordering"] <- paste0(levels(as.factor(predictor))[1],">",levels(as.factor(predictor))[2])
x$Feature <- rownames(x)

if(class(data) == "phyloseq") x <- add.tax.DA(data, x)
if(class(data) == "phyloseq") x <- addTax(data, x)

return(x)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/DA.aoa.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ DA.aoa <- function(data, predictor, covars = NULL, p.adj = "fdr", delta = 1, all
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "ANOVA - ALR (aoa)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.aoc.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ DA.aoc <- function(data, predictor, covars = NULL, p.adj = "fdr", delta = 1, all
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "ANOVA - CLR (aoc)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.aov.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ DA.aov <- function(data, predictor, covars = NULL, relative = TRUE, p.adj = "fdr
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "ANOVA (aov)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.bay.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DA.bay <- function(data, predictor, allResults = FALSE, ...){

output_df$Method <- "baySeq (bay)"

if(class(data) == "phyloseq") output_df <- add.tax.DA(data, output_df)
if(class(data) == "phyloseq") output_df <- addTax(data, output_df)

if(allResults) return(CD) else return(output_df)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/DA.ds2.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ DA.ds2 <- function(data, predictor, paired = NULL, covars = NULL, out.all = NULL
res$Feature <- DESeq2::results(x)@rownames
res$Method <- "DESeq2 man. geoMeans (ds2)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(x) else return(res)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/DA.ds2x.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ DA.ds2x <- function(data, predictor, paired = NULL, covars = NULL, out.all = NUL
res$Feature <- DESeq2::results(x)@rownames
res$Method <- "DESeq2 (ds2x)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(x) else return(res)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/DA.ere.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ DA.ere <- function(data, predictor, p.adj = "fdr", ...){
ta$Feature <- rownames(ta)
ta$Method <- "EdgeR exact - TMM (ere)"

if(class(data) == "phyloseq") ta <- add.tax.DA(data, ta)
if(class(data) == "phyloseq") ta <- addTax(data, ta)

return(ta)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.ere2.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ DA.ere2 <- function(data, predictor, p.adj = "fdr", ...){
ta$Feature <- rownames(ta)
ta$Method <- "EdgeR exact - RLE (ere2)"

if(class(data) == "phyloseq") ta <- add.tax.DA(data, ta)
if(class(data) == "phyloseq") ta <- addTax(data, ta)

return(ta)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/DA.erq.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ DA.erq <- function(data, predictor, paired = NULL, covars = NULL, out.all = NULL
ta$Feature <- rownames(ta)
ta$Method <- "EdgeR qll - TMM (erq)"

if(class(data) == "phyloseq") ta <- add.tax.DA(data, ta)
if(class(data) == "phyloseq") ta <- addTax(data, ta)

if(allResults) return(qlf) else return(ta)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.erq2.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ DA.erq2 <- function(data, predictor, paired = NULL, covars = NULL, out.all = NUL
ta$Feature <- rownames(ta)
ta$Method <- "EdgeR qll - RLE (erq2)"

if(class(data) == "phyloseq") ta <- add.tax.DA(data, ta)
if(class(data) == "phyloseq") ta <- addTax(data, ta)

if(allResults) return(qlf) else return(ta)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.fri.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ DA.fri <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr
res$Feature <- gsub(".Friedman.*","",rownames(res))
res$Method <- "Friedman (fri)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

return(res)
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.kru.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ DA.kru <- function(data, predictor, relative = TRUE, p.adj = "fdr", allResults =
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Kruskal-Wallis (kru)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lao.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ DA.lao <- function(data, predictor, covars = NULL, relative = TRUE, p.adj = "fdr
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Log ANOVA (lao)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.lao2.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ DA.lao2 <- function(data, predictor, covars = NULL, p.adj = "fdr", delta = 0.001
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Log ANOVA 2 (lao2)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.lia.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ DA.lia <- function(data, predictor, paired = NULL, covars = NULL, out.all = NULL
res$Feature <- rownames(res)
res$Method <- "LIMMA - ALR (lia)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(fit.eb) else return(res)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lic.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ DA.lic <- function(data, predictor, paired = NULL, covars = NULL, out.all = NULL
res$Feature <- rownames(res)
res$Method <- "LIMMA - CLR (lic)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(fit.eb) else return(res)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lim.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ DA.lim <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$Feature <- rownames(res)
res$Method <- "LIMMA (lim)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(fit.eb) else return(res)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lli.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DA.lli <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$Feature <- rownames(res)
res$Method <- "Log LIMMA (lli)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(fit.eb) else return(res)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lli2.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DA.lli2 <- function(data, predictor, paired = NULL, covars = NULL, out.all = NUL
res$Feature <- rownames(res)
res$Method <- "Log LIMMA 2 (lli2)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

if(allResults) return(fit.eb) else return(res)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.llm.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ DA.llm <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Log Linear reg. (llm)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}

Expand Down
2 changes: 1 addition & 1 deletion R/DA.llm2.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ DA.llm2 <- function(data, predictor, paired = NULL, covars = NULL, out.all = NUL
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Log Linear reg. 2 (llm2)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
2 changes: 1 addition & 1 deletion R/DA.lma.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ DA.lma <- function(data, predictor, paired = NULL, covars = NULL, out.all = NULL
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Linear model - ALR (lma)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ DA.lmc <- function(data, predictor, paired = NULL, covars = NULL, out.all = NULL
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Linear model - CLR (lmc)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}

Expand Down
2 changes: 1 addition & 1 deletion R/DA.lrm.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ DA.lrm <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$pval.adj <- p.adjust(res$pval, method = p.adj)
res$Feature <- rownames(res)
res$Method <- "Linear regression (lrm)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}

Expand Down
2 changes: 1 addition & 1 deletion R/DA.ltt.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DA.ltt <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr
res[!is.na(res$log2FC) & res$log2FC < 0,"ordering"] <- paste0(levels(as.factor(predictor))[1],">",levels(as.factor(predictor))[2])
res$Feature <- rownames(res)
res$Method <- "Log t-test (ltt)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.ltt2.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ DA.ltt2 <- function(data, predictor, paired = NULL, p.adj = "fdr", delta = 0.001
res[!is.na(res$log2FC) & res$log2FC < 0,"ordering"] <- paste0(levels(as.factor(predictor))[1],">",levels(as.factor(predictor))[2])
res$Feature <- rownames(res)
res$Method <- "Log t-test2 (ltt2)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
2 changes: 1 addition & 1 deletion R/DA.msf.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DA.msf <- function(data, predictor, p.adj = "fdr", allResults = FALSE, ...){
temp_table[!is.na(temp_table$logFC) & temp_table$logFC < 0,"ordering"] <- paste0(levels(as.factor(predictor))[1],">",levels(as.factor(predictor))[2])
temp_table$Method <- "MgSeq Feature (msf)"

if(class(data) == "phyloseq") temp_table <- add.tax.DA(data, temp_table)
if(class(data) == "phyloseq") temp_table <- addTax(data, temp_table)

if(allResults) return(mgsfit) else return(temp_table)

Expand Down
2 changes: 1 addition & 1 deletion R/DA.mva.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ DA.mva <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$Feature <- rownames(pvals.unadj$uni.test)
res$Method <- "mvabund (mva)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

return(res)
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.neb.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ DA.neb <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$Method <- "Negbinom GLM (neb)"

if(nrow(res) > 1){
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
}
return(res)
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/DA.pea.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ DA.pea <- function(data, predictor, relative = TRUE, p.adj = "fdr", ...){
res$Method <- "Pearson (pea)"

# Add tax table if available
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

return(res)
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.per.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ DA.per <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr
output_df$pval.adj <- p.adjust(output_df$pval, method = p.adj)
output_df$Method <- "Permutation (per)"

if(class(data) == "phyloseq") output_df <- add.tax.DA(data, output_df)
if(class(data) == "phyloseq") output_df <- addTax(data, output_df)

return(output_df)
}
Expand Down
11 changes: 0 additions & 11 deletions R/DA.phyloseq.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
#' Extract data from a \code{phyloseq} object to be used in \code{DAtest}
#'
#' Internal function
#'
#' @param data A \code{phyloseq} object
#' @param predictor The \code{predictor} of interest
#' @param paired Factor for paired/blocked experimental designs.
#' @param covars A character vector with names of the variables in \code{sample_data(data)}
#' @return A list with data extracted from the \code{phyloseq} object
#' @export

DA.phyloseq <- function(data, predictor, paired = NULL, covars = NULL){

ok <- tryCatch({
Expand Down
2 changes: 1 addition & 1 deletion R/DA.poi.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ DA.poi <- function(data, predictor, paired = NULL, covars = NULL, relative = TRU
res$Method <- "Poisson GLM (poi)"

if(nrow(res) > 1){
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
}
return(res)
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.qpo.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ DA.qpo <- function(data, predictor, covars = NULL, relative = TRUE, out.all = NU
res$Method <- "Quasi-Poisson GLM (qpo)"

if(nrow(res) > 1){
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
}
return(res)
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.qua.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ DA.qua <- function(data, predictor, paired = NULL, relative = TRUE, p.adj = "fdr
res$Feature <- gsub(".Quade.*","",rownames(res))
res$Method <- "Quade (qua)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}

Expand Down
2 changes: 1 addition & 1 deletion R/DA.sam.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ DA.sam <- function(data, predictor, paired = NULL, fdr.output = 0.05, allResults

df$Method <- "SAMseq (sam)"

if(class(data) == "phyloseq") df <- add.tax.DA(data, df)
if(class(data) == "phyloseq") df <- addTax(data, df)

if(allResults){
return(res)
Expand Down
2 changes: 1 addition & 1 deletion R/DA.spe.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ DA.spe <- function(data, predictor, relative = TRUE, p.adj = "fdr", ...){
res$Feature <- rownames(res)
res$Method <- "Spearman (spe)"

if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)

return(res)
}
Expand Down
2 changes: 1 addition & 1 deletion R/DA.tta.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ DA.tta <- function(data, predictor, paired = NULL, p.adj = "fdr", delta = 1, tes
res[!is.na(res$log2FC) & res$log2FC < 0,"ordering"] <- paste0(levels(as.factor(predictor))[1],">",levels(as.factor(predictor))[2])
res$Feature <- rownames(res)
res$Method <- "t-test - ALR (tta)"
if(class(data) == "phyloseq") res <- add.tax.DA(data, res)
if(class(data) == "phyloseq") res <- addTax(data, res)
return(res)
}
}
Loading

0 comments on commit 1a2c513

Please sign in to comment.