Learn R Programming

dada2 (version 1.0.3)

collapseNoMismatch: Combine together sequences that are identical up to shifts and/or length.

Description

This function takes as input a sequence table and returns a sequence table in which any sequences that are identical up to shifts or length variation, i.e. that have no mismatches or internal indels when aligned, are collapsed together. The most abundant sequence is chosen as the representative of the collapsed sequences. This function can be thought of as implementing greedy 100% OTU clustering, with end-gapping is ignored.

Usage

collapseNoMismatch(seqtab, minOverlap = 20, verbose = FALSE)

Arguments

seqtab
(Required). A sample by sequence matrix, the return of makeSequenceTable.
minOverlap
(Optional). numeric(1). Default 20. The minimum amount of overlap between sequences required to collapse them together.
verbose
(Optional). logical(1). Default FALSE. If TRUE, a summary of the function results are printed to standard output.

Value

Named integer matrix. A row for each sample, and a column for each collapsed sequence across all the samples. Note that the columns are named by the sequence which can make display a little unwieldy. Columns are in the same order (modulo the removed columns) as in the input matrix.

See Also

makeSequenceTable

Examples

Run this code
derep1 <- derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"))
derep2 <- derepFastq(system.file("extdata", "sam2F.fastq.gz", package="dada2"))
dada1 <- dada(derep1, tperr1)
dada2 <- dada(derep2, tperr1)
seqtab <- makeSequenceTable(list(sample1=dada1, sample2=dada2))
collapseNoMismatch(seqtab)

Run the code above in your browser using DataLab