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

add ranks_ref dataset

metacoder dependency
+ internal function
parent 57aae0a6
Pipeline #37179 passed with stage
in 13 seconds
......@@ -53,6 +53,7 @@ import(plotly)
import(psadd)
import(reshape2)
import(scales)
import(stringr)
import(vegan)
importFrom(Biobase,AnnotatedDataFrame)
importFrom(Biobase,fData)
......
......@@ -34,16 +34,6 @@
#' @import stringr
#' @export
get.sample.name <- function(fname){
# res <- stringr::str_match(basename(fname), "^(.*)_R[12]\\.fastq\\.gz$")
# tt <- res[1,2]
tt <- strsplit(basename(fname), "_")[[1]][1]
return(tt)
}
# DADA2 function
dada2_fun <- function(amplicon = "16S", path = "", outpath = "./dada2_out/", f_trunclen = 240, r_trunclen = 240, dadapool = "pseudo",
......@@ -185,7 +175,6 @@ dada2_fun <- function(amplicon = "16S", path = "", outpath = "./dada2_out/", f_t
# Extract sample names, assuming filenames have format:
# get.sample.name <- function(fname) strsplit(basename(fname), "_")[[1]][1]
sample.names <- unname(sapply(cutFs, get.sample.name))
#head(sample.names)
......@@ -351,7 +340,6 @@ dada2_fun <- function(amplicon = "16S", path = "", outpath = "./dada2_out/", f_t
fastq.names <- sort(list.files(path, pattern = ".fastq", full.names = FALSE))
}
#sample name
get.sample.name <- function(fname) strsplit(basename(fname), "_")[[1]][1]
sample.names <- unname(sapply(fastq.names, get.sample.name))
if(compress==TRUE){
filtFs <- file.path(path, "filtered", paste0(sample.names, "_filt.fastq.gz"))
......@@ -460,3 +448,16 @@ dada2_fun <- function(amplicon = "16S", path = "", outpath = "./dada2_out/", f_t
}
#' Get sample name
#'
#' Extract sample names, assuming filenames have format names_miscinfo.fastq
#'
#' @param fname a parameter
#' @keywords internal
get.sample.name <- function(fname){
tt <- strsplit(basename(fname), "_")[[1]][1]
return(tt)
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dada2_fun.R
\name{get.sample.name}
\alias{get.sample.name}
\title{Get sample name}
\usage{
get.sample.name(fname)
}
\arguments{
\item{fname}{a parameter}
}
\description{
Extract sample names, assuming filenames have format names_miscinfo.fastq
}
\keyword{internal}
......@@ -4,7 +4,7 @@
\alias{idTaxa_assign}
\title{IDTAXA assign}
\usage{
idTaxa_assign(db_file, dna, asv_names, confidence, ncpu = NULLS)
idTaxa_assign(db_file, dna, asv_names, confidence, ncpu = NULL)
}
\arguments{
\item{db_file}{Path to IDTAXA formatted database file.}
......
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