Commit fbb2a3cc authored by Etienne Rifa's avatar Etienne Rifa
Browse files

misc changes

parent 99aa1bf7
Pipeline #40758 passed with stage
in 12 seconds
...@@ -84,7 +84,6 @@ aggregate_fun <- function(data = data, metacoder = NULL, deseq = NULL, mgseq = N ...@@ -84,7 +84,6 @@ aggregate_fun <- function(data = data, metacoder = NULL, deseq = NULL, mgseq = N
flog.warn('File does not exists.') flog.warn('File does not exists.')
deseqT <- data.frame() deseqT <- data.frame()
} }
# print(head(deseqT))
flog.info('MetagenomeSeq.') flog.info('MetagenomeSeq.')
if(file.exists(paste(mgseq,"/signtab_",column1,"_",combinaisons[1,col],"_vs_",combinaisons[2,col],".csv",sep=""))){ if(file.exists(paste(mgseq,"/signtab_",column1,"_",combinaisons[1,col],"_vs_",combinaisons[2,col],".csv",sep=""))){
mgseqT <- read.table(paste(mgseq,"/signtab_",column1,"_",combinaisons[1,col],"_vs_",combinaisons[2,col],".csv",sep=""), h=TRUE,sep="\t") mgseqT <- read.table(paste(mgseq,"/signtab_",column1,"_",combinaisons[1,col],"_vs_",combinaisons[2,col],".csv",sep=""), h=TRUE,sep="\t")
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#' @param ord0 Currently supported method options are: c("DCA", "CCA", "RDA", "CAP", "DPCoA", "NMDS", "MDS", "PCoA") #' @param ord0 Currently supported method options are: c("DCA", "CCA", "RDA", "CAP", "DPCoA", "NMDS", "MDS", "PCoA")
#' @param output The output file directory. #' @param output The output file directory.
#' @param tests Whether to compute tests or not (TRUE/FALSE) #' @param tests Whether to compute tests or not (TRUE/FALSE)
#' @param verbose Verbose level. (1: quiet, 2: print infos, 3: print infos + debug)
#' #'
#' @return Return specific plots and tests in list and output them in the output directory. #' @return Return specific plots and tests in list and output them in the output directory.
#' #'
...@@ -24,7 +25,18 @@ ...@@ -24,7 +25,18 @@
# Decontam Function # Decontam Function
diversity_beta_light <- function(psobj, rank = "ASV", col = NULL, cov = NULL, dist0 = "bray", ord0 = "MDS", output="./plot_div_beta/", tests = TRUE) { diversity_beta_light <- function(psobj, rank = "ASV", col = NULL, cov = NULL, dist0 = "bray", ord0 = "MDS", output="./plot_div_beta/", tests = TRUE, verbose = 2) {
if(verbose == 3){
invisible(flog.threshold(DEBUG))
}
if(verbose == 2){
invisible(flog.threshold(INFO))
}
if(verbose == 1){
invisible(flog.threshold(ERROR))
}
if(!dir.exists(output)){ if(!dir.exists(output)){
dir.create(output, recursive=TRUE) dir.create(output, recursive=TRUE)
......
...@@ -56,7 +56,7 @@ generate_phyloseq_fun <- function(dada_res = dada_res, tax.table = tax.table, tr ...@@ -56,7 +56,7 @@ generate_phyloseq_fun <- function(dada_res = dada_res, tax.table = tax.table, tr
data <- phyloseq(dada_res$otu.table, tax_table(as.matrix(tax.table)), sample.metadata, DNAStringSet(sequences)) data <- phyloseq(dada_res$otu.table, tax_table(as.matrix(tax.table)), sample.metadata, DNAStringSet(sequences))
} else{ } else{
flog.info('Building phyloseq object with tree...') flog.info('Building phyloseq object with tree...')
data <- phyloseq(dada_res$otu.table, tax.table, sample.metadata, phy_tree(tree), DNAStringSet(sequences)) data <- phyloseq(dada_res$otu.table, tax_table(as.matrix(tax.table)), sample.metadata, phy_tree(tree), DNAStringSet(sequences))
} }
flog.info('Done.') flog.info('Done.')
data_rel <- transform_sample_counts(data, function(x) x / sum(x) ) data_rel <- transform_sample_counts(data, function(x) x / sum(x) )
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#' @export #' @export
# Decontam Function
heatmap_fun <- function(data = data, column1 = "", top = 20, output = "./plot_heatmap/", rank = "Species", relative = TRUE, aggregate = TRUE, legend = "Abundance"){ heatmap_fun <- function(data = data, column1 = "", top = 20, output = "./plot_heatmap/", rank = "Species", relative = TRUE, aggregate = TRUE, legend = "Abundance"){
LL = list() LL = list()
...@@ -28,6 +26,8 @@ heatmap_fun <- function(data = data, column1 = "", top = 20, output = "./plot_he ...@@ -28,6 +26,8 @@ heatmap_fun <- function(data = data, column1 = "", top = 20, output = "./plot_he
} }
flog.info('Done.') flog.info('Done.')
if( is.na(match(column1, sample_variables(data))) ){stop("This factor is not in sample_variables(data).")}
ps.glom.rel <- psobj.top <- dataglom <- data ps.glom.rel <- psobj.top <- dataglom <- data
if(!is.null(rank)){ if(!is.null(rank)){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment