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

Share:

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

1
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

1
2
3
4
5
6
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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.