Commit 817f2479 authored by Etienne Rifa's avatar Etienne Rifa
Browse files

resolve read strand for torrent data + assignment in both strand

parent 99988943
......@@ -19,6 +19,7 @@
#' @param trim_r Trim right size.
#' @param returnval Boolean to return values in console or not.
#' @param paired Boolean for Illumina Paired End Reads.
#' @param orient_torrent Forward primer sequence to orient all reads to same strand.
#'
#' @return Return raw otu table in phyloseq object and export it in an Rdata file.
#'
......@@ -37,7 +38,8 @@
dada2_fun <- function(amplicon = "16S", path = "", outpath = "./dada2_out/", f_trunclen = 240, r_trunclen = 240, dadapool = "pseudo",
f_primer = "GCATCGATGAAGAACGCAGC", r_primer = "TCCTCCGCTTWTTGWTWTGC", plot = FALSE, compress = FALSE, verbose = 1,
torrent_single = FALSE,returnval = TRUE, paired = TRUE, trim_l=15, trim_r=0){
torrent_single = FALSE,returnval = TRUE, paired = TRUE, trim_l=15, trim_r=0, orient_torrent = NULL){
if(torrent_single == TRUE & is.null(orient_torrent)){stop("Need forward primer to orient TORRENT reads...")}
if(verbose == 3){
invisible(flog.threshold(DEBUG))
......@@ -335,9 +337,13 @@ dada2_fun <- function(amplicon = "16S", path = "", outpath = "./dada2_out/", f_t
filtFs <- file.path(path, "filtered", paste0(sample.names, "_filt.fastq"))
}
out <- filterAndTrim(fwd = fnFs, filt = filtFs, maxN = 0, multithread = TRUE, verbose=TRUE, rm.phix = TRUE,
, maxEE = 5 , minLen = 100, compress=compress, trimLeft=trim_l, trimRight=trim_r )
if(torrent_single == TRUE){
out <- filterAndTrim(fwd = fnFs, filt = filtFs, maxN = 0, multithread = TRUE, verbose=TRUE, rm.phix = TRUE,
, maxEE = 5 , minLen = 100, compress=compress, trimLeft=trim_l, trimRight=trim_r, orient.fwd = orient_torrent)
}else{
out <- filterAndTrim(fwd = fnFs, filt = filtFs, maxN = 0, multithread = TRUE, verbose=TRUE, rm.phix = TRUE,
, maxEE = 5 , minLen = 100, compress=compress, trimLeft=trim_l, trimRight=trim_r )
}
row.names(out) = sample.names
flog.info('Learning error model...')
......
......@@ -76,11 +76,6 @@ diversity_alpha_fun <- function(data = data, output = "./plot_div_alpha/", colum
dir.create(output, recursive=TRUE)
}
if(verbose == 3){
invisible(flog.threshold(DEBUG))
} else {
invisible(flog.threshold(INFO))
}
if(column1 == ""){
flog.error('You need to provide at least one column.')
......
......@@ -7,7 +7,7 @@
#' @param asv_names sequences IDs in same order.
#' @param confidence Bootstrap threshold 0...100
#'
#' @return return taxonomic assignment of given sequences.
#' @return return taxonomic assignment of given sequences.
#' @import futile.logger
#' @import DECIPHER
......@@ -17,7 +17,7 @@
idTaxa_assign = function(db_file, dna, asv_names, confidence){
flog.info(paste('Using database ',db_file,sep=''))
toto <- load(db_file)
ids <- IdTaxa(dna, trainingSet, strand="top", processors=NULL, verbose=TRUE)
ids <- IdTaxa(dna, trainingSet, strand="both", processors=NULL, verbose=TRUE)
names(ids) <- asv_names
flog.info("Confidence filtering...")
IDCONF = as.numeric(confidence)
......
Supports Markdown
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