Learn R Programming

dada2 (version 1.0.3)

uniquesToFasta: 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

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

Run the code above in your browser using DataLab