qualityFilter16S: Filter 16S Sequences (with metadata)

View source: R/dada_wrappers.R

qualityFilter16SR Documentation

Filter 16S Sequences (with metadata)

Description

Applies a quality filter to 16S sequence fastq files via the filterAndTrim function. It is assumed that both forward- and reverse-read files are included.

Usage

qualityFilter16S(
  fn,
  in_subdir,
  out_subdir,
  meta,
  in_explicitdir = NULL,
  out_explicitdir = NULL,
  multithread = FALSE,
  verbose = FALSE,
  trunc_qscore = 23,
  ...
)

Arguments

fn

Base names of input fastq files. If inputs are not base names (i.e. if they include directory paths), the directory paths will be removed. Files that do not exist will be ignored; however, if all files do not exist, this function will issue a warning.

in_subdir

Subdirectory name from which to retrieve input fastq files. Enter "raw" for raw sequence files, or any other character string to specify a subdirectory within NEONMICROBE_DIR_MIDPROCESS/16S. To specify a directory outside NEONMICROBE_DIR_MIDPROCESS/16S, use the 'in_explicitdir' argument.

out_subdir

Subdirectory name where output fastq files will be written. Enter any character string to specify a subdirectory within NEONMICROBE_DIR_MIDPROCESS/16S. If the directory does not exist, it will be created. To specify a directory outside NEONMICROBE_DIR_MIDPROCESS/16S, use the 'out_explicitdir' argument.

meta

The output of downloadSequenceMetadata. Must be provided as either the data.frame returned by downloadSequenceMetadata or as a filepath to the csv file produced by downloadSequenceMetadata.

in_explicitdir, out_explicitdir

Directory names to use instead of 'in_subdir' and 'out_subdir', if static directory names or directories outside of NEONMICROBE_DIR_MIDPROCESS/16S are desired. Not recommended for use within processing batches.

multithread

Default FALSE. Whether to use multithreading. Note that Windows does not support multithreading in this function because it uses mclapply, so this argument must be set to FALSE on Windows systems.

verbose

Default FALSE. Whether to print messages associated with automated selection of truncation length (truncLen).

trunc_qscore

Default 23. If truncLen is not provided, specifies the mean quality score at which point to truncate each read. The behavior of this argument has not been extensively tested, so it is generally recommended that truncLen be used instead.

...

Other arguments to be passed to filterAndTrim, such as maxEE, truncLen, and minLen. By default, uses filterAndTrim's default values. See documentation for filterAndTrim for more details.

Value

(Invisibly) Two-column matrix displaying the number of reads in input vs. output for each file.

See Also

filterAndTrim

Examples

 {
fl_nm <- c("BMI_Plate37WellA12_16S_BJ8RK_R1.fastq.gz", "BMI_Plate37WellA12_16S_BJ8RK_R2.fastq.gz")
filter_trackReads <- qualityFilter16S(
  fl_nm, in_subdir = "1_trimmed", out_subdir = "2_filtered",
  meta = seqmeta_greatplains_16s, truncLen = c(250, 230), maxEE = c(2, 8),
  multithread = TRUE # set multithread = FALSE on Windows computers though
)

claraqin/neonMicrobe documentation built on April 11, 2024, 11:47 a.m.