remove_unmatched_files: Remove Unmatched Fastq Files (DEPRECATED)

View source: R/utils.R

remove_unmatched_filesR Documentation

Remove Unmatched Fastq Files (DEPRECATED)

Description

NOTE: This function is now deprecated in favor of getPairedFastqFiles and removeUnpairedFastqFiles.

Usage

remove_unmatched_files(
  fnFs,
  fnRs,
  post_samplename_pattern = "_R(1|2).*\\.fastq",
  verbose = FALSE
)

Arguments

fnFs

Full name(s) of fastq file(s) containing forward-read sequence data.

fnRs

Full name(s) of fastq file(s) containing reverse-read sequence data.

post_samplename_pattern

(Optional) Character pattern within the filename which immediately follows the end of the sample name. Defaults to "_R(1|2).*\.fastq", as NEON fastq files typically consist of a sample name followed by "_R1.fastq" or "_R2.fastq", etc.

verbose

Whether to print messages regarding which files are matched and which are unmatched.

Details

Removes any forward-read files that do not have reverse-read counterparts, and vise versa. This function is necessary because dada2::filterAndTrim() will throw an error if the forward-read files and the reverse-read files are mismatched.

Value

List of length 2. The first element is a vector of forward-read files that have reverse-read counterparts; the second element is a vector of reverse-read files that have forward-read counterparts.

Examples

matched_fn <- remove_unmatched_files(c("sample1_R1.fastq", "sample2_R1.fastq"), c("sample1_R2.fastq", "sample2_R2.fastq", "sample3_R2.fastq"))
fnFs <- matched_fn[[1]]
fnRs <- matched_fn[[2]]

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