removeUnpairedFastqFiles: Remove Unpaired Fastq Files

View source: R/utils.R

removeUnpairedFastqFilesR Documentation

Remove Unpaired Fastq Files

Description

Given a vector of fastq file names and corresponding metadata, outputs a list containing matching R1 and R2 files in the same order. Useful for providing files to functions that utilize filterAndTrim, such as trimPrimer16S and runDadaITS.

Usage

removeUnpairedFastqFiles(fnFs, fnRs, meta, value = TRUE, verbose = TRUE)

Arguments

fnFs, fnRs

Full name(s) of fastq file(s) corresponding to R1 (forward) reads and R2 (reverse) reads, respectively. Tolerant to filenames with appended run ID prefix (e.g. "runB69RN_...") and agnostic to .gz compression.

meta

Metadata downloaded using downloadSequenceMetadata that corresponds to the fastq files.

value

(Optional) Default TRUE; returns file names. If FALSE, returns indices.

verbose

(Optional) Default TRUE. Whether to print warning messages when metadata does not contain records corresponding to all provided fastq files.

Details

See related function: getPairedFastqFiles.

Value

List of length 2; first element contains matched R1 (forward) file names, and second element contains corresponding R2 (reverse) file names.

Examples

## Not run: 
#' matched_fn <- removeUnpairedFastqFiles(c("sample1_R1.fastq", "sample3_R1.fastq"), c("sample1_R2.fastq", "sample2_R2.fastq", "sample3_R2.fastq"), meta)
fnFs <- matched_fn[[1]] # "sample1_R1.fastq" "sample3_R1.fastq"
fnRs <- matched_fn[[2]] # "sample1_R2.fastq" "sample3_R2.fastq"

## End(Not run)


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