mergePairs: Merge denoised forward and reverse reads.

Description Usage Arguments Value See Also Examples

View source: R/paired.R

Description

This function attempts to merge each denoised pair of forward and reverse reads, rejecting any pairs which do not sufficiently overlap or which contain too many (>0 by default) mismatches in the overlap region. Note: This function assumes that the fastq files for the forward and reverse reads were in the same order.

Usage

1
2
3
mergePairs(dadaF, derepF, dadaR, derepR, minOverlap = 20, maxMismatch = 0,
  returnRejects = FALSE, propagateCol = character(0),
  justConcatenate = FALSE, trimOverhang = FALSE, verbose = FALSE)

Arguments

dadaF

(Required). A dada-class object, or a list of such objects. The dada-class object(s) generated by denoising the forward reads.

derepF

(Required). A derep-class object, or a list of such objects. The derep-class object(s) used as input to the the dada function when denoising the forward reads.

dadaR

(Required). A dada-class object, or a list of such objects. The dada-class object(s) generated by denoising the reverse reads.

derepR

(Required). A derep-class object, or a list of such objects. The derep-class object(s) used as input to the the dada function when denoising the reverse reads.

minOverlap

(Optional). Default 20. The minimum length of the overlap required for merging the forward and reverse reads.

maxMismatch

(Optional). Default 0. The maximum mismatches allowed in the overlap region.

returnRejects

(Optional). Default FALSE. If TRUE, the pairs that that were rejected based on mismatches in the overlap region are retained in the return data.frame.

propagateCol

(Optional). character. Default character(0). The return data.frame will include values from columns in the $clustering data.frame of the provided dada-class objects with the provided names.

justConcatenate

(Optional). Default FALSE. If TRUE, the forward and reverse-complemented reverse read are concatenated rather than merged, with a NNNNNNNNNN (10 Ns) spacer inserted between them.

trimOverhang

(Optional). Default FALSE. If TRUE, "overhangs" in the alignment between the forwards and reverse read are trimmed off. "Overhangs" are when the reverse read extends past the start of the forward read, and vice-versa, as can happen when reads are longer than the amplicon and read into the other-direction primer region.

verbose

(Optional). Default FALSE. If TRUE, a summary of the function results are printed to standard output.

Value

A data.frame, or a list of data.frames.

The return data.frame(s) has a row for each unique pairing of forward/reverse denoised sequences, and the following columns:

A list of data.frames are returned if a list of input objects was provided.

See Also

derepFastq, dada, fastqPairedFilter

Examples

1
2
3
4
5
6
7
derepF = derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"))
derepR = derepFastq(system.file("extdata", "sam1R.fastq.gz", package="dada2"))
dadaF <- dada(derepF, err=tperr1, errorEstimationFunction=loessErrfun, selfConsist=TRUE)
dadaR <- dada(derepR, err=tperr1, errorEstimationFunction=loessErrfun, selfConsist=TRUE)
mergePairs(dadaF, derepF, dadaR, derepR)
mergePairs(dadaF, derepF, dadaR, derepR, returnRejects=TRUE, propagateCol=c("n0", "birth_ham"))
mergePairs(dadaF, derepF, dadaR, derepR, justConcatenate=TRUE)

Bioconductor-mirror/dada2 documentation built on June 1, 2017, 7:31 a.m.