Commit 7c338e31 authored by Etienne Rifa's avatar Etienne Rifa
Browse files

Merge branch 'master' of forgemia.inra.fr:umrf/ranomaly

parents 817f2479 471fd517
Pipeline #27820 passed with stage
in 13 seconds
......@@ -66,6 +66,21 @@ ASVenn_fun <- function(data = data, output = "./ASVenn/", rank = "ASV",
}
if(length(lvls)==0){
flog.error('You must provide levels...')
stop()
} else if(length(lvls)>5){
flog.error('Venn diagram is limited to 5 levels')
stop()
} else{
if(!all(lvls %in% na.omit(levels(as.factor(sample_data(data)[,column1]@.Data[[1]])) ))){
flog.error('Your levels are not present in metadata...')
stop()
}
}
#Nombre d'espèce par matrice
flog.info('Parsing factor ...')
level1 <- na.omit(levels(as.factor(sample_data(data)[,column1]@.Data[[1]])) )
......
......@@ -189,6 +189,7 @@ decontam_fun <- function(data = data, domain = "Bacteria", output = "./decontam_
} else {
flog.info('Decontam step skipped or too few control samples (less than 3)...')
taxToDump0 = NULL
skip=TRUE
}
}else{taxToDump0 = NULL} #-k skip all decontam
......@@ -285,7 +286,7 @@ decontam_fun <- function(data = data, domain = "Bacteria", output = "./decontam_
}
data <- prune_samples(sample_sums(data) > number, data)
flog.info('Done.')
flog.info(paste("AFTER FILTERING: ",nsamples(data), "samples and", ntaxa(data),"ASVs in otu table") )
##TAXA to remove manually
......@@ -305,12 +306,13 @@ decontam_fun <- function(data = data, domain = "Bacteria", output = "./decontam_
}
##Remove Control samples for next analysis
if(column != ""){
if(column != "" && skip==FALSE){
flog.info('Subsetting controls samples.')
fun <- paste("data <- subset_samples(data, ",column," %in% '",spl_identifier,"')",sep="")
eval(parse(text=fun))
}
flog.info(paste("AFTER FILTERING: ",nsamples(data), "samples and", ntaxa(data),"ASVs in otu table") )
flog.info('Writing raw tables.')
write.table(cbind(otu_table(data),"Consensus Lineage" = apply(tax_table(data), 1, paste, collapse = ";"), "sequences"=as.data.frame(refseq(data)) ), paste(output,"/raw_otu-table.csv",sep=''), sep="\t", row.names=TRUE, col.names=NA, quote=FALSE)
......
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