uniquesToFasta {dada2} | R Documentation

## Write a uniques vector to a FASTA file

### Description

A wrapper for writeFastq in the ShortRead package. Default output format is compatible with uchime.

### Usage

    uniquesToFasta(unqs, fout, ids = NULL, mode = "w", width = 20000,
      ...)

### Arguments

`unqs` | (Required). A `uniques-vector` or any object that can be coerced into one with `getUniques`.
`fout` | (Required). The file path of the output file.
`ids` | (Optional). `character`. Default NULL. A vector of sequence ids, one for each element in `unqs`. If NULL, a uchime-compatible ID is assigned.
`mode` | (Optional). Default "w". Passed on to `writeFasta` indicating the type of file writing mode. Default is `"w"`.
`width` | (Optional). Default 20000. The number of characters per line in the file. Default is effectively one line per sequence. Passed on to `writeFasta`.
`...` | Additional parameters passed on to `writeFasta`.

### Value

NULL.

### Examples

    derep1 = derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"))
    outfile <- tempfile(fileext=".fasta")
    uniquesToFasta(derep1, outfile)
    uniquesToFasta(derep1, outfile, ids=paste0("Sequence", seq(length(getSequences(derep1)))))

[Package dada2 version 1.16.0 Index]