mergePairs | R Documentation |
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.
mergePairs(
dadaF,
derepF,
dadaR,
derepR,
minOverlap = 12,
maxMismatch = 0,
returnRejects = FALSE,
propagateCol = character(0),
justConcatenate = FALSE,
trimOverhang = FALSE,
verbose = FALSE,
...
)
dadaF |
(Required). A |
derepF |
(Required). |
dadaR |
(Required). A |
derepR |
(Required). |
minOverlap |
(Optional). Default 12. 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 |
propagateCol |
(Optional). |
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. |
... |
(Optional). Further arguments to pass on to |
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:
$abundance
: Number of reads corresponding to this forward/reverse combination.
$sequence
: The merged sequence.
$forward
: The index of the forward denoised sequence.
$reverse
: The index of the reverse denoised sequence.
$nmatch
: Number of matches nts in the overlap region.
$nmismatch
: Number of mismatches in the overlap region.
$nindel
: Number of indels in the overlap region.
$prefer
: The sequence used for the overlap region. 1=forward; 2=reverse.
$accept
: TRUE if overlap between forward and reverse denoised sequences was at least
minOverlap
and had at most maxMismatch
differences. FALSE otherwise.
$...
: Additional columns specified in propagateCol
.
A list of data.frames are returned if a list of input objects was provided.
derepFastq
, dada
, fastqPairedFilter
fnF <- system.file("extdata", "sam1F.fastq.gz", package="dada2")
fnR = system.file("extdata", "sam1R.fastq.gz", package="dada2")
dadaF <- dada(fnF, selfConsist=TRUE)
dadaR <- dada(fnR, selfConsist=TRUE)
merger <- mergePairs(dadaF, fnF, dadaR, fnR)
merger <- mergePairs(dadaF, fnF, dadaR, fnR, returnRejects=TRUE, propagateCol=c("n0", "birth_ham"))
merger <- mergePairs(dadaF, fnF, dadaR, fnR, justConcatenate=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.