getUniques: Get the uniques-vector from the input object.

View source: R/misc.R

getUniquesR Documentation

Get the uniques-vector from the input object.

Description

This function extracts the uniques-vector from several different data objects, including dada-class and derep-class objects, as well as data.frame objects that have both $sequence and $abundance columns. The return value is an integer vector named by sequence and valued by abundance. If the input is already in uniques-vector format, that same vector will be returned.

Usage

getUniques(object, collapse = TRUE, silence = FALSE)

Arguments

object

(Required). The object from which to extract the uniques-vector.

collapse

(Optional). Default TRUE. Should duplicate sequences detected in object be collapsed together, thereby imposing uniqueness on non-unique input.

silence

(Optional). Default FALSE. Suppress reporting of the detection and merger of duplicated input sequences.

Value

integer. An integer vector named by unique sequence and valued by abundance.

Examples

derep1 = derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"))
dada1 <- dada(derep1, err=tperr1)
getUniques(derep1)[1:3]
getUniques(dada1)[1:3]
getUniques(dada1$clustering)[1:3]


benjjneb/dada2 documentation built on Feb. 1, 2024, 10:50 p.m.