dada_to_seq_table {dada2} | R Documentation

## Map denoised sequence to each read.

### Description

Takes the `dada` result, `derepFastq` result, and `ShortReadQ-class` object (an R representation of the original input sequence data), and creates a `data.table` in which each entry (row) contains a unique read ID and the denoised sequence to which it corresponds, as inferred by `dada`.

### Usage

    dada_to_seq_table(dadaRes, derep, sr, idRegExpr = c("\\s.+$", ""),
      includeCol = character(0))

### Arguments

`dadaRes` | (Required). A `dada-class` object. The output of `dada` function.
`derep` | (Required). A `derep-class` object. An object returned by `derepFastq()`. Should be the same object that served as input to the `dada` function.
`sr` | (Required). The trimmed and filtered reads that you used as input for `derepFastq`, prior to running `dada()` on `derep`. More generally, this is an object that inherits from the `ShortRead-class`. In most cases this will be `ShortReadQ-class`. Objects from this class are the result of `readFastq`. Alternatively, this can be a character string that provides the path to your forward reads fastq file.
`idRegExpr` | (Optional). Exact same as for `mergePairsByID`.
`includeCol` | (Optional). Exact same as for `mergePairsByID`.

### Value

A `data.table` in which each entry (row) contains a unique read ID and the denoised sequence to which it corresponds, as inferred by `dada`.

### Examples

    exFileF = system.file("extdata", "sam1F.fastq.gz", package="dada2")
    show(exFileF)
    srF = ShortRead::readFastq(exFileF)
    derepF = derepFastq(exFileF)
    dadaF <- dada(derepF, err=tperr1,
                  errorEstimationFunction=loessErrfun, selfConsist=TRUE)
    dada2:::dada_to_seq_table(dadaF, derepF, srF)

[Package dada2 version 1.8.0 Index]