Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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

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)))))

dada2

Accurate, high-resolution sample inference from amplicon sequencing data

v1.18.0
LGPL-3
Authors
Benjamin Callahan <benjamin.j.callahan@gmail.com>, Paul McMurdie, Susan Holmes
Initial release
2020-08-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.